yusijie
2024-04-25 3de6a9eb5d6c00a756831fbab13da264c198ece7
WebTM/views/²Ö´æ¹ÜÀí/·Ö²½Ê½µ÷Èëµ¥/Fb_StepFoldinBillEdit.html
@@ -310,6 +310,8 @@
            var year = date.getFullYear();
            var shijian = year + "-" + month + "-" + day;
            var allVal;
            //双击返回全局变量
            window.OptionData = {};
            //#endregion
@@ -750,9 +752,25 @@
                                        "HMaterID": checkStatus.data[0].HItemID,
                                         "物料代码": checkStatus.data[0].物料代码,
                                        "物料名称": checkStatus.data[0].物料名称,
                                        "规格型号": checkStatus.data[0].规格型号
                                        "规格型号": checkStatus.data[0].规格型号,
                                        "HUnitID": checkStatus.data[0].HUnitID,
                                        "计量单位": checkStatus.data[0].计量单位名称
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                                , end: function () {
                                    if (OptionData.length>0) {
                                        obj.update({
                                            "HMaterID": OptionData.HMaterID
                                            , "物料代码": OptionData.物料代码
                                            , "物料名称": OptionData.物料名称
                                            , "规格型号": OptionData.规格型号
                                            , "HUnitID": OptionData.HUnitID
                                            , "计量单位": OptionData.计量单位名称
                                        })
                                        OptionData = [];
                                    }
                                }
                            })
                        }
@@ -783,6 +801,16 @@
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                                , end: function () {
                                    if (OptionData.length > 0) {
                                        obj.update({
                                            "HUnitID": OptionData.HItemID
                                            , "计量单位": OptionData.计量单位名称
                                        })
                                        OptionData = [];
                                    }
                            }
                            })
                        }
                        //辅助计量单位
@@ -812,6 +840,16 @@
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                                , end: function () {
                                    if (OptionData.length > 0) {
                                        obj.update({
                                            "HSecUnitID": OptionData.HItemID
                                            , "辅助计量单位": OptionData.辅助属性名称
                                        })
                                        OptionData = [];
                                    }
                            }
                            })
                        }
                        //调入仓库
@@ -824,7 +862,7 @@
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ['../../基础资料/公用基础资料/Gy_Warehouse.html', 'yes']
                                , content: ['../../基础资料/公用基础资料/Gy_Warehouse.html?type=Warehouse', 'yes']
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
@@ -841,6 +879,16 @@
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                                , end: function () {
                                    if (OptionData.length > 0) {
                                        obj.update({
                                            "HWHID": OptionData.HItemID
                                            , "调入仓库": OptionData.仓库名称
                                        })
                                        OptionData = [];
                                    }
                            }
                            })
                        }
                        //调出仓库
@@ -853,7 +901,7 @@
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ['../../基础资料/公用基础资料/Gy_Warehouse.html', 'yes']
                                , content: ['../../基础资料/公用基础资料/Gy_Warehouse.html?type=HWHSub', 'yes']
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
@@ -870,6 +918,16 @@
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                                , end: function () {
                                    if (OptionData.length > 0) {
                                        obj.update({
                                            "HSCWHID": OptionData.HItemID
                                            , "调出仓库": OptionData.仓库名称
                                        })
                                        OptionData = [];
                                    }
                            }
                            })
                        }
                        obj.event = "";
@@ -918,7 +976,29 @@
                        if (checkStatus.data.length == 0) {
                            return layer.msg("请至少选择一条数据!");
                        }
                        layer.alert("你已选择" + checkStatus.data.length + "条数据");
                        //layer.alert("你已选择" + checkStatus.data.length + "条数据");
                        //未审核 å·²å…³é—­çš„单子不允许下推
                        for (var i = 0; i < checkStatus.data.length; i++) {
                            var temp = getPushSource_ICStockInBillInit(checkStatus.data[i].hmainid, checkStatus.data[i].hsubid);
                            if (temp != "none") {
                                if (temp.状态 != "已审核") {
                                    layer.msg("下推失败!单据号【" + temp.单据号 + "】单据状态不为已审核状态!");
                                    layer.close(index);//关闭弹窗
                                    return;
                                }
                                if (temp.行状态 != "") {
                                    layer.msg("下推失败!单据号【" + temp.单据号 + "】下选中的记录中存在已关闭状态的记录!");
                                    layer.close(index);//关闭弹窗
                                    return;
                                }
                            } else {
                                return;
                            }
                        }
                        //获取分步式调入单通知单代码
                        var ProcessNumber = [];
                        for (var i = 0; i < checkStatus.data.length; i++) {
@@ -952,7 +1032,7 @@
                                , "HSecManagerName": data.验收
                                , "HKeeperID": data.HKeeperID
                                , "HKeeperName": data.保管员
                                , "HSourceBillType": data.源单类型
                                //, "HSourceBillType": data.单据类型
                            });
