yxj
2023-06-16 0d229d60ec11d23a086852db522558bd5532e67a
WebTM/views/ÁìÁÏ·¢»õ/ÁìÁϳö¿â/Kf_MateOutBackBill_Fast.html
@@ -17,7 +17,7 @@
<body>
    <div class="layui-fluid" style="padding:0">
        <div class="layui-card">
            <div class="layui-card-body" style="padding: 5px; height:800px;">
            <div class="layui-card-body" style="padding: 0px; height:800px;">
                <form class="layui-form" action="" lay-filter="component-form-group">
                    <div style="background-color:#0085E8;">
                        <span style="color: white;"><i class="layui-icon layui-icon-form"></i>生产退料单</span>
@@ -63,6 +63,7 @@
                                        <div class="layui-col-xs8">
                                            <select name=" HBillType" id="HBillType">
                                                <option value="3720">生产任务单-投料</option>
                                                <option value="1204">生产领料单</option>
                                                <option value="-1">手工录入</option>
                                            </select>
                                        </div>
@@ -85,7 +86,7 @@
                                <div class="layui-form-item" style="padding:0px;margin:0px">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <label class="layui-form-label" style="width:40px;padding-left:0px;">配套数量</label>
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">配套数量</label>
                                        </div>
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HPPQty" id="HPPQty" lay-verify="HPPQty" autocomplete="off" class="layui-input">
@@ -95,13 +96,13 @@
                                <div class="layui-form-item" style="padding:0px;margin:0px">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">先进先出仓库</label>
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">FIFOWH</label><!--先进先出仓库-->
                                        </div>
                                        <div class="layui-col-xs6">
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HFIFOWHNAME" id="HFIFOWHNAME" lay-verify="HFIFOWHNAME" autocomplete="off" class="layui-input">
                                            <input type="hidden" name="HFIFOWHID" id="HFIFOWHID" lay-verify="HFIFOWHID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
                                        <div class="layui-col-xs2">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HFIFOWHID-BT">...</button>
                                        </div>
                                    </div>
