1
yusijie
2024-05-06 62f346794d27086f41f7ce901bdd11eead5249c8
WebTM/views/²Ö´æ¹ÜÀí/²Ö¿âµ÷²¦/Add_Edit_Kf_MoveStockBill.html
@@ -72,7 +72,7 @@
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">日期</label>
                                            <label class="layui-form-label">日期<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="HDate" id="HDate" autocomplete="off" model="datetime" dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd">
                                            </div>
@@ -102,7 +102,7 @@
                                        </div>
                                       
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">主管</label>
                                            <label class="layui-form-label">主管<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HMangerName" id="HMangerName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HManagerID" id="HManagerID" class="layui-input" value=0 style="float:left;width:150px;">
@@ -113,7 +113,7 @@
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">调入仓库</label>
                                            <label class="layui-form-label">调入仓库<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HWHName" id="HWHName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HWHID" id="HWHID" class="layui-input" value=0 style="float:left;width:150px;">
@@ -123,7 +123,7 @@
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">调出仓库</label>
                                            <label class="layui-form-label">调出仓库<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HSCWHName" id="HSCWHName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HSCWHID" id="HSCWHID" class="layui-input" value=0 style="float:left;width:150px;">
@@ -136,7 +136,7 @@
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">验收员</label>
                                            <label class="layui-form-label">验收员<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HSecManagerName" id="HSecManagerName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HSecManagerID" id="HSecManagerID" class="layui-input" value=0 style="float:left;width:150px;">
@@ -146,7 +146,7 @@
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">保管员</label>
                                            <label class="layui-form-label">保管员<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HKeeperName" id="HKeeperName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HKeeperID" id="HKeeperID" class="layui-input" value=0 style="float:left;width:150px;">
@@ -156,7 +156,7 @@
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">业务员</label>
                                            <label class="layui-form-label">业务员<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HEmpName" id="HEmpName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HEmpID" id="HEmpID" class="layui-input" value=0 style="float:left;width:150px;">
@@ -172,7 +172,7 @@
                                            <label class="layui-form-label">源单类型</label>
                                            <div class="layui-input-inline">
                                                <select name="HSourceBillType" lay-filter="HSourceBillType" id="HSourceBillType">
                                                    <option value="调拨申请单" selected="selected">调拨申请单</option>
                                                    <option value="1243" selected="selected">调拨申请单</option>
                                                    <option value="手工录入">手工录入</option>
                                                </select>
@@ -793,18 +793,19 @@
                                , "HEmpID": data[0]["HEmpID"]
                                , "HEmpName": data[0]["业务员"]
                                , "HWHID": data[0]["HWHID"]
                                , "HWHName": data[0]["调入仓库"]
                                , "HSCWHID": data[0]["HWHID"]
                                , "HSCWHName": data[0]["调出仓库"]
                                , "HSecManagerID": data[0]["HSecManagerID"]
                                , "HSecManagerName": data[0]["验收员"]
                                , "HKeeperID": data[0]["HKeeperID"]
                                , "HKeeperName": data[0]["保管员"]
                                , "HDeptID": data[0]["HDeptID"]
                                , "HManagerID": data[0]["HManagerID"]
                                , "HMangerName": data[0]["主管"]
                                , "HWHID": data[0]["HWHID"]
                                , "HWHName": data[0]["调入仓库"]
                                , "HSCWHID": data[0]["HSCWHID"]
                                , "HSCWHName": data[0]["调出仓库"]
                                , "HExplanation": data[0]["HExplanation"]
                                , "HInvoiceBillNo": data[0]["发票编号"]
                                , "HProjectID": data[0]["HProjectID"]
