1
zrg
2024-08-12 5e6845bbc68fa625908247cf81148f3faf22a726
WebTM/views/ÑéÊÕÈë¿â/Í⹺Èë¿â/Kf_POStockInBackBill_Add_Up.html
@@ -1365,47 +1365,48 @@
                                    //if (checkStatus.data.length != 1) {
                                    //    return layer.msg("请选择一条数据");
                                    //}
                                    OptionData = checkStatus.data[0];  //把选中数据的第一条赋值给OptionData变量
                                    if (checkStatus.data.length > 1) {
                                        var rowIndex = $(obj.tr).attr("data-index") * 1;
                                        for (var i = 0; i < checkStatus.data.length; i++) {
                                            if (rowIndex + i >= option.data.length) {
                                                var NewRow = {
                                                    "HMaterID": 0, "物料代码": "", "物料名称": "", "规格型号": "", "HUnitID": 0, "计量单位": "", "HQty": "", "HRemark": "",
                                                    "HPrice": "0", "HMoney": "0", "HOrderPrice": "0", "HWHID": 0, "收料仓库": "",
                                                    "HSPID": 0, "仓位名称": "", "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0,
                                                    "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "",
                                                    "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0,
                                                };
                                                table.cache["mainTable"].push(NewRow);
                                                option.data = table.cache["mainTable"];
                                                table.render(option);
                                            }
                                    var rowIndex = $(obj.tr).attr("data-index") * 1;
                                    for (var i = 0; i < checkStatus.data.length; i++) {
                                        if (rowIndex + i >= option.data.length) {
                                            var NewRow = {
                                                "HMaterID": 0, "物料代码": "", "物料名称": "", "规格型号": "", "HUnitID": 0, "计量单位": "", "HQty": "", "HRemark": "",
                                                "HPrice": "0", "HMoney": "0", "HOrderPrice": "0", "HWHID": 0, "收料仓库": "",
                                                "HSPID": 0, "仓位名称": "", "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0,
                                                "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "",
                                                "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0,
                                            };
                                            table.cache["mainTable"].push(NewRow);
                                            option.data = table.cache["mainTable"];
                                            table.render(option);
                                            var HMaterID = checkStatus.data[i].HItemID;
                                            var resultData = getMaterialByMaterID(HMaterID);
                                            option.data[rowIndex + i].HMaterID = resultData.HMaterID;
                                            option.data[rowIndex + i].物料代码 = resultData.HMaterNumber;
                                            option.data[rowIndex + i].物料名称 = resultData.HMaterName;
                                            option.data[rowIndex + i].规格型号 = resultData.HMaterModel;
                                            option.data[rowIndex + i].HUnitID = resultData.HUnitID;
                                            option.data[rowIndex + i].计量单位 = resultData.HUnitName;
                                            ////更新表格缓存的数据
                                            //obj.update({
                                            //    "HMaterID": checkStatus.data[0].HItemID
                                            //    , "物料代码": checkStatus.data[0].HNumber
                                            //    , "物料名称": checkStatus.data[0].HName
                                            //    , "规格型号": checkStatus.data[0].HModel
                                            //    , "HUnitID": checkStatus.data[0].HUnitID
                                            //    , "计量单位": checkStatus.data[0].HUnitName
                                            //})
                                            //layer.close(index);//关闭弹窗
                                        }
                                        var HMaterID = checkStatus.data[i].HItemID;
                                        var resultData = getMaterialByMaterID(HMaterID);
                                        option.data[rowIndex + i].HMaterID = resultData.HMaterID;
                                        option.data[rowIndex + i].物料代码 = resultData.HMaterNumber;
                                        option.data[rowIndex + i].物料名称 = resultData.HMaterName;
                                        option.data[rowIndex + i].规格型号 = resultData.HMaterModel;
                                        option.data[rowIndex + i].HUnitID = resultData.HUnitID;
                                        option.data[rowIndex + i].计量单位 = resultData.HUnitName;
                                        ////更新表格缓存的数据
                                        //obj.update({
                                        //    "HMaterID": checkStatus.data[0].HItemID
                                        //    , "物料代码": checkStatus.data[0].HNumber
                                        //    , "物料名称": checkStatus.data[0].HName
                                        //    , "规格型号": checkStatus.data[0].HModel
                                        //    , "HUnitID": checkStatus.data[0].HUnitID
                                        //    , "计量单位": checkStatus.data[0].HUnitName
                                        //})
                                        //layer.close(index);//关闭弹窗
                                        table.render(option);
                                    }
                                    table.render(option);
                                    layer.closeAll();
                                    //layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
@@ -1534,6 +1535,89 @@
                        return false;
                    }
                })
                //双击
                $('.layui-table-box tbody td[data-field="物料代码"]').off('dblclick').on('dblclick', function () {
                    var HOrgID = $("#HOrgID").val();
                    layer.open({
                        type: 2
                        , skin: "layui-layer-rim" //加上边框
                        , title: "物料列表"  //标题
                        , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                        , shift: 2 //弹出动画
                        , area: ["90%", "90%"] //窗体大小
                        , maxmin: true //设置最大最小按钮是否显示
                        , content: ['../../基础资料/公用基础资料/Gy_Material.html?openType=2&HOrgID=' + HOrgID, 'yes']
                        , btn: ["确定", "取消"]
                        , btn1: function (index, laero) {
                            //按钮一  çš„回调
                            var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                            var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                            //if (checkStatus.data.length != 1) {
                            //    return layer.msg("请选择一条数据");
                            //}
                            OptionData = checkStatus.data[0];  //把选中数据的第一条赋值给OptionData变量
                            if (checkStatus.data.length > 1) {
                                var rowIndex = $(obj.tr).attr("data-index") * 1;
                                for (var i = 0; i < checkStatus.data.length; i++) {
                                    if (rowIndex + i >= option.data.length) {
                                        var NewRow = {
                                            "HMaterID": 0, "物料代码": "", "物料名称": "", "规格型号": "", "HUnitID": 0, "计量单位": "", "HQty": "", "HRemark": "",
                                            "HPrice": "0", "HMoney": "0", "HOrderPrice": "0", "HWHID": 0, "收料仓库": "",
                                            "HSPID": 0, "仓位名称": "", "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0,
                                            "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "",
                                            "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0,
                                        };
                                        table.cache["mainTable"].push(NewRow);
                                        option.data = table.cache["mainTable"];
                                        table.render(option);
                                    }
                                    var HMaterID = checkStatus.data[i].HItemID;
                                    var resultData = getMaterialByMaterID(HMaterID);
                                    option.data[rowIndex + i].HMaterID = resultData.HMaterID;
                                    option.data[rowIndex + i].物料代码 = resultData.HMaterNumber;
                                    option.data[rowIndex + i].物料名称 = resultData.HMaterName;
                                    option.data[rowIndex + i].规格型号 = resultData.HMaterModel;
                                    option.data[rowIndex + i].HUnitID = resultData.HUnitID;
                                    option.data[rowIndex + i].计量单位 = resultData.HUnitName;
                                    ////更新表格缓存的数据
                                    //obj.update({
                                    //    "HMaterID": checkStatus.data[0].HItemID
                                    //    , "物料代码": checkStatus.data[0].HNumber
                                    //    , "物料名称": checkStatus.data[0].HName
                                    //    , "规格型号": checkStatus.data[0].HModel
                                    //    , "HUnitID": checkStatus.data[0].HUnitID
                                    //    , "计量单位": checkStatus.data[0].HUnitName
                                    //})
                                    //layer.close(index);//关闭弹窗
                                }
                                table.render(option);
                            }
                            layer.closeAll();
                            //layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                        }
                        , btn2: function (index, layero) {
                            //按钮【按钮二】的回调
                            //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                        },
                        end: function () {
                            obj.update({
                                "HMaterID": OptionData.HMaterID
                                , "物料代码": OptionData.物料代码
                                , "物料名称": OptionData.物料名称
                                , "规格型号": OptionData.规格型号
                                , "HUnitID": OptionData.HUnitID
                                , "计量单位": OptionData.计量单位名称
                            })
                        }
                    });
                });
            }
            //行内事件