1
cwjbxqmz
2024-01-26 b742f00aac8e1e1bb628232383c35e67f4a41e4e
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξֿ߲â¹ÜÀí/Sc_MouldScrapOutBill.html
@@ -66,7 +66,7 @@
                                        </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">
                                                    <input type="text" name="HManagerName" id="HManagerName" 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;">
@@ -76,7 +76,7 @@
                                                </div>
                                            </div>
                                            <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">
                                                    <input type="text" name="HWHName" id="HWHName" readonly class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HWHID" id="HWHID" class="layui-input" value="" style="float:left;width:150px;">
@@ -86,7 +86,7 @@
                                                </div>
                                            </div>
                                            <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">
                                                    <input type="text" name="HKeeperName" id="HKeeperName" readonly class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HKeeperID" id="HKeeperID" class="layui-input" value="" style="float:left;width:150px;">
@@ -96,7 +96,7 @@
                                                </div>
                                            </div>
                                            <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">
                                                    <input type="text" name="HDeptName" id="HDeptName" readonly class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HDeptID" id="HDeptID" class="layui-input" value="" style="float:left;width:150px;">
@@ -110,7 +110,7 @@
                                            <div class="layui-inline">
                                                <label class="layui-form-label">往来类型</label>
                                                <div class="layui-input-inline">
                                                    <select name="HSupTypeID" id="HSupTypeID" class="layui-input" value="" style="float:left;width:150px">
                                                    <select name="HSupTypeID" id="HSupTypeID" class="layui-input" lay-filter="HSupTypeID" value="" style="float:left;width:150px">
                                                        <option value="1">供应商</option>
                                                        <option value="2">客户</option>
                                                        <option value="3">车间部门</option>
@@ -130,13 +130,13 @@
                                            <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;">
                                                    <input type="text" name="HSourceBillType" id="HSourceBillType" class="layui-input" value="" style="float:left;width:100%;">
                                                </div>
                                            </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;width:100%;">
                                                </div>
                                            </div>
                                        </div>
@@ -160,7 +160,21 @@
                            </div>
                        </div>
                        <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                        <div class="layui-tab layui-tab-card" lay-filter="TabTest">
                            <ul class="layui-tab-title">
                                <li class="layui-this">明细信息</li>
                                <li>汇总信息</li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                                </div>
                                <div class="layui-tab-item">
                                    <table class="layui-hide" id="mainTable1" lay-filter="mainTable1"></table>
                                </div>
                            </div>
                        </div>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
