王 垚
2021-11-17 860b467d074e8654c6b358dd22c12cd49a1c011f
生产领料单
2个文件已修改
185 ■■■■ 已修改文件
WebTM/views/领料发货/领料出库/Kf_MateOutBillLEdit.html 167 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/领料发货/领料出库/Kf_MateOutBillList.html 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/ÁìÁÏ·¢»õ/ÁìÁϳö¿â/Kf_MateOutBillLEdit.html
@@ -68,12 +68,7 @@
                                                    <input class="layui-input" name="HDate" id="HDate" autocomplete="off" model="datetime" dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd">
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">内部单据号</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HInnerBillNo" id="HInnerBillNo" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">仓库<label style="color:red"> * </label></label>
                                                <div class="layui-input-inline">
@@ -87,7 +82,7 @@
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">验收员<label style="color:red"> * </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" readonly class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HSecManagerID" id="HSecManagerID" class="layui-input" value="" style="float:left;width:150px;">
@@ -116,49 +111,32 @@
                                                    </button>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">源单类型</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HSourceBillType" id="HSourceBillType" class="layui-input" value="" style="float:left;width:150px;">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">往来类型</label>
                                                <label class="layui-form-label">主管<label style="color:red"> * </label></label>
                                                <div class="layui-input-inline">
                                                    <select name="HSupTypeID" id="HSupTypeID" lay-filter="HSupTypeID" class="layui-input" value="" style="float:left;width:150px">
                                                        <option value="1">供应商</option>
                                                        <option value="2">客户</option>
                                                        <option value="3">车间部门</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">往来单位<label style="color:red"> * </label></label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HSupName" id="HSupName" readonly class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HSupID" id="HSupID" class="layui-input" value="0" style="float:left;width:150px;">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HSupList" style="width:40px;">
                                                    <input type="text" name="HMangerName" id="HMangerName" readonly class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HManagerID" id="HManagerID" class="layui-input" value="" style="float:left;width:150px;">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HManger" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">源单类型</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HSourceBillType" id="HSourceBillType" class="layui-input" value="" style="float:left;">
                                        </div>
                                        <div class="layui-form-item">
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">选单号</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="XDH" id="XDH" class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="text" name="XDH" id="XDH" class="layui-input" value="" style="float:left;">
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">摘要</label>
                                                <div class="layui-input-inline">
                                                    <textarea placeholder="请输入摘要" class="layui-textarea" name="HExplanation" id="HExplanation"></textarea>
                                                </div>
                                            </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">备注</label>
                                                <div class="layui-input-inline">
