chengsc
2024-10-17 26356a0e6472be4620651adceddda0e38c78fffa
HTML/views/StatisticalReport/InventoryStatistics.html
@@ -65,9 +65,9 @@
                  </div>
               </div>
               <div class="layui-inline mingxi">
                  <label class="layui-form-label" style="width: 60px;">批次号</label>
                  <label class="layui-form-label" style="width: 60px;">进厂编号</label>
                  <div class="layui-input-inline" style="width: 170px; margin-right: 0px;">
                     <input type="text" id="LotNo" name="LotNo" placeholder="批次号" autocomplete="off"
                     <input type="text" id="LotNo" name="LotNo" placeholder="进厂编号" autocomplete="off"
                        class="layui-input">
                  </div>
               </div>
@@ -296,7 +296,7 @@
         var $ = layui.$;
         var yemianid = 0;
         refreshTable("", "");
         refreshTable("", "","","","");
         // 表单需要的变量
         var infoOptions;
@@ -357,7 +357,7 @@
                  {field: 'SkuNo',title: '物料编码',align: 'center',totalRowText: "合计:", "disabled": true}, 
                  {field: 'SkuName',title: '物料名称',align: 'center', "disabled": true}, 
                  {field: 'Standard',title: '物料规格',align: 'center', "disabled": true},
                  {field: 'LotNo',title: '批次号',align: 'center', "disabled": true},
                  {field: 'LotNo',title: '进厂编号',align: 'center', "disabled": true},
                  {field: 'LotText',title: '批次描述',align: 'center'},
                  {field: 'OwnerNo',title: '货主编码',align: 'center'},
                  {field: 'OwnerName',title: '货主名称',align: 'center'}, 
