1
zrg
2025-06-09 f0892b93ea156d99b908d2620d330c4b765fa50d
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξ߹ÜÀí/Gy_MouldFile.html
@@ -397,7 +397,7 @@
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" name="HNowWHName" id="HNowWHName" style="width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" class="layui-input" name="HNowWHID" id="HNowWHID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHNowWHList" id="btnHNowWHList" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHNowWHList" id="btnHNowWHList" style="padding: 0 10px;float: right;margin-right: 3px;" disabled>
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                </button>
                                            </div>
@@ -407,7 +407,7 @@
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" name="HNowSPName" id="HNowSPName" style="width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" class="layui-input" name="HNowSPID" id="HNowSPID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHNowSPList" id="btnHNowSPList" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHNowSPList" id="btnHNowSPList" style="padding: 0 10px;float: right;margin-right: 3px;" disabled>
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                </button>
                                            </div>
@@ -415,7 +415,7 @@
                                        <div class="layui-inline" style="margin-left:10px;">
                                            <label class="layui-form-label">器具可用状态</label>
                                            <div class="layui-input-block">
                                                <select name="HMouldUseStatus" lay-filter="HMouldUseStatus" id="HMouldUseStatus">
                                                <select name="HMouldUseStatus" lay-filter="HMouldUseStatus" id="HMouldUseStatus" disabled>
                                                    <option value="正常" selected="selected">正常</option>
                                                    <option value="异常">异常</option>
                                                    <option value="保养">保养</option>
@@ -583,6 +583,8 @@
    </script>
    <script>
        var Stverf = "";
        var HDataEmp = {};
        //获取页面跳转参数
        var params = get_UrlVars();
        if (typeof (params[params[0]]) == "undefined") {
@@ -639,6 +641,7 @@
                //初始化子表
                get_InitGrid();
                set_AddFNew();
                $("#HUSEORGID").attr("disabled", true);
            } else if (OperationType == 2) {//无源单
                Stverf = "Add";
                get_InitGrid();
@@ -654,15 +657,20 @@
                $("#HCloseDate").val("");
                $("#HDeleteMan").val("");
                $("#HDeleteDate").val("");
                $("#HMouldNo").val("");
                $("#HBarCode").val("");
                $("#HUSEORGID").attr("disabled", true);
            }
            else if (OperationType == 3) {//编辑
                Stverf = "Update";
                //初始化子表
                get_InitGrid();
                set_EditFromGrid();
                $("#HUSEORGID").attr("disabled", true);
            }
            else {
                layer.alert("未知操作类型!", { icon: 5 });
                $("#HUSEORGID").attr("disabled", true);
            }
            //#endregion