@@ -502,7 +503,7 @@
                $("#HInterID").val("");
                $("#HBillNo").val("");
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    url: GetWEBURL() + "/Web/GetMAXNumPDA",
                    type: "GET",
                    data: { "HBillType": '1244' },
                    success: function (d) {
@@ -565,6 +566,8 @@
                    }
                })
            });
            //选择供应商
            form.on('submit(HSupID-BT)', function () {
                layer.open({
@@ -645,10 +648,19 @@
            });
            //退出
            //form.on('submit(Cancel)', function () {
            //    sessionStorage["SourceFlag"] = false;
            //    //parent.location.href = "../../../views/index.html"
            //    //window.close();//关闭当前页
            //    layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
            //        window.close();
            //    });
            //})
            form.on('submit(Cancel)', function () {
                sessionStorage["SourceFlag"] = false;
                parent.location.href = "../../../views/index.html"
                //window.close();//关闭当前页
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    parent.location.href = "../../../views/index_Mobile.html";
                });
            })
            //编辑
            form.on('submit(cmdModify)', function () {//编辑
@@ -771,7 +783,8 @@
                            dataType: "json",
                            success: function (data) {
                                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                                    layer.confirm("生成退料出库单" + data.Message + $("#HBillNo").val(), {
                                    layer.confirm(data.Message, {
                                    //layer.confirm("生成退料出库单" + data.Message + $("#HBillNo").val(), {
                                        icon: 1, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['新增'],
                                        btn2: function () {
                                            //parent.layui.admin.events.closeThisTabs();关闭页签
@@ -947,10 +960,11 @@
                    }
                }
                $.ajax({
                    url: GetWEBURL() + "/MateOutBill/get_CheckTypeByBarCode_Json",
                    //url: GetWEBURL() + "/MateOutBill/get_CheckTypeByBarCode_Json",
                    url: GetWEBURL() + "/WEBSController/Get_BarCode_Json",
                    type: "GET",
                    //data: { "sCode": '1001456360', "sInterID": 122554, "HBillType": '1204', "sBillNo": 'MATO00000055', "sMaker": sessionStorage["HUserName"], "WhID": 484080, "SPID": 0, "sQty": 0, "sRedBlue": false, "SourceFlag": sessionStorage["SourceFlag"], "sSourceBillNo": 'PPBOM202112226', "sSourceType": '3720', "HOWNERID": sessionStorage["OrganizationID"] },
                    data: { "sCode": sBarCode, "sInterID": sInterID, "HBillType": sBillType, "sBillNo": sBillNo, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": HSourceFlag, "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": sessionStorage["OrganizationID"] },
                    data: { "sBarCode": sBarCode, "HInterID": sInterID, "HBillType": sBillType, "HBillNo": sBillNo, "HMaker": sessionStorage["HUserName"], "HWhID": sHWHID, "HSPID": sHSPID, "HQty": sQty, "HRedBlueFlag": true, "SourceFlag": sessionStorage["SourceFlag"], "HSourceBillNo": sSourceBillNo, "HSourceBillType": sHBillType, "HStockOrgID": sessionStorage["OrganizationID"], "HScanStyle": "", "HCustom1": "", "HCustom2": "" },
                    success: function (result) {
                        if (result.count == 1) {
@@ -1038,22 +1052,22 @@
                            layer.load(3)
                            $.ajax({
                                url: GetWEBURL() + '/MateOutBill/DisBillEntryList_Webs_New_Json1',
                                url: GetWEBURL() + '/MateOutBackBill/DisBillEntryList',
                                type: "GET",
                                data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: '1244', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
                                data: { HBillID: sInterID, HBillType: '1244', sWhere: '' },
                                success: function (result) {
                                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                        listOption.data = result.data.list;
                                        table.render(listOption);
                                        $("#HBarCode_B").val(result.data.list2[0].HBarCode);
                                        $("#HMaterName_B").val(result.data.list2[0].HMaterName);
                                        $("#HMaterModel_B").val(result.data.list2[0].HMaterModel);
                                        $("#HBatchNo_B").val(result.data.list2[0].HBatchNo);
                                        $("#HUnitName_B").val(result.data.list2[0].HUnitName);
                                        $("#HQty_B").val(result.data.list2[0].HQty);
                                        $("#HTMQty_B").val(result.data.list2[0].HTMQty);
                                        $("#HWHName_B").val(result.data.list2[0].HWHName);
                                        $("#HSPName_B").val(result.data.list2[0].HSPName);
                                        //$("#HBarCode_B").val(result.data.list2[0].HBarCode);
                                        //$("#HMaterName_B").val(result.data.list2[0].HMaterName);
                                        //$("#HMaterModel_B").val(result.data.list2[0].HMaterModel);
                                        //$("#HBatchNo_B").val(result.data.list2[0].HBatchNo);
                                        //$("#HUnitName_B").val(result.data.list2[0].HUnitName);
                                        //$("#HQty_B").val(result.data.list2[0].HQty);
                                        //$("#HTMQty_B").val(result.data.list2[0].HTMQty);
                                        //$("#HWHName_B").val(result.data.list2[0].HWHName);
                                        //$("#HSPName_B").val(result.data.list2[0].HSPName);
                                    }
                                    else {
                                        layer.msg(result.Message);
@@ -1075,13 +1089,15 @@
                , toolbar: '#toolbarDemo'
                , cellMinWidth: 90
                , limit: 50
                , totalRow: true
                , limits: [50, 500, 5000, 20000]
                , page: true
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HSNO', title: '序号', width: 60 }
                    , { field: 'HQty', title: '数量', width: 80 }
                    , { field: 'HQtyMust', title: '应发数量', width: 80 }
                    , { type: 'numbers', title: '序号', totalRow: true }
                    , { field: 'HSNO', title: '序号', width: 60, totalRow: true  }
                    , { field: 'HQty', title: '数量', width: 80, totalRow: true}
                    , { field: 'HQtyMust', title: '应发数量', width: 80, totalRow: true }
                    , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                    , { field: 'HMaterName', title: '物料名称', width: 150 }
                    , { field: 'HMaterModel', title: '规格型号', width: 150 }
@@ -1089,6 +1105,7 @@
                    , { field: 'HSourceEntryID', title: '源单子内码', width: 150 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                    , { field: 'HBatchNo', title: '批次', width: 150 }
                    , { field: 'HPieceQty', title: '条码数量', width: 150 }
                ]]
                , height: 500
                , done: function () {
@@ -1115,14 +1132,18 @@
                if (HPPQty == "") {
                    HPPQty = 0;
                }
                var sRedBlue = "红字";
                var sMouldManagerCtl = "N";  //是否启用器具管理
                var sFIFOCtl = "N";          //是否启用先进先出管理
                $.ajax({
                    url: GetWEBURL() + "/MateOut/set_SavePonderationBillMain_Temp_Mate_Source_Fast_Json",
                    url: GetWEBURL() + "/MateOut/set_SavePonderationBillMain_Temp_Mate_Source_Fast_Json_Back",
                    type: "GET",
                    data: { "sInterID": sInterID, "sBillNo": sBillNo, "HBillType": '1244', "HSourceBillNo": HSourceBillNo, "HSourceBillType": HSourceBillType, "sMaker": sessionStorage["HUserName"], "sPPQty": HPPQty, "sPlanMode": HPlanMode, "sFIFOWHID": HFIFOWHID, "HOWNERID": sessionStorage["OrganizationID"] },
                    data: {
                        "sInterID": sInterID, "sBillNo": sBillNo, "HBillType": '1244', "sSourceBillNo": HSourceBillNo, "sSourceType": HSourceBillType, "sRedBlue": sRedBlue
                    },
                    success: function (result) {
                        HSourceFlag = true;
                        sessionStorage["SourceFlag"] = true;
                        $("#HPlanMode").attr("disabled", "true");
                        $("#HBillType").attr("disabled", "true");
                        element.tabChange('tab-MateOutBill', '2');
@@ -1180,6 +1201,8 @@
        function GetHSpValue(obj) {  //返回调入仓位
            $("#HStockPlaceName").val(obj[0].HName);
            $("#HStockPlaceID").val(obj[0].HItemID);
            $("#HWHNAME").val(obj[0].HWhName);
            $("#HWHID").val(obj[0].HWHID);
        }
        function GetHSupValue(obj) {  //返回供应商
            $("#HSupName").val(obj[0].HName);
@@ -1198,6 +1221,13 @@
            $("#HDeptID").val(obj[0].HItemID);
        }
        function AllowLoadData(sSubStr) {  //非空验证
            //数字正则(包含小数)
            var reg = /^\d+(\.\d+)?$/;
            //if (reg.test($("#HQty_B").val()) == false || $("#HQty").val() == '') {
            //    layer.msg("数量必须为数量或小数", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
            //    return false;
            //}
            if ($("#HBillNo").val() == '') {
                layer.msg("错误的单据号!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;