zzr99
2022-05-13 98dc0e707444ccc3d576864f1727675cbfbc6b98
WebTM/views/¹«¹²Ò³Ãæ/Kf_BarCodeEditDlg.html
@@ -101,8 +101,25 @@
            }
            return vars;
        }
        //获取页面跳转参数
        var params = getUrlVars();
        var tableData = params[params[0]];
        if (typeof (params[params[0]]) == "undefined") {
            var OperationType = 1;//操作类型
        } else {
            var HInterID = params[params[0]];//单据ID
            var HMaterID = params[params[1]];//物料ID
            var HAuxPropID = params[params[2]];//辅助属性
            var HMTONo = params[params[3]];//计划跟踪号
            var HWhID = params[params[4]];//仓库ID
            var HSPID = params[params[5]];//仓位ID
            var HSCWHID = params[params[6]];//调出仓库ID
            var HSCSPID = params[params[7]];//调出仓位ID
            var HBatchNo = params[params[8]];//批次
            var HSourceInterID = params[params[9]];//源单主ID
            var HSourceEntryID = params[params[10]];//源单子ID
            var HBillType = params[params[11]];//单据类型
            var HBarCode = params[params[12]];//条码
        }
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
@@ -118,22 +135,132 @@
            table.render({
            elem: '#mx-table'
                // , url: 'http://localhost:8083/Web/GetHBarCodeShowBillSub'
         , data: [{HSonNo:'1',HBarCode:'421458026',HQty:'200',HBatchNo:'20200311',HWHID:'12',HStockPlaceID:'133',HMaterID:'66',HMTONo:'c19-078-019'}]
         , cols: [[
                //, url: 'http://localhost:8083/Web/GetHBarCodeShowBillSub'
                 ,url: GetWEBURL() + "/Web/GetHBarCodeShowBillSub"
                , where: {
                    "HInterID": HInterID, "HMaterID": HMaterID, "HAuxPropID": HAuxPropID, "HMTONo": HMTONo, "HWhID": HWhID, "HSPID": HSPID, "HSCWHID": HSCWHID
                    , "HSCSPID": HSCSPID, "HBatchNo": HBatchNo, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "HBillType": HBillType,sWhere: ''
                },
             cols: [[
             { type: 'radio' }
           , { field: 'HSonNo', title: '序号', width: 100 }
           , { field: 'HBarCode', title: '条形码', width: 200 }
           , { field: 'HQty', title: '数量', width: 100 }
           , { field: 'HBatchNo', title: '批次', width: 150 }
           , { field: 'HWHID', title: '仓库', width: 100, hide: true }
           , { field: 'HStockPlaceID', title: '仓位', width: 100, hide: true }
           , { field: 'HMaterID', title: '物料ID', width: 100,hide:true }
           , { field: 'HMTONo', title: '计划跟踪单号', width: 150 }
         ]]
            // , data: [linterid]
        });
    });
            });
            //#region åˆ é™¤
            form.on('submit(cmdDel)', function () {
                var checkStatus = table.checkStatus('mx-table')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var HBarCode = data[0].HBarCode.toString();
                    //逻辑删除方法
                    layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                        $.ajax({
                            type: "GET",
                            url: GetWEBURL() + "Kf_BarCodeEditDlg/DeltetBill", //方法所在页面和方法名
                            data: { "HInterID": HInterID, "HBarCode": HBarCode, "HBillType": HBillType },
                            success: function (result) {
                                if (result.count == 1) {
                                    layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                        // å¾—到frame索引
                                        var index = layer.getFrameIndex(window.name);
                                        //关闭当前frame
                                        layer.close(index);
                                        //修改成功后刷新界面
                                        window.location.reload();
                                    });
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                }
                            }, error: function () {
                                layer.alert("接口请求失败!", { icon: 5 });
                            }
                        });
                    })
                }
                else {
                    layer.msg('请选择一行数据删除!');
                }
            })
            //编辑
            //form.on('submit(cmdChange)', function () {//编辑
            //    var checkStatus = table.checkStatus('mx-table')
            //        , data = checkStatus.data;
            //    var sQty = data[0].HQty.toString();
            //    var iQty = $('#HQty').val()
            //        $.ajax(
            //            {
            //                type: "Get",
            //                //url: "http://61.130.49.162:9090/WMSAPI///ProductIn/Delete_Json", //方法所在页面和方法名
            //                url: GetWEBURL() + "/Kf_BarCodeEditDlg/GetCheckQtyByBarCodeBill",
            //                async: true,
            //                data: {
            //                    "HInterID": HInterID, "HBillType": HBillType, "sBatchNo": HBatchNo, "sBarCode": HBarCode, "sSCWhID": HSCWHID
            //                    , "sSCSPID": HSCSPID, "sAuxPropID": HAuxPropID, "sMTONo": HMTONo, "iQty": iQty
            //                    , "HMaterID": HMaterID, "sWhID": HWhID, "sSPID": HSPID, "HSourceInterID": HSourceInterID
            //                    , "HSourceEntryID": HSourceEntryID, "EndQty": EndQty, "sQty": sQty
            //                },
            //                dataType: "json",
            //                success: function (data) {
            //                    if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
            //                        table.render({
            //                            elem: '#mx-table'
            //                            //, url: 'http://localhost:8083/Web/GetHBarCodeShowBillSub'
            //                            , url: GetWEBURL() + "/Web/GetHBarCodeShowBillSub"
            //                            , where: {
            //                                "HInterID": HInterID, "HMaterID": HMaterID, "HAuxPropID": HAuxPropID, "HMTONo": HMTONo, "HWhID": HWhID, "HSPID": HSPID, "HSCWHID": HSCWHID
            //                                , "HSCSPID": HSCSPID, "HBatchNo": HBatchNo, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "HBillType": HBillType
            //                            },
            //                            cols: [[
            //                                { type: 'radio' }
            //                                , { field: 'HSonNo', title: '序号', width: 100 }
            //                                , { field: 'HBarCode', title: '条形码', width: 200 }
            //                                , { field: 'HQty', title: '数量', width: 100 }
            //                                , { field: 'HBatchNo', title: '批次', width: 150 }
            //                                , { field: 'HMTONo', title: '计划跟踪单号', width: 150 }
            //                            ]]
            //                            // , data: [linterid]
            //                        });
            //                        alert("编辑成功!");
            //                    }
            //                    else {
            //                        layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
            //                    }
            //                },
            //                error: function (err) {
            //                    layer.msg('错误' + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
            //                }
            //            });
            //        layer.open({
            //            type: 2
            //            , area: ['100%', '100%']
            //            , title: '明细列表'
            //            , shade: 0.6 //遮罩透明度
            //            , maxmin: true //允许全屏最小化
            //            , anim: 0 //0-6的动画形式,-1不开启
            //            , content: ['../../../views/公共页面/Kf_BarCodeEditDlg.html?HInterID=' + HInterID + '&HMaterID = ' + HMaterID + '&HAuxPropID = ' + HAuxPropID + '& HMTONo = ' + HMTONo + '&HWhID = ' + HWhID + '&HSPID = ' + HSPID + '&HSCWHID = ' + HSCWHID + '&HSCSPID= ' + HSCSPID + '&HBatchNo= ' + HBatchNo + '&HSourceInterID= ' + HSourceInterID + '&HSourceEntryID= ' + HSourceEntryID + '&HBillType=  ' + HBillType + '&HBarCode=  ' + HBarCode + ''
            //                , 'yes']
            //            , resize: false
            //            , cancel: function () {
            //                //$(".layui-btn").removeClass("layui-btn-disabled");
            //            }
            //        })
            //    } else {
            //        layer.msg('请选择一行数据编辑!');
            //    }
            })
    </script>
</body>
</html>