chengsc
2024-10-17 26356a0e6472be4620651adceddda0e38c78fffa
HTML/views/ASNSetting/ArrivalNotice.html
@@ -67,9 +67,9 @@
                  </div>
               </div>
               <div class="layui-inline">
                  <label class="layui-form-label">批次号</label>
                  <label class="layui-form-label">进厂编号</label>
                  <div class="layui-input-inline">
                     <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>
@@ -100,6 +100,7 @@
                        <option value="4">车间余料退回入库</option>
                        <option value="5">其它入库</option>
                        <option value="6">代储入库</option>
                        <option value="7">寄存入库</option>
                        <!-- JC09 -->
                        <!-- <option value="0">标准产品入库</option>
                        <option value="1">非标产品入库</option> -->
@@ -172,23 +173,25 @@
               <script type="text/html" id="toolbarDemo1">
                  {{# function GetBtn1(d){
                     var html = ''; 
                     if (d.Status == '0' && d.Origin == '录入') {
                        html += `<a class="layui-btn layui-btn-normal layui-btn-xs editClass" lay-event="edit">
                           <i class="layui-icon layui-icon-edit"></i>编辑</a>`;
                     }
                     switch (d.Status) {
                        case "0" :
                        html += `<a class="layui-btn layui-btn-normal layui-btn-xs editClass" lay-event="edit">
                              <i class="layui-icon layui-icon-edit"></i>编辑</a>
                              <a class="layui-btn layui-btn-danger layui-btn-xs delClass" lay-event="del">
                              <i class="layui-icon layui-icon-delete"></i>删除</a>
                           html += `<a class="layui-btn layui-btn-danger layui-btn-xs delClass" lay-event="del">
                                 <i class="layui-icon layui-icon-delete"></i>删除</a>`;
                           break; 
                        case "1" : 
                        html += `<a class="layui-btn layui-btn-normal layui-btn-xs clossClass" lay-event="closs">  <i class="layui-icon layui-icon-ok"></i>订单关闭</a>
                              <a class="layui-btn layui-btn-danger layui-btn-xs cheXiaoClass" lay-event="chexiao"> <i class="layui-icon layui-icon-delete"></i>撤销</a>`;
                           html += `<a class="layui-btn layui-btn-normal layui-btn-xs clossClass" lay-event="closs">  <i class="layui-icon layui-icon-ok"></i>关单</a>
                                 <a class="layui-btn layui-btn-danger layui-btn-xs cheXiaoClass" lay-event="chexiao"> <i class="layui-icon layui-icon-delete"></i>撤销</a>`;
                           break;
                        case "2" : 
                        html += `<a class="layui-btn layui-btn-normal layui-btn-xs clossClass" lay-event="closs">  <i class="layui-icon layui-icon-ok"></i>订单关闭</a>
                              <a class="layui-btn layui-btn-danger layui-btn-xs cheXiaoClass" lay-event="chexiao"> <i class="layui-icon layui-icon-delete"></i>撤销</a>`;
                           html += `<a class="layui-btn layui-btn-normal layui-btn-xs clossClass" lay-event="closs">  <i class="layui-icon layui-icon-ok"></i>关单</a>
                                 <a class="layui-btn layui-btn-danger layui-btn-xs cheXiaoClass" lay-event="chexiao"> <i class="layui-icon layui-icon-delete"></i>撤销</a>`;
                           break;
                        case "3" : 
                        html += `<a class="layui-btn layui-btn-normal layui-btn-xs checkClass" lay-event="check">  <i class="layui-icon layui-icon-ok"></i>复核</a>`;
                           html += `<a class="layui-btn layui-btn-normal layui-btn-xs checkClass" lay-event="check">  <i class="layui-icon layui-icon-ok"></i>复核</a>`;
                           break;
                        default : 
                        break; 
@@ -241,6 +244,8 @@
                           html = `其它入库`; 
                        }else if(d.Type=='6') { 
                           html = `代储入库`; 
                        }else if(d.Type=='7') {
                           html = `寄存入库`;
                        }else {
                           
                        }
@@ -300,15 +305,24 @@
               </script>
 
               <script type="text/html" id="toolbarDemoList">
                  {{# function GetBtn2(d){
                  {{# function GetBtn2(d){
                     console.log(d);
                        var html = ``;
                        if(d.Status == "0"){ 
                           html = `<a class="layui-btn layui-btn-danger layui-btn-xs delClass" lay-event="del"> 
                              <i class="layui-icon layui-icon-delete"></i>删除</a>`; 
                        }
                        if(d.Status == "0" || d.Status == "1"){
                           html += `<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="Addlabel">
                        if(d.AsnType =="1" && (d.Status == "0" || d.Status == "1")){
                           html += `<a class="layui-btn layui-btn-normal layui-btn-xs addLabelClass" lay-event="Addlabel">
                              <i class="layui-icon layui-icon-edit"></i>生成标签</a>`; 
                        }
                        if(d.AsnType == "4"&& (d.Status == "0" || d.Status == "1")){
                           html += `<a class="layui-btn layui-btn-normal layui-btn-xs addLabelClass" lay-event="Addlabel2">
                              <i class="layui-icon layui-icon-edit"></i>生成标签</a>`;
                        }
                        if(d.AsnType == "5"&& (d.Status == "0" || d.Status == "1") && (d.PackagNo != ""|| d.PackagNo!=null)){
                           html += `<a class="layui-btn layui-btn-normal layui-btn-xs addLabelClass" lay-event="Addlabel">
                              <i class="layui-icon layui-icon-edit"></i>生成标签</a>`;
                        }
                        return html;
                     } 
@@ -393,7 +407,7 @@
            elem: '#EndTime'
            , format: 'yyyy-MM-dd' //可任意组合
         });
         var h1 = GetTableTopHeight();
         var h2 = GetTableBottomHeight();