@@ -692,6 +700,7 @@
            //对应Erp物料
            form.on('submit(btnHMaterList)', function () {
                var HOrgID = $("#HUSEORGID").val();
                //页面层-自定义
                layer.open({
                    type: 2,
@@ -701,7 +710,7 @@
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../基础资料/公用基础资料/Gy_Material.html', 'yes'],
                    content: ['../../基础资料/公用基础资料/Gy_Material.html?openType=2&HOrgID=' + HOrgID , 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
@@ -730,6 +739,7 @@
            //模具分类
            form.on('submit(btnHMouleList)', function () {
                var HOrgID = $("#HUSEORGID").val();
                //页面层-自定义
                layer.open({
                    type: 2,
@@ -739,7 +749,7 @@
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../基础资料/公用基础资料/Gy_MouldType.html', 'yes'],
                    content: ['../../基础资料/公用基础资料/Gy_MouldType.html?openType=2&HOrgID=' + HOrgID, 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
@@ -776,7 +786,7 @@
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../../views/基础资料/公用基础资料/Gy_Unit.html', 'yes'],
                    content: ['../../../views/基础资料/公用基础资料/Gy_Unit.html?openType=2', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
@@ -804,6 +814,8 @@
            //部门
            form.on('submit(btnHDeptList)', function () {
                var HOrgName = sessionStorage["Organization"];
                //页面层-自定义
                layer.open({
                    type: 2,
@@ -813,7 +825,7 @@
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html', 'yes'],
                    content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html?openType=2&HOrgName=' + HOrgName, 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
@@ -841,6 +853,8 @@
            //供应商
            form.on('submit(btnHSupList)', function () {
                var HOrgName = sessionStorage["Organization"];
                //页面层-自定义
                layer.open({
                    type: 2,
@@ -850,7 +864,7 @@
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../基础资料/采购基础资料/Gy_Supplier.html?Type=HSup', 'yes'],
                    content: ['../../基础资料/采购基础资料/Gy_Supplier.html?Type=HSup&HOrgName=' + HOrgName, 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
@@ -878,6 +892,7 @@
            //制造厂商
            form.on('submit(btnHMadeSup)', function () {
                var HOrgName = sessionStorage["Organization"];
                //页面层-自定义
                layer.open({
                    type: 2,
@@ -887,7 +902,7 @@
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../基础资料/采购基础资料/Gy_Supplier.html?Type=HAccSup', 'yes'],
                    content: ['../../基础资料/采购基础资料/Gy_Supplier.html?Type=HAccSup&HOrgName=' + HOrgName, 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
@@ -924,7 +939,7 @@
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../../views/基础资料/公用基础资料/Gy_Warehouse.html', 'yes'],
                    content: ['../../../views/基础资料/公用基础资料/Gy_Warehouse.html?openType=2', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
@@ -1109,7 +1124,7 @@
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../基础资料/公用基础资料/Gy_StockPlace_List.html', 'yes'],
                    content: ['../../基础资料/公用基础资料/Gy_StockPlace_List.html?openType=2', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
@@ -1182,7 +1197,7 @@
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['Sc_MouldMaintainRuleBillList.html', 'yes'],
                    content: ['Sc_MouldMaintainRuleBillList.html?openType=2', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
@@ -1393,7 +1408,7 @@
                //新增行表格数据
                var NewRow = {
                    "HMouldFileID": "0", "HMouldFileName": "", "HUnionDate": Format(new Date, "yyyy- MM - dd"), "HRemark": "",
                    "HMouldFileID": "0", "HMouldFileName": "", "HUnionDate": Format(new Date, "yyyy-MM-dd"), "HRemark": "",
                    "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0,
                };
                switch (obj.event) {
@@ -1615,7 +1630,7 @@
                    {
                        "HMouldFileID": "0"
                        , "HMouldFileName": ""
                        , "HUnionDate": Format(new Date, "yyyy- MM - dd")
                        , "HUnionDate": Format(new Date, "yyyy-MM-dd")
                        , "HRemark": ""
                        , "HSourceInterID": "0"
                        , "HSourceEntryID": "0"
@@ -1713,6 +1728,7 @@
                $("#HInterID").val(linterid);//修改时主表ID
                $.ajax({
                    url: GetWEBURL() + "/Gy_Mould_Edit/xg",
                    async:false,
                    type: "GET",
                    data: {
                        "HInterID": linterid
@@ -1995,7 +2011,7 @@
                        data: { "oMain": oMain },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) {
                            if (data.code == 1) {
                                layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    if (linterid == undefined) {
                                        $('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);
@@ -2043,34 +2059,42 @@
                                , shift: 2                                          //弹出动画
                                , area: ["90%", "90%"]                              //窗体大小
                                , maxmin: true                                      //设置最大最小按钮是否显示
                                , content: ["../../模治具管理/模治具管理/Gy_MouldFileList.html", "yes"]
                                , content: ["../../模治具管理/模治具管理/Gy_MouldFileList.html?openType=2", "yes"]
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
                                    var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                                    var rowIndex = $(obj.tr).attr("data-index") * 1;
                                    if (checkStatus.data.length != 1) {
                                        return layer.msg("请选择一条数据");
                                    for (var i = 0; i < checkStatus.data.length; i++) {
                                        if (rowIndex + i >= option.data.length) {
                                            var NewRow = {
                                                "HMouldFileID": "0", "HMouldFileName": "", "HUnionDate": Format(new Date, "yyyy-MM-dd"), "HRemark": "",
                                                "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0,
                                            };
                                            btnAddLine(NewRow);
                                        }
                                        //获取选中的子器具信息
                                        var resultData = checkStatus.data[i];
                                        option.data[rowIndex + i].HMouldFileID = resultData.hmainid;
                                        option.data[rowIndex + i].HMouldFileName = resultData.模具名称;
                                    }
                                    //更新表格缓存的数据
                                    obj.update({
                                        "HMouldFileID": checkStatus.data[0].hmainid,
                                        "HMouldFileName": checkStatus.data[0].模具名称
                                    })
                                    table.render(option);
                                    layer.close(index);//关闭弹窗
                                }
                                , btn2: function (index, layero) { }
                                , end: function () {
                                    if (typeof (OptionData.HItemID) != "undefined") {
                                    if (typeof (HDataEmp.hmainid) != "undefined") {
                                        obj.update({
                                            "HMouldFileID": OptionData.HItemID,
                                            "HMouldFileName": OptionData.模具名称
                                            "HMouldFileID": HDataEmp.hmainid,
                                            "HMouldFileName": HDataEmp.模具名称
                                        })
                                        OptionData = [];
                                        HDataEmp = {};
                                    }
                                }
                            })
                        }
@@ -2188,6 +2212,14 @@
            }
            //#endregion
            //#region åœ¨æœ«å°¾å¢žåŠ ä¸€è¡Œ
            function btnAddLine(NewRow) {
                table.cache["mainTable"].push(NewRow);
                option.data = table.cache["mainTable"];
                table.render(option);
            }
            //#endregion
            //判断是否登录 æœªç™»å½•则跳到登录页
            //if (sessionStorage.login != "login") {
            //    layer.confirm("登录失效,请重新登录!", {
@@ -2296,14 +2328,14 @@
            return Result;
        }
        function GetMaterValue(obj) {  //物料
            $("#HName").val(obj[0].物料名称);
            $("#HMaterNumber").val(obj[0].物料代码);
            $("#HMaterID").val(obj[0].HItemID);
        function GetGyMaterial(obj) {  //物料
            $("#HName").val(obj.物料名称);
            $("#HMaterNumber").val(obj.物料代码);
            $("#HMaterID").val(obj.HItemID);
        }
        function GetMouldTypeValue(obj) {  //器具分类
            $("#HMouleTypeName").val(obj[0].HName);
            $("#HMouleTypeName").val(obj[0].器具分类名称);
            $("#HMouleTypeID").val(obj[0].HItemID);
        }
@@ -2328,8 +2360,8 @@
        }
        function GetGyStockPlace(obj) {   //仓位
            $("#HSPName").val(obj[0].仓位名称);
            $("#HSPID").val(obj[0].HMainID);
            $("#HSPName").val(obj.仓位名称);
            $("#HSPID").val(obj.HMainID);
        }
        function GetMouldMaintainRuleValue(obj) {   //保养规程
@@ -2345,6 +2377,8 @@
        //子表器具双击返回
        function GetMouldFileValue(obj) {
            OptionData = obj[0];
            HDataEmp = obj[0];
        }
        function GetMouldDotCheckRuleValue(obj) {
            OptionData = obj[0];