@@ -860,23 +861,31 @@
            //#region ä¿å­˜æ–¹æ³•
            function set_SaveBill(data) {
                if ($("#HDeptName").val() == 0) {
                    layer.msg("请选择部门!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                if ($("#HWHID").val() == 0) {
                    layer.msg("请选择调入仓库!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HWHName").val() == 0) {
                    layer.msg("请选择仓库!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                if ($("#HSCWHID").val() == 0) {
                    layer.msg("请选择调出仓库!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HKeeperID").val() == 0) {
                    layer.msg("请选择保管员!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                if ($("#HManagerID").val() == 0) {
                    layer.msg("请选择负责人!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HSecManagerID").val() == 0) {
                    layer.msg("请选择验收员!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    layer.msg("请选择验收人!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HEmpID").val() == 0) {
                    layer.msg("请选择仓管员!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HKeeperID ").val() == 0) {
                    layer.msg("请选择保管员!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                var num = [];
@@ -1159,6 +1168,7 @@
                })
            }
            //#endregion
            //#endregion
            //行内快捷键筛选
@@ -1199,17 +1209,17 @@
                                    layer.close(index);//关闭弹窗
                                }
                                , end: function () {
                                    if (OptionData.length>0) {
                                        obj.update({
                                            "HMaterID": OptionData.HMaterID
                                            , "物料代码": OptionData.物料代码
                                            , "物料名称": OptionData.物料名称
                                            , "规格型号": OptionData.规格型号
                                            , "HUnitID": OptionData.HUnitID
                                            , "计量单位": OptionData.计量单位名称
                                        })
                                        OptionData = [];
                                    }
                                    //if (OptionData.length>0) {
                                    //    OptionData = [];
                                    //}
                                    obj.update({
                                        "HMaterID": OptionData.HItemID
                                        , "物料代码": OptionData.物料代码
                                        , "物料名称": OptionData.物料名称
                                        , "规格型号": OptionData.规格型号
                                        , "HUnitID": OptionData.HUnitID
                                        , "计量单位": OptionData.计量单位名称
                                    })
                                    
                                }
                            });
@@ -1242,14 +1252,13 @@
                                    layer.close(index);//关闭弹窗
                                }
                                , end: function () {
                                    if (OptionData.length > 0) {
                                        obj.update({
                                            "HPropertyID": OptionData.HItemID
                                            , "辅助属性": OptionData.辅助属性名称
                                        })
                                        OptionData = [];
                                    }
                                    //if (OptionData.length > 0) {
                                    //    OptionData = [];
                                    //}
                                    obj.update({
                                        "HPropertyID": OptionData.HItemID
                                        , "辅助属性": OptionData.辅助属性名称
                                    })
                            }
                            })
                        }
@@ -1286,8 +1295,8 @@
                                , end: function () {
                                    if (OptionData.length > 0) {
                                        obj.update({
                                            "HUnitID": OptionData.HItemID
                                            , "计量单位": OptionData.计量单位名称
                                            "HUnitID": OptionData[0].HItemID
                                            , "计量单位": OptionData[0].计量单位名称
                                        })
                                        OptionData = [];
                                    }
@@ -1324,13 +1333,13 @@
                                    layer.close(index);//关闭弹窗
                                }
                                , end: function () {
                                    if (OptionData.length > 0) {
                                        obj.update({
                                            "HWHID": OptionData.HItemID
                                            , "调入仓库": OptionData.仓库名称
                                        })
                                        OptionData = [];
                                    }
                                    //if (OptionData.length > 0) {
                                    //    OptionData = [];
                                    //}
                                    obj.update({
                                        "HWHID": OptionData.HItemID
                                        , "调入仓库": OptionData.仓库名称
                                    })
                                
                            }
                            })
@@ -1365,13 +1374,13 @@
                                        layer.close(index);//关闭弹窗
                                    }
                                    , end: function () {
                                        if (OptionData.length > 0) {
                                            obj.update({
                                                "HSCWHID": OptionData.HItemID
                                                , "调出仓库": OptionData.仓库名称
                                            })
                                            OptionData = [];
                                        }
                                        //if (OptionData.length > 0) {
                                        //    OptionData = [];
                                        //}
                                        obj.update({
                                            "HSCWHID": OptionData.HItemID
                                            , "调出仓库": OptionData.仓库名称
                                        })
                                       
                                    }
                                })
