王 垚
2022-05-17 e736994bec494f59214c40bf9d1eaab85a63ed83
WebTM/views/Éú²ú¹ÜÀí/Éú²ú×°Ïäµ¥/QK_PackingBill.html
@@ -37,8 +37,8 @@
                                        <input type="text" name="HBillNo1" id="HBillNo1" style="display:none">
                                    </div>
                                </div>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnPack" id="btnPack" style="padding: 0 30px; margin-left: 150px">整装生成</button>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnAssembly" id="btnAssembly" style="padding:0 30px">拼装生成</button>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnPack" id="btnPack" style="padding: 0 30px; margin-left: 150px">条码生成</button>
                                <!--<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnAssembly" id="btnAssembly" style="padding:0 30px">拼装生成</button>-->
                            </div>
                        </div>
                    </form>
@@ -110,7 +110,14 @@
            //整箱生成
            form.on('submit(btnPack)', function (data) {
                var flag = "ZZ";
                var sSubStr = JSON.stringify(table.cache['mainTable']);
                var sSubStr = table.checkStatus('mainTable');
                if (sSubStr.data.length > 0) {
                    SavePack(flag, sSubStr);
                }
                else {
                    layer.msg('请最少选择1行数据!');
                    return;
                }
                SavePack(flag, sSubStr);
            });
            //拼箱生成
@@ -156,7 +163,9 @@
            function set_InitGrid() {
                columns = [
                    { type: 'checkbox', fixed: 'left' }
                    , { field: 'HSeOrderBillNo', title: '销售订单号', edit: 'text', width: 100, hide: true }
                    , { field: 'HInterID', title: 'HInterID', edit: 'text', width: 100, hide: true }
                    , { field: 'HEntryID', title: 'HEntryID', edit: 'text', width: 100, hide: true }
                    , { field: 'HBillNo', title: 'HBillNo', edit: 'text', width: 100, hide: true }
                    , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true }
                    , { field: 'HMaterNumber', title: 'HMaterNumber', edit: 'text', width: 100, hide: true }
@@ -168,6 +177,15 @@
                    , { field: 'HMinQty', title: '最小包装数', edit: 'text', event: 'HMinQty', width: 100 }
                    , { field: 'HTotalQty', title: '生成条数', edit: 'false', width: 100 }
                    , { field: 'HSpsQty', title: '剩余数量', edit: 'false', width: 100 }
                    , { field: 'FBillNo', title: '销售订单号', edit: 'false', width: 100 }
                    , { field: 'FLXName', title: '联系人', edit: 'text',  width: 100 }
                    , { field: 'FInAddress', title: '收货方地址', edit: 'false', width: 100 }
                    , { field: 'FMaterName', title: '销售物料名称', edit: 'false', width: 100 }
                    , { field: 'FBZFS', title: '包装方式', edit: 'false', width: 100 }
                    , { field: 'FHX', title: '花型', edit: 'false', width: 100 }
                    , { field: 'FQK', title: '墙咔缝', edit: 'false', width: 100 }
                    , { field: 'FWBBZ', title: '外包备注', edit: 'false', width: 100 }
                    , { field: 'HCusID', title: 'HCusID', edit: 'text', width: 100, hide: true }
                    , { field: 'HCusName', title: '客户', edit: 'false', width: 100 }
@@ -205,13 +223,22 @@
                        type: "POST",
                        url: GetWEBURL() + "/Sc_ICMOBill/QK_PackingBillSavePack", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sSubStr + ";" + sessionStorage["HUserName"] + ";" + flag + ";" + sessionStorage["OrganizationID"]},
                        data: { "msg": JSON.stringify(sSubStr.data) + ";" + sessionStorage["HUserName"] + ";" + flag + ";" + sessionStorage["OrganizationID"]},
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    set_InitGrid();//重新加载表格
                                });
                                var PrintIds = data.code;
                                PrintIds = PrintIds.substring(0, PrintIds.length - 1);
                                var Type = "HQKPackBill";
                                var OpenTmp = "";
                                if (sSubStr.data[0].FBZFS == "" && (sSubStr.data[0].FHX != "" || sSubStr.data[0].FMaterName != "")) {
                                    OpenTmp = "花型条码";
                                }
                                else {
                                    OpenTmp = "包装方式条码";
                                }
                                window.open("../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + PrintIds.toString() + "&Type=" + Type.toString() + "&OpenTmp=" + OpenTmp.toString());
                            }
                            else {
                                f_alert(data.Message);
@@ -222,7 +249,6 @@
                        error: function (err) {
                            f_alert("错误:" + err);
                            console.log("Reason" + sMainStr);
                        }
                    });
            }
@@ -231,9 +257,8 @@
            function AllowLoadData(sSubStr) {
                var Result = true;
                if (typeof (sSubStr) != "undefined" && typeof (sSubStr) != "") {
                    sSubStr = JSON.parse(sSubStr);
                    for (var i = 0; i < sSubStr.length; i++) {
                        if (sSubStr[i].HMinQty == "") {
                    for (var i = 0; i < sSubStr.data.length; i++) {
                        if (sSubStr.data[i].HMinQty == "") {
                            layer.msg("明细记录第" + (i + 1) + "行,最小包装数不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            return Result = false;
                        }