yxj
2024-03-15 7c6ccb5dcb2c33fdd6a7c18cef53ad1b07797251
PDA出门确认单列表模块修改
1个文件已修改
326 ■■■■■ 已修改文件
WebTM/views/WMS扫码模块/出门确认单/Xs_OutDoorCheckBillList_PDA.html 326 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/WMSɨÂëÄ£¿é/³öÃÅÈ·Èϵ¥/Xs_OutDoorCheckBillList_PDA.html
@@ -37,7 +37,7 @@
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label" style="width:60px;padding-left:0px;">单据号</label>
                                <input type="text" name="HBillNo" id="HBillNo" lay-verify="HBillNo" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();" style="width:180px;">
                                <input type="text" name="HBillNo" id="HBillNo" lay-verify="HBillNo" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();" style="width:190px;">
                            </div>
                            <div class="layui-row">
                                <label class="layui-form-label" style="width:100px;padding-left:1px;">销售出库单号</label>
@@ -197,9 +197,6 @@
                , cellMinWidth: 90
                , limit: 50
                , limits: [50, 500, 5000, 20000]
                //, done: function (res, curr, count) {
                //    soulTable.render(this);
                //}
            };
        }
        //#endregion
@@ -336,7 +333,6 @@
        }
        //#endregion
        //#region é€€å‡º
        function btn_Exit() {
            layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
@@ -345,9 +341,6 @@
        }
        //#endregion
        //#region é‡ç½®æŒ‰é’®
        form.on('submit(btnReSearch)', function (data) {
@@ -497,323 +490,6 @@
            $("#ColName").append(Organization);
            form.render('select');
        }
        //#endregion
        //#region ç¼–辑功能控件
        form.on('submit(cmdModify)', function () {
            var checkStatus = table.checkStatus('dj-table')
                , data = checkStatus.data;
            if (checkStatus.data.length === 1) {
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/WEBSController/TempList_Modify_Json",
                    async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                    data: { "HInterID": data[0].HInterID, "HBillNo": data[0].单据号, "HBillType": HBillType },
                    success: function (result) {
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            layer.open({
                                type: 2
                                , area: ['100%', '100%']
                                , title: '出门确认单'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: false //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../WMS扫码模块/出门确认/Xs_OutDoorCheckBill_PDA.html?OperationType=2&HInterID=' + data[0].HInterID, 'yes']
                                //, content: ['../../领料发货/出门确认/Xs_OutDoorCheckBill_Fast.html?OperationType=2&HInterID=' + data[0].HInterID, 'yes']
                                , resize: false
                                , cancel: function () {
                                    $(".layui-btn").removeClass("layui-btn-disabled");
                                }
                            })
                        }
                        else {
                            layer.msg(result.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: "温馨提示" });
                    }
                });
            }
            else {
                layer.msg('请先选中一行数据!');
            }
        });
        //#endregion
        //#region åˆ é™¤åŠŸèƒ½æŽ§ä»¶
        form.on('submit(cmdDelete)', function () {
            var checkStatus = table.checkStatus('dj-table')
                , data = checkStatus.data;
            if (checkStatus.data.length === 1) {
                layer.confirm("确认要删除选中行所有扫码记录?删除后将不可恢复!", { title: "删除确认" }, function (index) {
                    layer.load(3)
                    $.ajax(
                        {
                            type: "Get",
                            url: GetWEBURL() + "/WEBSController/set_DelPonderationBillMain_Temp_Json",
                            async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                            data: { "HInterID": data[0].HInterID, "HBillType": HBillType },
                            dataType: "json",
                            success: function (data) {
                                if (data.count == 1) {
                                    layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
                                        //显示缓存列表信息
                                        DisTempEntryList();
                                    });
                                }
                                else {
                                    playSound();
                                    layer.msg(data.Message, { icon: 2, 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.closeAll("loading");
                })
            }
            else {
                layer.msg('请选择一行数据删除!');
            }
        });
        //#endregion
        //#region åˆ·æ–°åŠŸèƒ½æŽ§ä»¶
        form.on('submit(cmdRefresh)', function () {
            //显示缓存列表信息
            DisTempEntryList();
        });
        //显示缓存列表信息
        function DisTempEntryList() {
            layer.load(3)
            $.ajax({
                type: "GET",
                url: GetWEBURL() + '/WEBSController/GetKf_PonderationBillMain_TempList_New_Json',
                async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                data: { "HBillType": HBillType, "HMaker": HMaker, "HStockOrgID": HStockOrgID },
                success: function (result) {
                    var data = [];
                    var col = [];
                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                        //给空的数组赋值
                        for (var key in result.list) {
                            //动态获取列表所有列名
                            data.push({ "id": result.list[key].ColmCols, "name": result.list[key].ColmCols, "Type": result.list[key].ColmType });
                            //获取不需要显示的列(H开头的列不显示)
                            var patrn = new RegExp(/^h/i);
                            if (patrn.test(result.list[key].ColmCols)) {
                                titleData[key] = result.list[key].ColmCols;
                            }
                        }
                        //在列表左边添加勾选框
                        col.push({ type: 'radio', fixed: 'left' });
                        for (var i = 0; i < data.length; i++) {
                            if ($.inArray(data[i].name, titleData) > -1) {
                                col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                            }
                            else {
                                switch (data[i].Type) {
                                    //int
                                    case 'DateTime':
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 150 });
                                        break;
                                    default:
                                    if (data[i].name == '单据号' || data[i].name == '组织' || data[i].name == '源单单号' || data[i].name == '单据内码') {
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', width: 150 });
                                    } else {
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center' });
                                    }
                                }
                            }
                        }
                        columns = col;
                        listOption.cols = [columns];
                        listOption.data = result.data;
                        //listOption.totalRow = true;
                        table.render(listOption);
                    }
                    else {
                        listOption.cols = [[
                            { field: '单据号', title: '单据号', width: 100 }
                            , { field: '制单人', title: '制单人', width: 100 }
                            , { field: '制单日期', title: '制单日期', width: 100 }
                            , { field: '数量', title: '数量', width: 100 }
                            , { field: '源单单号', title: '源单单号', width: 100 }
                            , { field: '组织', title: '组织', width: 100 }
                        ]];
                        listOption.data = data;
                        //listOption.totalRow = true;
                        table.render(listOption);
                        //layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                }
            });
            layer.closeAll("loading");
        }
        //#endregion
        //#region é€€å‡ºåŠŸèƒ½æŽ§ä»¶
        form.on('submit(cmdCancel)', function () {
            layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                parent.location.href = "../../../views/index_Mobile.html";
            });
        })
        //#endregion
        //#region æŸ¥è¯¢åŠŸèƒ½æŽ§ä»¶
        form.on('submit(cmdQuery)', function () {
            HBillNo = $("#HBillNo").val();
            HSourceBillNo = $("#HSourceBillNo").val();
            //显示已上传列表信息
            DisUploadedList();
        });
        //显示已上传列表信息
        function DisUploadedList() {
            $.ajax({
                type: "GET",
                url: GetWEBURL() + '/WEBSController/GetKf_ICStockBillQueryList_User_Json',
                async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                data: { "HBillType": HBillType, "HBillNo": HBillNo, "HSourceBillNo": HSourceBillNo, "HMaker": HMaker, "HStockOrgID": HStockOrgID },
                success: function (result) {
                    var data = [];
                    var col = [];
                    if (result.count == 1) {
                        //给空的数组赋值
                        for (var key in result.list) {
                            //动态获取列表所有列名
                            data.push({ "id": result.list[key].ColmCols, "name": result.list[key].ColmCols, "Type": result.list[key].ColmType });
                            //获取不需要显示的列(H开头的列不显示)
                            var patrn = new RegExp(/^h/i);
                            if (patrn.test(result.list[key].ColmCols)) {
                                UploadedtitleData[key] = result.list[key].ColmCols;
                            }
                        }
                        //在列表左边添加勾选框
                        col.push({ type: 'radio', fixed: 'left' });
                        for (var i = 0; i < data.length; i++) {
                            if ($.inArray(data[i].name, UploadedtitleData) > -1) {
                                col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                            }
                            else {
                                switch (data[i].Type) {
                                    //int
                                    case 'DateTime':
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 });
                                        break;
                                    default:
                                        if (data[i].name == '数量') {
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', width: 80 });
                                        } else {
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', width: 150 });
                                        }
                                }
                            }
                        }
                        Uploadedcolumns = col;
                        Uploadedoption.cols = [Uploadedcolumns];
                        Uploadedoption.data = result.data;
                        //Uploadedoption.totalRow = true;
                        table.render(Uploadedoption);
                    }
                    else {
                        Uploadedoption.cols = [[
                            { field: '单据号', title: '单据号', width: 100 }
                            , { field: '日期', title: '日期', width: 100 }
                            , { field: '制单人', title: '制单人', width: 100 }
                            , { field: '物料代码', title: '物料代码', width: 100 }
                            , { field: '物料名称', title: '物料名称', width: 100 }
                            , { field: '规格型号', title: '规格型号', width: 100 }
                            , { field: '数量', title: '数量', width: 100 }
                            , { field: '源单单号', title: '源单单号', width: 100 }
                            , { field: '组织', title: '组织', width: 100 }
                        ]];
                        Uploadedoption.data = data;
                        //Uploadedoption.totalRow = true;
                        table.render(Uploadedoption);
                        //layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                }
            });
        }
        //#endregion
        //#region æ’¤æ¶ˆåŠŸèƒ½æŽ§ä»¶
        form.on('submit(cmdRescind)', function () {
            var checkStatus = table.checkStatus('Uploaded-table')
                , data = checkStatus.data;
            if (checkStatus.data.length === 1) {
                layer.load(3)
                $.ajax(
                    {
                        type: "Get",
                        url: GetWEBURL() + "/WEBSController/DeleteICStockBillAndWMS_Json",
                        async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                        data: { "HInterID": data[0].HInterID, "HBillNo": data[0].单据号, "HBillType": HBillType },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) {
                                layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    element.tabChange('tab-Xs_OutDoorCheckBillList_PDA', '1');
                                    //显示缓存列表信息
                                    DisTempEntryList();
                                    //显示已上传列表信息
                                    DisUploadedList();
                                });
                            }
                            else {
                                playSound();
                                layer.msg(data.Message, { icon: 2, 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.closeAll("loading");
            }
            else {
                layer.msg('请选择一行记录,进行撤销!');
            }
        });
        //#endregion
    });