@@ -368,7 +368,7 @@
         var TotalColsSysArr=encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//将表头数据进行url编码
         //#endregion
         //获取总量信息
         function refreshTable() {
         function refreshTable(SkuNo,SkuName,OwnerNo,OwnerName,LotNo) {
            //#region 自定义表头
            var colsJson
            var param1={
@@ -400,8 +400,14 @@
                  }, 
                  cols:colsJson
               };
               sendData(IP + "/Statistical/GetInventoryList?SkuNo=" + $("#SkuNo").val() + "&&SkuName=" + $("#SkuName").val() + "&&OwnerNo=" + $("#OwnerNo").val()+ "&&OwnerName=" + $("#OwnerName").val()+"&&LotNo=" + $("#LotNo").val(), {}, 'get', function (res) {
               var param = {
                  SkuNo:SkuNo, //物料号
                  SkuName:SkuName, //物料名称
                  OwnerNo:OwnerNo, //货主编码
                  OwnerName:OwnerName, //货主名称
                  LotNo:LotNo, //进厂编号
               };
               sendData(IP + "/Statistical/GetInventoryList", param, 'get', function (res) {
                  console.log(res)
                  if (res.code == 0) { //成功
                     var list = res.data;
@@ -474,7 +480,7 @@
         //            align: 'center',
         //         }, {
         //            field: 'LotNo',
         //            title: '批次号',
         //            title: '进厂编号',
         //            align: 'center',
         //         }, {
         //            field: 'Qty',
@@ -524,11 +530,11 @@
                  {field: 'SkuNo',title: '物料编码',width: 100,align: 'center'}, 
                  {field: 'SkuName',title: '物料名称',align: 'center'}, 
                  {field: 'Standard',title: '物料规格',width: 130,align: 'center'}, 
                  {field: 'LotNo',title: '批次号',align: 'center'},
                  {field: 'LotNo',title: '进厂编号',align: 'center'},
                  {field: 'OwnerNo',title: '货主编码',align: 'center'},
                  {field: 'OwnerName',title: '货主名称',align: 'center'}, 
                  {field: 'SupplierNo',title: '供应商编码',align: 'center'},
                  {field: 'SupplierName',title: '供应商名称',align: 'center'},
                  {field: 'SupplierNo',title: '生产商编码',align: 'center'},
                  {field: 'SupplierName',title: '生产商名称',align: 'center'},
                  {field: 'Qty',title: '库存数量',width: 110,align: 'center'}, 
                  {field: 'LockQty',title: '锁定数量',width: 110,align: 'center'},
                  {field: 'Status',templet: '#buttonTpl',title: '库存状态',width: 90,align: 'center'}, 
@@ -537,7 +543,7 @@
               ]];
         var DetailColsSysArr=encodeURIComponent(encodeURIComponent(JSON.stringify(DetailColsArr)))//将表头数据进行url编码
         //#endregion
         function refreshTable2(sku,lotNo) {
         function refreshTable2(SkuNo,SkuName,OwnerNo,OwnerName,LotNo,LocatNo,PalletNo,Status,InspectStatus) {
            //#region 自定义表头
            var colsJson2
            var param1={
@@ -568,8 +574,18 @@
                  },    
                  cols:colsJson2
               };
               sendData(IP + "/Statistical/GetInventoryList1?SkuNo=" + sku + "&&SkuName=" + $("#SkuName").val() + "&&LotNo=" + lotNo + "&&LocatNo=" + $("#LocatNo").val() + "&&PalletNo=" + $("#PalletNo").val() + "&&Status=" + $("#Status").val() + "&&InspectStatus=" + $("#InspectStatus").val()+ "&&OwnerNo=" + $("#OwnerNo").val()+ "&&OwnerName=" + $("#OwnerName").val(), {}, 'get', function (res) {
               var param = {
                  SkuNo:SkuNo, //物料号
                  SkuName:SkuName, //物料名称
                  OwnerNo:OwnerNo, //货主编码
                  OwnerName:OwnerName, //货主名称
                  LotNo:LotNo, //进厂编号
                  LocatNo:LocatNo,//储位地址
                  PalletNo:PalletNo, //托盘号
                  Status:Status,//库存状态
                  InspectStatus:InspectStatus //质检状态
               };
               sendData(IP + "/Statistical/GetInventoryList1", param, 'get', function (res) {
                  if (res.code == 0) //成功
                  {
                     var list = res.data;
@@ -595,8 +611,6 @@
         
         //var url = IP + "/Statistical/GetInventoryList1";
         //接受全局变量
         let quanSkuNo = '';
         let quanLotNo='';
@@ -613,12 +627,12 @@
            var InspectStatus = $("#InspectStatus").val();
            if (yemianid == 0) {
               console.log("总单");
               refreshTable(SkuNo, SkuName);
               refreshTable(SkuNo, SkuName,OwnerNo,OwnerName,LotNo);
            } else if (yemianid == 1) {
               quanSkuNo = '';
               quanLotNo='';
               console.log("明细");
               refreshTable2(SkuNo,LotNo);
               refreshTable2(SkuNo,SkuName,OwnerNo,OwnerName,LotNo,LocatNo,PalletNo,Status,InspectStatus);
            }
         });
@@ -631,20 +645,29 @@
            console.log(obj);
            quanSkuNo = obj.data.SkuNo;
            quanLotNo=obj.data.lotNo;
            refreshTable2(obj.data.SkuNo,obj.data.LotNo);
            refreshTable2(obj.data.SkuNo,"","","",obj.data.LotNo);
            yemianid = 1;
         });
         //监听Tab切换,以改变地址hash值
         element.on('tab(docDemoTabBrief)', function (data) {
            var SkuNo = $("#SkuNo").val();
            var SkuName = $("#SkuName").val();
            var LotNo = $("#LotNo").val();
            var LocatNo = $("#LocatNo").val();
            var PalletNo = $("#PalletNo").val();
            var OwnerNo = $("#OwnerNo").val();
            var OwnerName = $("#OwnerName").val();
            var Status = $("#Status").val();
            var InspectStatus = $("#InspectStatus").val();
            console.log(data.index);
            yemianid = data.index
            if (yemianid == 0) {
               console.log("总单");
               refreshTable(SkuNo, SkuName);
               refreshTable(SkuNo, SkuName,OwnerNo,OwnerName,LotNo);
            } else if (yemianid == 1) {
               console.log("明细");
               refreshTable2(quanSkuNo,quanLotNo);
               refreshTable2(SkuNo,SkuName,OwnerNo,OwnerName,LotNo,LocatNo,PalletNo,Status,InspectStatus);
            }
         });