@@ -1399,19 +1408,19 @@
                                    //更新表格缓存的数据
                                    obj.update({
                                       
                                        "HSPID": checkStatus.data[0].HItemID,
                                        "HSPID": checkStatus.data[0].HMainID,
                                         "仓位名称": checkStatus.data[0].仓位名称
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                                , end: function () {
                                    if (OptionData.length > 0) {
                                        obj.update({
                                            "HSPID": OptionData.HItemID
                                            , "仓位名称": OptionData.仓位名称
                                        })
                                        OptionData = [];
                                    }
                                    //if (OptionData.length > 0) {
                                    //    OptionData = [];
                                    //}
                                    obj.update({
                                        "HSPID": OptionData.HMainID
                                        , "仓位名称": OptionData.仓位名称
                                    })
                               
                            }
                            })
@@ -1495,13 +1504,7 @@
            function getSupType() {
                var type = $("#HSourceBillType").val();
                switch (type) {
                    case '1102':
                        return { url: "../../采购管理/采购订单/Cg_POOrderBillList.html", name: "采购订单" };
                        break;
                    case '1103':
                        return { url: "../../采购管理/收料通知单/Cg_POInStockBillList.html", name: "收料通知单" };
                        break;
                    case '调拨申请单':
                    case '1243':
                        return { url: "../../仓存管理/仓库调拨/Kf_MoveStockRequestBillList.html", name: "调拨申请单" };
                        break;
                }
@@ -1510,7 +1513,7 @@
            //表头信息选择单据弹窗
            form.on('submit(XDHList)', function () {
                if ($("#HSourceBillType").val() == "调拨申请单") {
                if ($("#HSourceBillType").val() == "1243") {
                    var url = getSupType().url;
                    url = encodeURI(url);
@@ -1568,49 +1571,31 @@
                        for (var i = 0; i < checkStatus.data.length; i++) {
                            ProcessNumber.push(checkStatus.data[i]);
                        }
                        $("#HEmpID").val(checkStatus.data[0]["HEmpID"]);
                        $("#HEmpName").val(checkStatus.data[0]["业务员"]);
                        $("#HSecManagerID").val(checkStatus.data[0]["HSecManagerID"]);
                        $("#HSecManagerName").val(checkStatus.data[0]["验收员"]);
                        $("#HKeeperID").val(checkStatus.data[0]["HKeeperID"]);
                        $("#HKeeperName").val(checkStatus.data[0]["保管员"]);
                        $("#HManagerID").val(checkStatus.data[0]["HMangerID"]);
                        $("#HMangerName").val(checkStatus.data[0]["主管"]);
                        $("#HWHID").val(checkStatus.data[0]["HWHID"]);
                        $("#HWHName").val(checkStatus.data[0]["调入仓库"]);
                        $("#HSCWHID").val(checkStatus.data[0]["HSCWHID"]);
                        $("#HSCWHName").val(checkStatus.data[0]["调出仓库"]);
                        //获取当前位置所在行数
                        var NowNum = 0;
                        NowNum = option.data.length;
                        if (getSupType().name == "采购订单") {
                            var j = 0;
                            for (var i = 0; i < checkStatus.data.length; i++) {
                                option.data.push({
                                    "HMaterID": checkStatus.data[j].HMaterID, "物料代码": checkStatus.data[j].物料代码, "物料名称": checkStatus.data[j].物料名称, "规格型号": checkStatus.data[j].规格型号,
                                    "HUnitID": checkStatus.data[j].HUnitID, "计量单位": checkStatus.data[j].计量单位,
                                    "HQty": checkStatus.data[j].数量, "HPrice": checkStatus.data[j].单价,
                                    "HMoney": checkStatus.data[j].金额,
                                    "HSourceBillNo": checkStatus.data[j].单据号, "HSourceBillType": checkStatus.data[j].HBillType, "HSourceInterID": checkStatus.data[j].hmainid, "HSourceEntryID": checkStatus.data[j].hsubid,
                                })
                                j++;
                            }
                            table.render(option);
                            layer.close(index);
                        }
                        else if (getSupType().name == "收料通知单") {
                            var j = 0;
                            for (var i = 0; i < ProcessNumber.length; i++) {
                                option.data.push({
                                    "HMaterID": checkStatus.data[j].HMaterID, "物料代码": checkStatus.data[j].物料代码, "物料名称": checkStatus.data[j].物料名称, "规格型号": checkStatus.data[j].规格型号,
                                    "   ": 0, "物料辅助属性": "", "HUnitID": checkStatus.data[j].HUnitID, "计量单位": checkStatus.data[j].计量单位, "HQtyMust": "", "HQty": checkStatus.data[j].数量, "HRemark": "",
                                    "HPrice": checkStatus.data[j].单价, "HMoney": checkStatus.data[j].金额,   "HWHID": checkStatus.data[j].HWHID, "收料仓库": checkStatus.data[j].收料仓库,
                                    "HSPID": checkStatus.data[j].HSPID, "仓位名称": checkStatus.data[j].仓位名称, "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0,
                                    "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "",
                                    "HSourceBillNo": checkStatus.data[j].单据号, "HSourceBillType": checkStatus.data[j].HBillType, "HSourceInterID": checkStatus.data[j].hmainid, "HSourceEntryID": checkStatus.data[j].hsubid,
                                })
                                j++;
                            }
                            table.render(option);
                            layer.close(index);//关闭弹窗
                        }
                        else if (getSupType().name == "调拨申请单") {
                        if ($("#HSourceBillType").val() == "1243") {
                            var j = 0;
                            for (var i = 0; i < ProcessNumber.length; i++) {
                                option.data.push({
                                    "HMaterID": checkStatus.data[j].HMaterID, "物料代码": checkStatus.data[j].物料代码, "物料名称": checkStatus.data[j].物料名称, "规格型号": checkStatus.data[j].规格型号,
                                    "HPropertyID": checkStatus.data[j].HPropertyID, "辅助属性": checkStatus.data[j].辅助属性, "HUnitID": checkStatus.data[j].HUnitID, "计量单位": checkStatus.data[j].计量单位, "HQtyMust": checkStatus.data[j].应收数量, "HQty": checkStatus.data[j].实收数量, "HRemark": checkStatus.data[j].表体备注,
                                    "HPrice": checkStatus.data[j].单价, "HMoney": checkStatus.data[j].金额, "HWHID": checkStatus.data[j].HWHID, "调入仓库": checkStatus.data[j].调入仓库, "HSCWHID": checkStatus.data[j].HSCWHID, "调出仓库": checkStatus.data[j].调出仓库,
                                    "HSPID":"0", "仓位名称":"",
                                    "HPOOrderInterID": checkStatus.data[j].HPOOrderInterID, "HPOOrderEntryID": checkStatus.data[j].HPOOrderEntryID, "HPOOrderBillNo": checkStatus.data[j].采购订单号,
                                    "HSeOrderInterID": checkStatus.data[j].HSeOrderInterID, "HSeOrderEntryID": checkStatus.data[j].HSeOrderEntryID, "HSeOrderBillNo": checkStatus.data[j].销售订单号,
                                    "HSourceBillNo": checkStatus.data[j].单据号, "HSourceBillType": checkStatus.data[j].HBillSubType, "HSourceInterID": checkStatus.data[j].hmainid, "HSourceEntryID": checkStatus.data[j].hsubid,
@@ -1625,6 +1610,7 @@
                       
                });
            });
            //判断所选着与表格是否有重复数据
            function checkDuplicateData(data) {
                const duplicates = [];
@@ -1792,7 +1778,7 @@
             OptionData = data
         }
           //双击返回计量单位
         function GetGyUnit(data) {
        function GetAuxiliaryUnitValue(data) {
             OptionData = data
         }
@@ -1807,7 +1793,7 @@
         } 
         //双击返回仓位
         function GetGyStockPlace(data) {
        function GetGyStockPlace(data) {
             OptionData = data
         }
        //双击返回调入仓库