yxj
2024-10-10 8fc3522a72ffb05e8edd4e186f3ab41d64359516
WebTM/views/WMSɨÂëÄ£¿é/¿Í»§ÌõÂëɨÃè/Gy_getCusBarCodeBill_PDA.html
@@ -56,6 +56,14 @@
                                <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdHBarCode">确定</button>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-xs3">
                                <label class="layui-form-label" style="width:50px;padding-left:0px;">合计&nbsp;&nbsp;数量</label>
                            </div>
                            <div class="layui-col-xs8">
                                <input type="text" name="HQty_Total" id="HQty_Total" lay-verify="HQty_Total" autocomplete="off" class="layui-input" readonly>
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab" lay-filter="tab-Sc_PackUnionBill_PDA">
                        <ul class="layui-tab-title" lay-filter="tab-all">
@@ -83,6 +91,9 @@
                                    </div>
                                    <div class="layui-col-xs8 layui-input-inline mobile">
                                        <input type="text" name="HBillNo" id="HBillNo" lay-verify="HBillNo" autocomplete="off" class="layui-input">
                                    </div>
                                    <div class="layui-col-xs2">
                                        <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdHBillNoChange">修改</button>
                                    </div>
                                </div>
                                <div class="layui-row">
@@ -156,6 +167,7 @@
            var params = getBillTemp();
            var HInterID_Temp = params[params[0]];      //从缓存列表中返回单据ID
            var HBillNo_Temp = params[params[1]];       //从缓存列表中返回单据号
            var HModName_Temp = params[params[2]];      //从维护页面返回模块名
            //#endregion
            //#region åˆ¤æ–­æ˜¯å¦ç™»å½• æœªç™»å½•则跳到登录页
@@ -247,12 +259,14 @@
                if (HBarCode_Pre == "" || HBarCode_Pre_Flag != 1) {
                    playSound();
                    layer.msg("统一前缀不能为空,请设置统一前缀并确认!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    $('#HBarCode').val("");
                    return false;
                }
                if (sBarCode.indexOf(HBarCode_Pre) != 0) {
                    playSound();
                    layer.msg("条码前缀不为统一前缀,请检查条码!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    $('#HBarCode').val("");
                    return false;
                }
@@ -331,8 +345,29 @@
                                    }
                                }
                            }
                            //for (var i = 0; i < data1.data.length; i++) {
                            //    data1.data[i]["HQty"] = 1;
                            //}
                            $("#HQty_Total").val(data1.data.length);
                            var data_Temp = [];                     //存放子表需要显示的数据
                            var data_temp_length = 10;              //通过缓存列表或新增进入页面时,子表显示的最大记录数
                            if (data1.data.length < data_temp_length) {
                                data_temp_length = data1.data.length;
                            }
                            for (var i = 0; i < data_temp_length; i++) {
                                data_Temp.push(data1.data[i]);
                            }
                            if (HModName_Temp == "Gy_getCusBarCodeBillList") {
                                data_Temp = data1.data;
                            }
                            //option.cols = [col];
                            option.data = data1.data;
                            option.data = data_Temp;
                            table.cache['wl-table'] = null;         //清空表格缓存数据
                            ins = table.render(option);
                            layer.close(ajaxLoad);
@@ -367,6 +402,73 @@
                //禁用 ç»Ÿä¸€å‰ç¼€ æ–‡æœ¬æ¡†
                $('#HBarCode_Pre').prop('disabled', true);                     //统一前缀 æ–‡æœ¬æ¡†ä¸å¯ç¼–辑
            });
            //#endregion
            //#endregion
            //#region ä¿®æ”¹å•据号
            //#region ä¿®æ”¹å•据号
            form.on('submit(cmdHBillNoChange)', function (data) {
                layer.prompt({ formType: 2, title: "请输入单据号!", value: HBillNo },
                    function (value, index) {
                        if (option.data!=null&& option.data.length > 0) {
                            layer.msg("当前单据已经存在扫码记录,不可以修改单据号!", { icon: 5, btn: ['确认'], time: 100000, offset: 't' });
                            return;
                        }
                        if (value == "") {
                            layer.msg("单据号不可以为空!", { icon: 5, btn: ['确认'], time: 100000, offset: 't' });
                            return;
                        }
                        if (judgeHBillNoIsInTempList(value)) {
                            HBillNo = value;
                            $("#HBillNo").val(HBillNo);
                        }
                        layer.close(index);
                    });
            });
            //#endregion
            //#region åˆ¤æ–­å•据号是否为缓存列表中的单据号,是则修改成功并设置统一前缀,否则修改失败。
            function judgeHBillNoIsInTempList(value) {
                //判断结果
                var judgeFlag = false;
                $.ajax({
                    type: "GET",
                    async: false,
                    url: GetWEBURL() + "/WEBSController/Gy_getCusBarCodeBill_judgeHBillNoIsInTempList",
                    data: { "HInterID": HInterID, "HBillType": HBillType, "HBillNo": value, "HMaker": HMaker, "HStockOrgID": HStockOrgID },
                    success: function (result) {
                        if (result.count == 1) {
                            if (result.data == null) {
                            } else {
                                var data = result.data;
                                $("#HBarCode_Pre").val(data[0]["HBarCode_Pre"]);
                                HBarCode_Pre_Flag = 1;
                                //禁用确认按钮
                                $('#cmdHBarCode_Pre').addClass("layui-btn-disabled").attr("disabled", true);//按钮变为不可编辑状态
                                //禁用 ç»Ÿä¸€å‰ç¼€ æ–‡æœ¬æ¡†
                                $('#HBarCode_Pre').prop('disabled', true);                     //统一前缀 æ–‡æœ¬æ¡†ä¸å¯ç¼–辑
                            }
                            judgeFlag = true;
                        }
                        else {
                            layer.msg(result.Message, { icon: 5, time: 100000, offset: 't', btn: ['确认'] }, function () { $("#HBarCode").focus(); });
                            judgeFlag = false;
                        }
                        layer.closeAll("loading");
                    },
                    complete: function (XHR, TS) { XHR = null }//回收资源
                });
                return judgeFlag;
            }
            //#endregion
            //#endregion
@@ -504,9 +606,10 @@
                    , height: 'full-50'
                    //, page: true
                    , cellMinWidth: 90
                    , limit: 1000
                    , limit: 100000
                    //, limits: [50, 500, 5000, 20000]
                    , toolbar: '#toolbarDemo'
                    , totalRow: true
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                        , { field: 'HItemID', title: 'HItemID', hide: true }
@@ -514,7 +617,7 @@
                        , { field: 'HBillNo', title: '单据号', width: 125, sort: true }
                        , { field: 'HBillType', title: '单据类型', width: 125, sort: true, hide: true }
                        , { field: 'HBarCode', title: '条码编号', width: 125, sort: true }
                        , { field: 'HQty', title: '数量', width: 125, sort: true, hide: true }
                        , { field: 'HQty', title: '数量', width: 125, sort: true, totalRow: true, hide: true }
                        , { field: 'HOrgID', title: 'HOrgID', sort: true, hide: true }
                        , { field: 'HDate', title: '日期', width: 125, sort: true }
                        , { field: 'HRelationInterID', title: 'HRelationInterID', width: 125, sort: true, hide: true }