@@ -174,7 +152,7 @@
                        <div class="layui-tab layui-tab-card" lay-filter="TabTest">
                            <ul class="layui-tab-title">
                                <li class="layui-this">明细信息</li>
                                <li>汇总信息</li>
                                <!--<li>汇总信息</li>-->
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
@@ -213,7 +191,6 @@
            var OperationType = 1;//操作类型
            var closeType = 2;  //关闭类型
        } else {
            debugger;
            var OperationType = params[params[0]];//操作类型
            var linterid = params[params[1]];//源单id
            var HSouceBillType = params[params[2]];//源单类型
@@ -238,10 +215,8 @@
            var option = [];
            var option1 = [];
            var sWhere = "";
            var sBillType = "3801";
            var sBillType = "1204";
            //#endregion
            //#region è¿›å…¥é¡µé¢æ—¢åŠ è½½
            //初始化表单插件
            set_InitFrom();
@@ -356,6 +331,44 @@
                    }
                });
            });
            //主管
            form.on('submit(HManger)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '验收员列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../PublicPage/UserInformation.html', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                          $("#HMangerName").val(checkStatus.data[0].HName);
                        $("#HManagerID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //表头信息保管员弹窗
            form.on('submit(HKeeperList)', function () {
                //页面层-自定义
@@ -453,7 +466,6 @@
            }
            //表头信息往来单位弹窗
            form.on('submit(HSupList)', function () {
                debugger;
                if ($("#HSupTypeID").val() == 0 || $("#HSupTypeID").val() == null) {
                    return layer.msg('请选择往来类型');
                }
@@ -503,7 +515,6 @@
                if (linterid != "" && linterid != null) {
                    refSav = "Update";
                }
                //debugger;
                data.field.HMaker = sessionStorage["HUserName"];//制单人
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(table.cache['mainTable']);
@@ -516,7 +527,7 @@
                $.ajax(
                    {
                        type: "POST",
                        url: GetWEBURL() + "/Sc_MouldProdInHouseBill/SaveGetMouldProdInHouseBillList", //方法所在页面和方法名
                        url: GetWEBURL() + "/Kf_MateOutBill/SaveGetMateOutBillList", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainSub },
                        dataType: "json",
@@ -670,33 +681,28 @@
                    elem: '#HDate'
                });
            }
            //初始化明细表格
            function set_InitGrid() {
                columns = [
                    { type: 'checkbox', fixed: 'left' }
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe", width: 100 }
                    , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true }
                    , { field: 'HMaterCode', title: '器具代码', edit: 'text', event: 'HMaterCode', width: 100 }
                    , { field: 'HMaterName', title: '器具名称', edit: 'text', width: 100 }
                    , { field: 'HMaterCode', title: '物料代码', edit: 'text', event: 'HMaterCode', width: 100 }
                    , { field: 'HMaterName', title: '物料名称', edit: 'text', width: 100 }
                    , { field: 'HMaterSpec', title: '规格型号', edit: 'text', width: 100 }
                    , { field: 'HBatchNo', title: '批次', edit: 'text', width: 100 }
                    , { field: 'HUnitID', title: 'HUnitID', edit: 'text', width: 100, hide: true }
                    , { field: 'HUnitCode', title: '计量单位代码', edit: 'text', event: 'HUnitCode', width: 100 }
                    , { field: 'HUnitName', title: '计量单位', edit: 'text', width: 100 }
                    , { field: 'HDesignLife', title: '设计寿命', edit: 'text', width: 100 }
                    , { field: 'HLeaveLife', title: '剩余寿命', edit: 'text', width: 100 }
                    , { field: 'HUseLife', title: '使用寿命', edit: 'text', width: 100 }
                    , { field: 'HQtyMust', title: '应收数量', edit: 'text', width: 100 }
                    , { field: 'HQty', title: '实收数量', edit: 'text', width: 100 }
                    , { field: 'HQtyMust', title: '应发数量', edit: 'text', width: 100 }
                    , { field: 'HQty', title: '实发数量', edit: 'text', width: 100 }
                    , { field: 'HPrice', title: '单价', edit: 'text', width: 100 }
                    , { field: 'HMoney', title: '金额', edit: 'text', width: 100 }
                    , { field: 'HWHID', title: 'HWHID', edit: 'text', width: 100, hide: true }
                    , { field: 'HWHCode', title: '收料仓库代码', edit: 'text', event: 'HWHCode', width: 120 }
                    , { field: 'HWHName', title: '收料仓库名称', edit: 'text', width: 120 }
                    , { field: 'HSPID', title: 'HSPID', edit: 'text', width: 100, hide: true }
                    , { field: 'HSPCode', title: '收料仓位代码', edit: 'text', event: 'HSPCode', width: 120 }
                    , { field: 'HSPName', title: '收料仓位名称', edit: 'text', width: 120 }
                    , { field: 'HStockOrgID', title: 'HStockOrgID', width: 100, hide: true }
                    , { field: 'HWHCode', title: '发料仓库代码', edit: 'text', event: 'HWHCode', width: 120 }
                    , { field: 'HWHName', title: '发料仓库名称', edit: 'text', width: 120 }
                    , { field: 'HRemark', title: '备注', edit: 'text', width: 100 }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                ];
@@ -748,7 +754,7 @@
            function set_AddFNew() {
                //获取最大单据号
                get_MAXNum();
                option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "","HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"], "HRemark": "" }];
                option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "", "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HRemark": "" }];
                table.render(option);
            }
            //获取最大单据号