@@ -218,7 +232,7 @@
                , element = layui.element;
            var option;
            var sBillType = "3832";
            var TabRow = { "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HPropertyID": 0, "HPropertyCode": "", "HPropertyName": "", "HSecUnitID": 0, "HSecUnitCode": "", "HSecUnitName": "", "HSecUnitRate": 0, "HUnitID": 0, "HUnitCode": "", "HUnitName": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HRemark": "" }
            //var TabRow = { "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HPropertyID": 0, "HPropertyCode": "", "HPropertyName": "", "HSecUnitID": 0, "HSecUnitCode": "", "HSecUnitName": "", "HSecUnitRate": 0, "HUnitID": 0, "HUnitCode": "", "HUnitName": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"], "HRemark": "" }
            //#endregion
@@ -228,7 +242,7 @@
            //初始化表格
            set_InitGrid();
            set_CountGrid();
            //判断操作类型
            if (OperationType == 1) {//无源单
                set_AddFNew();
@@ -259,6 +273,13 @@
                        break;
                }
            }
            //下拉框事件选择触发
            form.on('select(HSupTypeID)', function (data) {
                $("#HSupID").val("");
                $("#HSupName").val("");
            });
            //表头信息往来单位弹窗
            form.on('submit(HSupList)', function () {
                debugger;
@@ -461,7 +482,7 @@
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;;
                var AddRow = table.cache['mainTable'];
                var NewRow = TabRow;
                var NewRow = { "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HPropertyID": 0, "HPropertyCode": "", "HPropertyName": "", "HSecUnitID": 0, "HSecUnitCode": "", "HSecUnitName": "", "HSecUnitRate": 0, "HUnitID": 0, "HUnitCode": "", "HUnitName": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"], "HRemark": "" };
                switch (obj.event) {
                    //新增一行
                    case 'btn-AddLine': btnAddLine(NewRow);
@@ -564,7 +585,7 @@
                                layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
                                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                                    parent.layer.close(index); //再执行关闭 Â  Â  Â  Â  Â Â  Â Â Â  Â 
                                    parent.layer.close(index); //再执行关闭
                                });
                            }
                            else {
@@ -583,16 +604,39 @@
            });
            //打印Printing
            form.on("submit(view)", function (data) {
                layer.alert("我是打印按钮!单据主ID是:" + linterid);
                //window.open("../生产工序管理/工序汇报单/HBarPlanPrint.html?linterid=" + linterid + "&Type=HDepartMent" + "&OpenTmp=b");
                window.open("../../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + linterid + "&Type=HMouldScrapOutBill&OpenTmp=器具生产领用条码");
                if (linterid != "" || linterid != null) {
                    layer.open({
                        type: 2
                        , area: ['50%', '50%']
                        , title: '打印模版选择'
                        , shade: 0.6 //遮罩透明度
                        , maxmin: false //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + linterid.toString() + '&MyMsg=' + linterid.toString() + '&Type=HMouldScrapOutBill', 'yes']
                        , resize: false
                    })
                }
                else {
                    layer.msg('当前单据ID为空!');
                }
            });
            //打印Printing
            form.on("submit(print)", function (data) {
                layer.alert("我是打印按钮!单据主ID是:" + linterid);
                //window.open("../生产工序管理/工序汇报单/HBarPlanPrint.html?linterid=" + linterid + "&Type=HDepartMent" + "&OpenTmp=b");
                window.open("../../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + linterid + "&Type=HMouldScrapOutBill&OpenTmp=器具生产领用条码");
                if (linterid != "" || linterid != null) {
                    layer.open({
                        type: 2
                        , area: ['50%', '50%']
                        , title: '打印模版选择'
                        , shade: 0.6 //遮罩透明度
                        , maxmin: false //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + linterid.toString() + '&MyMsg=' + linterid.toString() + '&Type=HMouldScrapOutBill', 'yes']
                        , resize: false
                    })
                }
                else {
                    layer.msg('当前单据ID为空!');
                }
            });
            //退出
@@ -662,6 +706,7 @@
                    , { field: 'HSPCode', title: '仓位代码', edit: 'text', event: 'HSPCode', width: 100 }
                    , { field: 'HSPName', title: '仓位名称', edit: 'text', width: 100 }
                    , { field: 'HRemark', title: '备注', edit: 'text', width: 100 }
                    , { field: 'HStockOrgID', title: 'HStockOrgID', width: 100, hide: true }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                ];
                option = {
@@ -677,12 +722,41 @@
                    }
                };
            }
            //初始汇总信息
            function set_CountGrid() {
                //表头
                columns = [
                    { type: 'checkbox', fixed: 'left' }
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe", width: 100 }
                    , { field: '物料代码', title: '物料代码', edit: 'text', event: 'HMaterCode', width: 100 }
                    , { field: '物料名称', title: '物料名称', edit: 'text', width: 100 }
                    , { field: '规格型号', title: '规格型号', edit: 'text', width: 100 }
                    , { field: '单据号', title: '单据号', edit: 'text', width: 100 }
                    , { field: '批次', title: '批次', edit: 'text', width: 100 }
                    , { field: '实发数量', title: '实发数量', edit: 'text', width: 100 }
                    , { field: 'hwhid1', title: 'HWHID', edit: 'text', width: 100, hide: true }
                    , { field: '发货仓库代码', title: '发货仓库代码', edit: 'text', event: 'HWHCode', width: 120 }
                    , { field: '发货仓库名称', title: '发货仓库名称', edit: 'text', width: 120 }
                    , { field: '子备注', title: '备注', edit: 'text', width: 100 }
                ];
                option1 = {
                    id: 'mainTable1'
                    , elem: '#mainTable1'
                    , height: 500
                    , page: true
                    , limit: 500
                    , cellMinWidth: 120
                    , height: 500
                    , cols: [columns]
                    , done: function (res, curr, count) {
                    }
                };
            }
            //无源单新增
            function set_AddFNew() {
                //获取最大单据号
                get_MAXNum();
                option.data = [TabRow];
                option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HPropertyID": 0, "HPropertyCode": "", "HPropertyName": "", "HSecUnitID": 0, "HSecUnitCode": "", "HSecUnitName": "", "HSecUnitRate": 0, "HUnitID": 0, "HUnitCode": "", "HUnitName": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"], "HRemark": "" }];
                table.render(option);
            }
@@ -690,7 +764,7 @@
            function set_EditFromGrid() {
                set_EditForm(linterid);  //编辑获取表头
                set_EditGrid(linterid);  //编辑获取表体
                option.data = [TabRow];
                option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HPropertyID": 0, "HPropertyCode": "", "HPropertyName": "", "HSecUnitID": 0, "HSecUnitCode": "", "HSecUnitName": "", "HSecUnitRate": 0, "HUnitID": 0, "HUnitCode": "", "HUnitName": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"], "HRemark": "" }];
                table.render(option);
            }
@@ -781,8 +855,10 @@
                    data: { "sqlWhere": "and hmainid=" + linterid },
                    success: function (result) {
                        if (result.count == 1) {
                            option.data = result.data;
                            option.data = result.list[0];
                            table.render(option);
                            option1.data = result.list[1];
                            table.render(option1);
                        } else {
                            layer.alert(result.code + result.Message, { icon: 5 });
@@ -798,9 +874,15 @@
            //增加一行
            function btnAddLine(NewRow) {
                table.cache["mainTable"].push(NewRow);
                option.data = table.cache["mainTable"];
                table.render(option);
                var tableBak = table.cache["mainTable"]; //获取之前编辑过的表格数据
                buttonArr = [];//清空数组
                for (var i = 0; i < tableBak.length; i++) {
                    buttonArr.push(tableBak[i]);  //将之前的数据存储
                }
                buttonArr.push(NewRow);  //在尾部加一行
                table.reload("mainTable", {
                    data: buttonArr    //将数据重新载入表格
                })
            }
            //复制一行