@@ -963,7 +1043,7 @@
                                    "HUnitID": checkStatus.data[j].HUnitID, "计量单位": checkStatus.data[j].计量单位, "HQtyMust": checkStatus.data[j].应收数量,
                                    "HQty": checkStatus.data[j].实收数量, "HPrice": checkStatus.data[j].单价, "HBatchNo": checkStatus.data[j].批次, "HRemark": checkStatus.data[j].表体备注,
                                    "HMoney": checkStatus.data[j].金额, "HOrderPrice": checkStatus.data[j].采购金额, "HWHID": checkStatus.data[j].HWHID, "调入仓库": checkStatus.data[j].调入仓库, "HSCWHID": checkStatus.data[j].HSCWHID, "调出仓库": checkStatus.data[j].调出仓库,
                                    "HSourceBillNo": checkStatus.data[j].单据号, "HSourceBillType": checkStatus.data[j].HBillType, "HSourceInterID": checkStatus.data[j].hmainid, "HSourceEntryID": checkStatus.data[j].hsubid,
                                    "HSourceBillNo": checkStatus.data[j].单据号, "HSourceBillType": checkStatus.data[j].单据类型, "HSourceInterID": checkStatus.data[j].hmainid, "HSourceEntryID": checkStatus.data[j].hsubid,
                                })
                                j++;
                            }
@@ -1025,7 +1105,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '仓管员列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=HEmp', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1048,7 +1128,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '供应商列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/采购基础资料/Gy_Supplier.html', 'yes']
                    , content: ['../../基础资料/采购基础资料/Gy_Supplier.html?Type=HSup', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1071,7 +1151,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '验收人列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=HSecManager', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1117,7 +1197,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '负责人列表'//标题
                    , shift: 2//弹出动画
                    ,content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html', 'yes']
                    ,content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=HManager', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1140,7 +1220,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '保管员列表'//标题
                    , shift: 2//弹出动画
                    ,content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html', 'yes']
                    ,content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1162,7 +1242,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '调入仓库列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_Warehouse.html', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_Warehouse.html?Type=HWH', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1185,7 +1265,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '调出仓库列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_Warehouse.html', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_Warehouse.html?Type=HSCWH', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1216,7 +1296,7 @@
                $.ajax({
                    type: "get",
                    async: false,
                    data: { "HName": HName },
                    data: { "HName": HName, "Num": 2 },       //0蓝单 1红单 2不分红蓝单
                    url: GetWEBURL() + "/Web/GetHSourceBillType",
                    success: function (result) {
                        var HSourceBillTypes = "";
@@ -1233,11 +1313,104 @@
            }
            //#endregion
            //#region æ ¹æ®ä¸»å†…码与子内码获取源单采购入库单数据
            function getPushSource_ICStockInBillInit(HSourceInterID, HSourceEntryID) {
                var res = "none";
                $.ajax({
                    url: GetWEBURL() + "/Kf_StepFoldInBill/loadKf_ICStockBillMain_Push",
                    async: false,
                    type: "GET",
                    data: {
                        "HInterID": HSourceInterID
                        , "HSubID": HSourceEntryID
                    },
                    success: function (result) {
                        if (result.code == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            res = result.data[0];
                        } else {
                            res = result.data;
                            //layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                        }
                    }, error: function () {
                        res = "none";
                        layer.alert("发生错误!", { icon: 5 });
                    }
                });
                return res;
            }
            //#endregion
            //#endregion
            //以上是layui模块
        });
         // åŸºç¡€èµ„料返回数据
        function GetHSupNameValue(obj)  //返回供应商
       {
            $("#HSupName").val(obj[0].供应商名称);
            $("#HSupID").val(obj[0].HItemID);
        }
        function GetHSecManagerValue(obj)  //返回验收员
        {
            $("#HSecManagerName").val(obj[0].职员名称);
            $("#HSecManagerID").val(obj[0].HItemID);
        }
       function GetHKeeperValue(obj)  //返回保管员
       {
            $("#HKeeperName").val(obj[0].职员名称);
            $("#HKeeperID").val(obj[0].HItemID);
        }
        function GetHWHValue(obj)  //返回调入仓库
        {
            $("#HWHName").val(obj[0].仓库名称);
            $("#HWHID").val(obj[0].HItemID);
        }
         function GetHSCWHValue(obj)  //返回调出仓库
        {
            $("#HSCWHName").val(obj[0].仓库名称);
            $("#HSCWHID").val(obj[0].HItemID);
        }
        function GetHDeptNameValue(obj)  //返回部门
        {
            $("#HDeptName").val(obj[0].部门名称);
            $("#HDeptID").val(obj[0].HItemID);
        }
        function GetHEmpValue(obj)  //返回仓管员
        {
            $("#HEmpName").val(obj[0].职员名称);
            $("#HEmpID").val(obj[0].HItemID);
        }
         function GetHManagerValue(obj)  //返回负责人
        {
            $("#HManagerName").val(obj[0].职员名称);
            $("#HManagerID").val(obj[0].HItemID);
        }
          //双击返回物料
         function GetGyMaterial(data) {
             OptionData = data
         }
           //双击返回计量单位
         function GetGyUnit(data) {
             OptionData = data
         }
        //双击返回调入仓库
        function GetGyWarehouse(data) {
            OptionData = data[0]
        }
        //双击返回调出仓库
        function GetHWHSubValue(data) {
            OptionData = data[0]
        }
    </script>
</body>
</html>