@@ -772,13 +778,13 @@
            function set_EditFromGrid(linterid) {
                set_EditForm(linterid);  //编辑获取表头
                set_EditGrid(linterid);  //编辑获取表体
                option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "","HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"], "HRemark": "" }];
                option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "", "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HRemark": "" }];
                table.render(option);
            }
            //编辑获取表头
            function set_EditForm(linterid) {
                $.ajax({
                    url: GetWEBURL() + "Sc_MouldProdInBill/Sc_MouldProdInHouseBillListCheckDetai",
                    url: GetWEBURL() + "Kf_MateOutBill/Kf_MateOutBillListCheckDetai",
                    type: "GET",
                    data: {
                        "HID": linterid
@@ -790,22 +796,20 @@
                            form.val("component-form-group", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                                "HBillNo": data.单据号
                                , "HDate": formatDate(data.日期)
                                , "HInnerBillNo": data.内部单据号
                                , "HWHID": data.HWHID                    //仓库ID
                                //, "HInnerBillNo": data.内部单据号
                                , "HWHID": data.HWHIDMain                    //仓库ID
                                , "HWHName": data.仓库                   //仓库名称
                                , "HSecManagerID": data.hsecmanagerid    //验收员ID
                                , "HSecManagerName": data.验收员         //验收员名称
                                , "HSecManagerName": data.领料员         //验收员名称
                                , "HKeeperID": data.hkeeperid            //保管员ID
                                , "HKeeperName": data.保管员             //保管员名称
                                , "HManagerID": data.hmanagerid             //保管员名称
                                , "HMangerName": data.主管             //保管员名称
                                , "HDeptID": data.HDeptID                 //部门ID
                                , "HDeptName": data.部门                  //部门名称
                                , "HSourceBillType": data.源单类型        //源单类型
                                , "XDH": ""                               //选单号
                                , "HExplanation": data.摘要              //摘要
                                , "HRemark": data.表头备注                    //备注
                                , "HSupTypeID": data.往来类型                             //选单号
                                , "HSupName": data.往来单位              //摘要
                                , "HSupID": data.HSupID                    //备注
                            });
                        } else {
@@ -821,21 +825,21 @@
                $("#HInterID").val(linterid);//修改时主表ID
                //编辑加载数据
                $.ajax({
                    url: GetWEBURL() + 'Sc_MouldProdInBill/Sc_MouldScrapInProdBillListProjectDetai',
                    url: GetWEBURL() + 'Kf_MateOutBill/Kf_MateOutBillListProjectDetai',
                    type: "GET",
                    data: { "sqlWhere": "and hmainid=" + linterid },
                    success: function (result) {
                        if (result.count == 1) {
                            option.data = result.list[0];
                            table.render(option);
                            option1.data = result.list[1];
                            table.render(option1);
                            //option1.data = result.list[1];
                            //table.render(option1);
                        } else {
                            layer.alert(result.code + result.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(index0);
                        layer.close();
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
@@ -918,12 +922,12 @@
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '器具列表',
                                title: '物料列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['80%', '80%'],
                                maxmin: true,
                                content: ['../../PublicPage/MouldInformation.html', 'yes'],
                                content: ['../../PublicPage/PartInformation.html', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
@@ -1149,7 +1153,7 @@
                    return Result = false;
                }
                if ($("#HSecManagerID").val() == '' || $("#HSecManagerID").val() == null) {
                    layer.msg("验收员不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    layer.msg("领料员不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HKeeperID").val() == '' || $("#HKeeperID").val() == null) {
@@ -1160,7 +1164,10 @@
                    layer.msg("部门不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HManagerID").val() == '' || $("#HManagerID").val() == null) {
                    layer.msg("主管不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if (typeof (sSubStr) == "undefined" || sSubStr == "") {
                    layer.msg("没有物料明细记录", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
@@ -1168,16 +1175,16 @@
                if (typeof (sSubStr) != "undefined" && typeof (sSubStr) != "") {
                    sSubStr = JSON.parse(sSubStr);
                    for (var i = 0; i < sSubStr.length; i++) {
                        if (sSubStr[i].HMaterID == "") {
                            layer.msg("明细记录第" + (i + 1) + "行,器具信息为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            return Result = false;
                        }
                        //if (sSubStr[i].HMaterID == "") {
                        //    layer.msg("明细记录第" + (i + 1) + "行,物料信息为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        //    return Result = false;
                        //}
                        if (sSubStr[i].HUnitID == "") {
                            layer.msg("明细记录第" + (i + 1) + "行,计量单位为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            return Result = false;
                        }
                        if (sSubStr[i].HWHID == "") {
                            layer.msg("明细记录第" + (i + 1) + "行,收料仓库为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            layer.msg("明细记录第" + (i + 1) + "行,发料仓库为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            return Result = false;
                        }
                    }
WebTM/views/ÁìÁÏ·¢»õ/ÁìÁϳö¿â/Kf_MateOutBillList.html
@@ -112,11 +112,13 @@
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-getCheckData"><i class="layui-icon layui-icon-tips"></i>预览</button>-->
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add"><i class="layui-icon layui-icon-file-b"></i>新增</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit"><i class="layui-icon layui-icon-form"></i>编辑</button>
                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-view"><i class="layui-icon layui-icon-tips"></i>预览</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>打印</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-audit"><i class="layui-icon layui-icon-repeat"></i>审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Faudit"><i class="layui-icon layui-icon-refresh"></i>反审核</button>-->
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-reload"><i class="layui-icon layui-icon-refresh"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-confirm" id="btn_confirm"><i class="layui-icon layui-icon-ok-circle"></i>确认</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-back" id="btn_back"><i class="layui-icon layui-icon-close-fill"></i>驳回</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-details"><i class="layui-icon layui-icon-form"></i>详情</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-generate"><i class="layui-icon layui-icon-file"></i>生成送货单</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>退出</button>
                            </div>
@@ -209,13 +211,13 @@
                    , { field: '日期', title: '日期', width: 160, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
                    , { field: '单据号', title: '单据号', width: 160 }
                    , { field: '红蓝单标记', title: '红蓝单标记', width: 160 }
                    , { field: 'HEmpID', title: 'HEmpID', width: 200, hide: true }
                    , { field: '业务员', title: '业务员', width: 200 }
                    , { field: 'hmanagerid', title: 'hmanagerid', width: 200, hide: true }
                    , { field: '主管', title: '主管', width: 200 }
                    , { field: '仓库', title: '仓库', width: 160 }
                    , { field: 'hsecmanagerid', title: 'hsecmanagerid', width: 200, hide: true }
                    , { field: '领料员', title: '领料员', width: 200 }
                    , { field: 'hkeeperid', title: 'hkeeperid', width: 200, hide: true }
                    , { field: '保管员', title: '保管员', width: 160 }
                    , { field: 'hmanagerid', title: 'hmanagerid', width: 200, hide: true }
                    , { field: '主管', title: '主管', width: 200 }
                    , { field: 'HDeptID', title: 'HDeptID', width: 160, hide: true }
                    , { field: '部门', title: '部门', width: 160 }
                    , { field: 'hsubid', title: 'hsubid', width: 200, hide: true }