@@ -405,165 +419,26 @@
         var TotalColsArr = [[
                  {field: '',title: '序号',type:'numbers',width: 50,align: 'center',fixed: 'left', "disabled": true},
                  {field: 'ASNNo',title: '入库单号',align: 'center',fixed: 'left',sort: true,width: 180, "disabled": true},
                  {field: 'Status',title: '执行状态',align: 'center',templet: '#buttonTpl'},
                  {field: 'Status',title: '执行状态',align: 'center',width: 100,templet: '#buttonTpl'},
                  {field: 'Origin',title: '来源',align: 'center',width: 80},
                  {field: 'OrderCode',title: '上游单号',align: 'center',width: 180},
                  {field: 'CustomerName',title: '客户名称',align: 'center'},
                  {field: 'Type',title: '单据类型',align: 'center',templet: '#templetType'},
                  {field: 'CompleteTime',title: '完成时间',align: 'center',templet: '#templetCompleteTime'},
                  {field: 'Type',title: '单据类型',align: 'center',width: 100,templet: '#templetType'},
                  {field: 'CompleteTime',title: '完成时间',align: 'center',width: 165,templet: '#templetCompleteTime'},
                  {field: 'Demo',title: '备注',align: 'center',width: 180},
                  {field: 'CreateUserName',title: '创建人',align: 'center',width: 110},
                  {field: 'CreateTime',title: '创建时间',align: 'center',templet: '#templetCreateTime'},
                  {field: 'CreateTime',title: '创建时间',align: 'center',width: 165,templet: '#templetCreateTime'},
                  {field: 'UpdateUserName',title: '修改人',align: 'center',width: 110},
                  {field: 'UpdateTime',title: '修改时间',align: 'center',templet: '#templetUpdateTime'},
                  {field: 'UpdateTime',title: '修改时间',align: 'center',width: 165,templet: '#templetUpdateTime'},
                  {field: 'CheckUserName',title: '复核人',align: 'center',width: 110},
                  {field: 'CheckTime',title: '复核时间',align: 'center',templet: '#templetCheckTime'},
                  {field: 'CheckTime',title: '复核时间',align: 'center',width: 165,templet: '#templetCheckTime'},
                  {field: 'caozuo',title: '操作',fixed: 'right',width: 280,align: 'center',toolbar: '#toolbarDemo1', "disabled": true}
               ]];
         var TotalColsSysArr=encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//将表头数据进行url编码
         //#endregion
         function refreshTable() {
            //#region 原始非自定义列
            // var param = {
            //       ASNNo: $("#ASNNo").val(),
            //       Type: $("#Type").val(),
            //       Status: $("#Status").val(),
            //       CustomerName: $("#CustomerName").val(),
            //       LotNo: $("#LotNo").val(),
            //       SkuNo: $("#SkuNo").val(),
            //       SkuName: $("#SkuName").val(),
            //       StartTime:$("#StartTime").val(),
            //       EndTime: $("#EndTime").val()
            // };
            // table.render({
            //    elem: '#LAY-app-content-list',
            //    url: IP + "/BllAsn/GetArrivalNoticeList",
            //    method: 'POST',
            //    height: h1,
            //    id: 'LAY-app-content-list',
            //    where: param,
            //    contentType: 'application/json',
            //    headers:{ToKen:$.cookie('token')},
            //    page: true,
            //    even: true,
            //    limit: pageCnt,
            //    limits: pageLimits,
            //    cellMinWidth: 60, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
            //    done: function(res) {
            //       setRight();
            //       //aaa = $('#LAY-app-content-list').next().find('.layui-table-main').find('tr[data-index="0"]').find('td[data-field="ASNNo"]');
            //       // refreshTablemx(res.data[0].ASNNo);
            //    },
            //    cols: [
            //       [{
            //          title: '序号',
            //          type: 'numbers',
            //          width: 50,
            //          align: 'center',
            //          fixed: 'left'
            //       },
            //        {
            //          field: 'ASNNo',
            //          title: '入库单号',
            //          align: 'center',
            //          fixed: 'left',
            //          sort: true,
            //          width: 180
            //       },
            //       {
            //          field: 'Status',
            //          title: '执行状态',
            //          align: 'center',
            //          templet: function (d) {
            //                switch (d.Status) {
            //                   case "0" : return '<button class="layui-btn layui-btn-radius layui-btn-xs">等待执行</button>';
            //                   case "1" : return '<button class="layui-btn layui-btn-radius layui-btn-danger layui-btn-xs">正在执行</button>';
            //                   case "2" : return '<button class="layui-btn layui-btn-radius layui-btn-normal layui-btn-xs">执行完毕</button>';
            //                   case "3" : return '<button class="layui-btn layui-btn-radius layui-btn-normal layui-btn-xs">订单关闭</button>';
            //                   default : return "";
            //                }
            //             }
            //       },
            //       {
            //          field: 'Origin',
            //          title: '来源',
            //          align: 'center',
            //          width: 80
            //       },
            //       {
            //          field: 'CustomerName',
            //          title: '客户名称',
            //          align: 'center'
            //       },
            //       {
            //          field: 'Type',
            //          title: '单据类型',
            //          align: 'center',
            //          templet: function (d) {
            //                switch (d.Type) {
            //                   case "0" : return "标准产品入库";
            //                   case "1" : return "非标产品入库";
            //                   default : return "";
            //                }
            //                // JC08
            //                // switch (d.Status) {
            //                //    case "0" : return "成品入库";
            //                //    case "1" : return "原料入库";
            //                //    case "2" : return "退货入库";
            //                //    default : return "";
            //                // }
            //             }
            //       },
            //       {
            //          field: 'CompleteTime',
            //          title: '完成时间',
            //          align: 'center',
            //          hide:true,
            //          templet: function (d) {
            //             return formatDate2(d.CompleteTime);
            //          }
            //       },
            //       {
            //          field: 'CreateUserName',
            //          title: '创建人',
            //          align: 'center',
            //          width: 110
            //       },
            //       {
            //          field: 'CreateTime',
            //          title: '创建时间',
            //          align: 'center',
            //          templet: function (d) {
            //             return formatDate(d.CreateTime);
            //          }
            //       },
            //       {
            //          field: 'UpdateUserName',
            //          title: '修改人',
            //          align: 'center',
            //          hide:false,
            //          width: 110
            //       },
            //       {
            //          field: 'UpdateTime',
            //          title: '修改时间',
            //          align: 'center',
            //          hide:false,
            //          templet: function (d) {
            //             return formatDate(d.UpdateTime);
            //          }
            //       }, {
            //          title: '操作',
            //          fixed: 'right',
            //          width: 240,
            //          align: 'center',
            //          toolbar: '#toolbarDemo1'
            //       }]
            //    ]
            // });
            //#endregion
            //#region 自定义表头
            var colsJson
            var param1={
@@ -626,8 +501,8 @@
                  {field: 'SkuNo',title: '物料编码',align: 'center',width: 100}, 
                  {field: 'SkuName',title: '物料名称',align: 'center',width: 200}, 
                  {field: 'Standard',title: '物料规格',align: 'center',width: 130}, 
                  {field: 'LotNo',title: '批次号',align: 'center',width: 100},
                  {field: 'SupplierLot',title: '供货批次',align: 'center',width: 100},
                  {field: 'LotNo',title: '进厂编号',align: 'center',width: 100},
                  {field: 'SupplierLot',title: '原厂批号',align: 'center',width: 100},
                  {field: 'Qty',title: '数量',align: 'center',width: 70}, 
                  {field: 'FactQty',title: '已组数量',align: 'center',width: 90}, 
                  {field: 'CompleteQty',title: '完成数量',align: 'center',width: 90}, 
@@ -639,6 +514,7 @@
                  {field: 'PackagName',title: '包装名称',align: 'center',width: 110,}, 
                  {field: 'IsBale',title: '是否裹包',align: 'center',width: 150}, 
                  {field: 'IsBelt',title: '是否打带',align: 'center',width: 150},
                  {field: 'OrderDetailCode',title: '上游单号',align: 'center',width: 180},
                  {field: 'UDF1',title: '自定义列1',align: 'center',width: 140}, 
                  {field: 'UDF2',title: '自定义列2',align: 'center',width: 140}, 
                  {field: 'UDF3',title: '自定义列3',align: 'center',width: 140}, 
@@ -653,186 +529,7 @@
         var DetailColsSysArr=encodeURIComponent(encodeURIComponent(JSON.stringify(DetailColsArr)))//将表头数据进行url编码
         //#endregion
         function refreshTablemx(asnNo) {
            //#region 原始非自定义列
            // var param = {
            //    ASNNo:asnNo
            // };
            // table.render({
            //    elem: '#LAY-app-content-list2',
            //    url: IP + "/BllAsn/GetArrivalNoticeDetailList",
            //    method: 'POST',
            //    height: h2,
            //    id: 'LAY-app-content-list2',
            //    where: param,
            //    contentType: 'application/json',
            //    toolbar:'#toolbarDemo',
            //    defaultToolbar:  ['filter'], //'print', 'exports'
            //    headers:{ToKen:$.cookie('token')},
            //    page: true,
            //    limit: pageCnt,
            //    limits: pageLimits,
            //    cellMinWidth: 60, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
            //    done: function() {
            //       setRight()
            //    },
            //    cols: [
            //       [{
            //          title: '序号',
            //          type: 'numbers',
            //          width: 50,
            //          align: 'center',
            //          fixed: 'left'
            //       },
            //       {
            //          field: 'ASNNo',
            //          title: '入库单号',
            //          align: 'center',
            //          fixed: 'left',
            //          sort: true,
            //          width: 180
            //       },
            //       {
            //          field: 'SkuNo',
            //          title: '物料编码',
            //          align: 'center',
            //          width: 100
            //       }, {
            //          field: 'SkuName',
            //          title: '物料名称',
            //          align: 'center',
            //          width: 200
            //       }, {
            //          field: 'Standard',
            //          title: '物料规格',
            //          align: 'center',
            //          width: 130
            //       }, {
            //          field: 'LotNo',
            //          title: '批次号',
            //          align: 'center',
            //          width: 100
            //       },{
            //          field: 'SupplierLot',
            //          title: '供货批次',
            //          align: 'center',
            //          fixed: 'right',
            //          width: 100,
            //          hide:true
            //       }, {
            //          field: 'Qty',
            //          title: '数量',
            //          align: 'center',
            //          width: 70
            //       }, {
            //          field: 'FactQty',
            //          title: '已组数量',
            //          align: 'center',
            //          width: 90
            //       }, {
            //          field: 'CompleteQty',
            //          title: '完成数量',
            //          align: 'center',
            //          width: 90
            //       },
            //       {
            //          field: 'CompleteTime',
            //          title: '完成时间',
            //          align: 'center',
            //          width: 160,
            //          templet: function (d) {
            //             return formatDate(d.CompleteTime);
            //          }
            //       },
            //       {
            //          field: 'UnitName',
            //          title: '计量单位',
            //          align: 'center',
            //          width: 90
            //       },
            //       {
            //          field: 'Price',
            //          title: '单价',
            //          align: 'center',
            //          width: 65,
            //          hide:true
            //       }, {
            //          field: 'Money',
            //          title: '金额',
            //          align: 'center',
            //          width: 65,
            //          hide:true
            //       },
            //       {
            //          field: 'LotText',
            //          title: '批次描述',
            //          align: 'center',
            //          width: 120
            //       },{
            //          field: 'PackagName',
            //          title: '包装名称',
            //          align: 'center',
            //          width: 110,
            //       }, {
            //          field: 'IsBale',
            //          title: '是否裹包',
            //          align: 'center',
            //          width: 150,
            //          hide:true
            //       }, {
            //          field: 'IsBelt',
            //          title: '是否打带',
            //          align: 'center',
            //          width: 150,
            //          hide:true
            //       },{
            //          field: 'CreateUserName',
            //          title: '创建人',
            //          align: 'center',
            //          width: 100
            //       },
            //       {
            //          field: 'CreateTime',
            //          title: '创建时间',
            //          align: 'center',
            //          width: 160,
            //          templet: function (d) {
            //             return formatDate(d.CreateTime);
            //          }
            //       },
            //       // {
            //       //    field: 'Id',
            //       //    title: '入库明细Id',
            //       //    align: 'center',
            //       //    hide: true,
            //       //    width: 150,
            //       // },
            //       {
            //          field: 'UpdateUserName',
            //          title: '修改人',
            //          align: 'center',
            //          hide:true,
            //          width: 150,
            //       },
            //       {
            //          field: 'UpdateTime',
            //          title: '修改时间',
            //          align: 'center',
            //          hide:true,
            //          width: 150,
            //          templet: function (d) {
            //             return formatDate(d.UpdateTime);
            //          }
            //       },  {
            //          title: '操作',
            //          fixed: 'right',
            //          width: 100,
            //          align: 'left',
            //          toolbar: '#toolbarDemoList'
            //       }]
            //    ]
            // });
            //#endregion
            //#region 自定义表头
            var colsJson2
@@ -888,6 +585,8 @@
               $(".clossClass").hide(); 
               $(".editDemoClass").hide();//备注
               $(".checkClass").hide(); //复核
               $(".addLabelClass").hide(); //复核
            });
            sendData(IP + "/Basis/GetRoleRightList", {}, 'get', function(res) {
               if (res.code == 0) { //成功 
@@ -925,6 +624,11 @@
                     if (res.data[k].MenuName == "复核入库单") {
                        $(function() {
                           $(".checkClass").show(); 
                        });
                     }
                     if (res.data[k].MenuName == "生成标签") {
                        $(function() {
                           $(".addLabelClass").show();
                        });
                     }
                  }
@@ -1176,7 +880,7 @@
                  layer.open({
                     type: 2,
                     title: '生成标签',
                     content: 'LabelPrintSelect.html',
                     content: 'LabelPrintSelect.html?Id='+id+'&SupplierLot='+data.SupplierLot,
                     maxmin: true,
                     area: ['480px', '615px'],
                     btn: ['确定','取消'],
@@ -1190,7 +894,48 @@
                           console.log(field);
                           //提交 Ajax 成功后,静态更新表格中的数据
                           //"&Level="+field.level+"&Type="+field.type+"&BoxType="+field.boxType+"&Qty="+field.qty+
                           var str = "Id="+id+"&Reset="+field.reset+"&ArriveQty="+field.arriveQty+"&ProductionTime="+field.productionTime+"&ExpirationTime="+field.expirationTime+"&StoreTime="+field.storeTime;
                           var str = "Id="+id+"&IsReset="+field.reset+"&ArriveQty="+field.arriveQty
                           +"&ProductionTime="+field.productionTime+"&ExpirationTime="+field.expirationTime
                           +"&StoreTime="+field.storeTime+"&SupplierLot="+field.SupplierLot;
                           layer.open({
                              type: 2,
                              title: '生成标签',
                              content: 'LabelPrint.html?'+str,
                              maxmin: true,
                              area: ['660px', '660px'],
                              btn: ['取消'],
                           });
                        });
                        submit.trigger('click');
                     }
                  });
                  break;
               case "Addlabel2" :
                  layer.open({
                     type: 2,
                     title: '生成标签',
                     content: 'LabelPrintSelect.html?Id='+id+'&Type=4'+'&SupplierLot='+data.SupplierLot,
                     maxmin: true,
                     area: ['480px', '615px'],
                     btn: ['确定','取消'],
                     yes: function(index, layero){
                        var iframeWindow = window['layui-layer-iframe'+ index]
                        ,submitID = 'layuiadmin-app-form-edit'
                        ,submit = layero.find('iframe').contents().find('#'+ submitID);
                        //监听提交
                        iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
                           var field = data.field; //获取提交的字段
                           console.log(field);
                           //提交 Ajax 成功后,静态更新表格中的数据
                           //"&Level="+field.level+"&Type="+field.type+"&BoxType="+field.boxType+"&Qty="+field.qty+
                           var str = "Id="+id+"&IsReset="+field.reset+"&ArriveQty="+field.arriveQty
                           +"&ProductionTime="+field.productionTime+"&ExpirationTime="+field.expirationTime
                           +"&StoreTime="+field.storeTime+'&SupplierLot='+field.SupplierLot;
                           
                           layer.open({
                              type: 2,