duhe
2024-09-27 c2b05e1ec0bbbbf0147378e9570bc66bb715078f
WebTM/views/Éú²ú¹ÜÀí/ÒªÁϼƻ®/JIT_NeedMaterPlanBillEdit.html
@@ -55,7 +55,7 @@
                    <div style="padding: 10px; ">
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Cancel" id="Cancel">退出</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">保存</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="HideColumn" id="HideColumn">隐藏列设置</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="HideColumn" id="HideColumn">列设置</button>
                    </div>
                    <div class="layui-tab" lay-filter="tab-POStockInBill">
                        <div class="layui-tab-content">
@@ -200,9 +200,9 @@
            <option value="1">蓝海实业集团</option>
            <option value="100035">蓝海通讯公司</option>
            <option value="100037">通讯公司本部</option>
            <option value="100038">手机事业部</option>
            <option value="100038">杭州工厂</option>
            <option value="100039">平板事业部</option>
            <option value="100040">蓝海电子公司</option>
            <option value="100040">江山工厂</option>
            <option value="100041">蓝海销售公司</option>
            <option value="100042">香港销售公司</option>
            <option value="100043">蓝海电子商务有限公司</option>
@@ -273,6 +273,61 @@
            //    }, function () { window.location.href = "../../user/login.html"; });
            //}
            var HModName = "JIT_NeedMaterPlanBill";
            var option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , limit: 500 //每页默认显示的数量
                , cellMinWidth: 120
                , totalRow: true
                , height: 'full-270'
                , cols: [[ //表头
                    { type: 'checkbox', totalRowText: '合计行' }
                    , { type: 'numbers', title: '序号', totalRow: true }
                    , { field: 'HLaterReason', title: '延迟原因', templet: '#HLaterReason', width: 200 }//list
                    , { field: 'HMaterID', title: 'HMaterID', hide: true }
                    , { field: 'HMaterNumber', title: '物料编码', edit: 'text', event: "HMaterID" }
                    , { field: 'HMaterName', title: '物料名称' }
                    , { field: 'HMaterModel', title: '规格型号' }
                    , { field: 'HUnitID', title: 'HUnitID', hide: true }
                    , { field: 'HUnitIDName', title: '计量单位', edit: 'text', event: "HUnitID" }
                    , { field: 'HErpClsID', title: '物料属性', templet: '#HErpClsID' }//list
                    , { field: 'HQty', title: '数量', edit: 'text', totalRow: true}
                    , { field: 'HRemark', title: '备注', edit: 'text' }
                    , { field: 'HProdORGID', title: '生产组织', templet: "#HProdORGIDSub" }
                    , { field: 'HStatus', title: '状态', templet: '#HStatus' }//list
                    , { field: 'HFixleadTime', title: '提前期', edit: 'text', totalRow: true}
                    , { field: 'HSourceInterID', title: '日计划工单FID', edit: 'text' }
                    , { field: 'HSourceEntryID', title: '日计划工单FENTRYID', width: 200, edit: 'text' }
                    , { field: 'HSourceBillNo', title: '生产订单号', edit: 'text' }
                    , { field: 'HSourceBillType', title: '源单类型', edit: 'text' }
                    , { field: 'HDayPlanDate', title: '工单生产日期', width: 200, event: 'HDayPlanDate' }//date
                    , { field: 'HRelationQty', title: '关联数量', edit: 'text', totalRow: true}
                    , { field: 'HICMOInterID', title: '生产订单内码', edit: 'text' }
                    , { field: 'HICMOEntryID', title: '生产订单子内码', edit: 'text' }
                    , { field: 'HICMOBillSEQ', title: '生产订单行号', edit: 'text' }
                    , { field: 'HCloseMan', title: '行关闭', width: 200, edit: 'text' }
                    , { field: 'HEntryCloseDate', title: '行关闭日期', width: 200, event: 'HEntryCloseDate' }//date
                    , { field: 'HCloseTypeSub', title: '是否手工关闭', templet: "#HCloseTypeSub" }//ck
                    , { field: 'HReciveQty', title: '入库数量', edit: 'text', totalRow: true }
                    , { field: 'HCloseStatus', title: '关闭状态', templet: "#HCloseStatus" }//ck
                    , { field: 'HRemoveQty', title: '转移数量', edit: 'text', totalRow: true }
                    , { field: 'HSeOrderBillNo', title: '销售订单号', edit: 'text' }
                    , { field: 'HICMOEmpID', title: 'HICMOEmpID', hide: true }
                    , { field: 'HICMOEmpIDName', title: '生产订单制单人', edit: 'text', event: "HICMOEmpID" }
                    , { field: 'HUnReciveQty', title: '未收料数量', edit: 'text', totalRow: true}
                    , { field: 'HICMOBillDate', title: '生产订单单据日期', event: "HICMOBillDate", width: 200 }//date
                    , { field: 'HICMOBillDeliveryDate', title: '生产订单交货日期', event: "HICMOBillDeliveryDate", width: 200 } // date
                    , { field: 'HICMOBillRemark', title: '生产订单摘要', edit: 'text' }
                    , { field: 'HICMOBillNote', title: '生产订单表体备注', edit: 'text', width: 200 }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                ]]
            }
            //初始加载表格
            option.data = rowdata;
            DisPlay_HideColumn();
            var params = getUrlVars();
            var OperationType = params[params[0]]; //从参数中获取 æ•°æ®ç±»åž‹  æ·»åŠ  ä¿å­˜
            var linterid = params[params[1]]; //从参数中获取 å•据内码
@@ -294,62 +349,11 @@
                });
            }
            else {//如果修改则走下面 new
                //$("#HProdORGID").attr("disabled", true);
                RoadBillMain(linterid);
                //RoadBillSub(linterid);
            }
            var HModName = "JIT_NeedMaterPlanBill";
            var option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , limit: 500 //每页默认显示的数量
                , cellMinWidth: 120
                , height: 'full-270'
                , cols: [[ //表头
                    { type: 'checkbox', totalRowText: '合计行' }
                    , { type: 'numbers', title: '序号', totalRow: true }
                    , { field: 'HLaterReason', title: '延迟原因', templet: '#HLaterReason', width: 200 }//list
                    , { field: 'HMaterID', title: 'HMaterID', hide: true }
                    , { field: 'HMaterNumber', title: '物料编码', edit: 'text', event: "HMaterID" }
                    , { field: 'HMaterName', title: '物料名称' }
                    , { field: 'HMaterModel', title: '规格型号' }
                    , { field: 'HUnitID', title: 'HUnitID', hide: true }
                    , { field: 'HUnitIDName', title: '计量单位', edit: 'text', event: "HUnitID" }
                    , { field: 'HErpClsID', title: '物料属性', templet: '#HErpClsID' }//list
                    , { field: 'HQty', title: '数量', edit: 'text' }
                    , { field: 'HRemark', title: '备注', edit: 'text' }
                    , { field: 'HProdORGID', title: '生产组织', templet: "#HProdORGIDSub" }
                    , { field: 'HStatus', title: '状态', templet: '#HStatus' }//list
                    , { field: 'HFixleadTime', title: '提前期', edit: 'text' }
                    , { field: 'HSourceInterID', title: '日计划工单FID', edit: 'text' }
                    , { field: 'HSourceEntryID', title: '日计划工单FENTRYID', width: 200, edit: 'text' }
                    , { field: 'HSourceBillNo', title: '生产订单号', edit: 'text' }
                    , { field: 'HSourceBillType', title: '源单类型', edit: 'text' }
                    , { field: 'HDayPlanDate', title: '工单生产日期', width: 200, event: 'HDayPlanDate' }//date
                    , { field: 'HRelationQty', title: '关联数量', edit: 'text' }
                    , { field: 'HICMOInterID', title: '生产订单内码', edit: 'text' }
                    , { field: 'HICMOEntryID', title: '生产订单子内码', edit: 'text' }
                    , { field: 'HICMOBillSEQ', title: '生产订单行号', edit: 'text' }
                    , { field: 'HCloseMan', title: '行关闭', width: 200, edit: 'text' }
                    , { field: 'HEntryCloseDate', title: '行关闭日期', width: 200, event: 'HEntryCloseDate' }//date
                    , { field: 'HCloseTypeSub', title: '是否手工关闭', templet: "#HCloseTypeSub" }//ck
                    , { field: 'HReciveQty', title: '入库数量', edit: 'text' }
                    , { field: 'HCloseStatus', title: '关闭状态', templet: "#HCloseStatus" }//ck
                    , { field: 'HRemoveQty', title: '转移数量', edit: 'text' }
                    , { field: 'HSeOrderBillNo', title: '销售订单号', edit: 'text' }
                    , { field: 'HICMOEmpID', title: 'HICMOEmpID', hide: true }
                    , { field: 'HICMOEmpIDName', title: '生产订单制单人', edit: 'text', event: "HICMOEmpID" }
                    , { field: 'HUnReciveQty', title: '未收料数量', edit: 'text' }
                    , { field: 'HICMOBillDate', title: '生产订单单据日期', event: "HICMOBillDate", width: 200 }//date
                    , { field: 'HICMOBillDeliveryDate', title: '生产订单交货日期', event: "HICMOBillDeliveryDate", width: 200 } // date
                    , { field: 'HICMOBillRemark', title: '生产订单摘要', edit: 'text' }
                    , { field: 'HICMOBillNote', title: '生产订单表体备注', edit: 'text', width: 200 }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                ]]
            }
            //初始加载表格
            option.data = rowdata;
            DisPlay_HideColumn();
            //#endregion
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
@@ -605,6 +609,7 @@
                $.ajax({
                    type: "get",
                    url: GetWEBURL() + "/Web/GetOrganizations",
                    async:false,
                    success: function (result) {
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            var data = result.data;
@@ -612,6 +617,7 @@
                                Organization += '<option  style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>';
                            }
                            $("#HProdORGID").append(Organization);
                            $("#HProdORGID").val(sessionStorage["OrganizationID"]);
                            form.render('select');
                        }
                        layer.closeAll("loading");
@@ -687,7 +693,7 @@
                    , shift: 2 //弹出动画
                    , area: ["90%", "90%"] //窗体大小
                    , maxmin: true //设置最大最小按钮是否显示
                    , content: ["../../Baseset/基础资料/Gy_DepartmentList.html", "yes"]
                    , content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html', 'yes']
                    , btn: ["确定", "取消"]
                    , btn1: function (index, laero) {
                        //按钮一  çš„回调
@@ -699,7 +705,7 @@
                        }
                        //更新表格缓存的数据
                        $("#HDeptID").val(checkStatus.data[0].HItemID);
                        $("#HDeptIDName").val(checkStatus.data[0].HName);
                        $("#HDeptIDName").val(checkStatus.data[0].部门名称);
                        layer.close(index);//关闭弹窗
                    }
                })
@@ -749,7 +755,7 @@
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ["../../Baseset/基础资料/Gy_MaterialList.html", "yes"]
                                , content: ['../../基础资料/公用基础资料/Gy_Material.html', 'yes']
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
@@ -763,9 +769,9 @@
                                    //更新表格缓存的数据
                                    obj.update({
                                        "HMaterID": checkStatus.data[0].HItemID
                                        , "HMaterNumber": checkStatus.data[0].HNumber
                                        , "HMaterName": checkStatus.data[0].HName
                                        , "HMaterModel": checkStatus.data[0].HModel
                                        , "HMaterNumber": checkStatus.data[0].物料代码
                                        , "HMaterName": checkStatus.data[0].物料名称
                                        , "HMaterModel": checkStatus.data[0].规格型号
                                    })
                                    layer.close(index);//关闭弹窗
                                }
@@ -783,7 +789,7 @@
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ["../../Baseset/基础资料/Gy_UnitList.html", "yes"]
                                , content: ['../../基础资料/公用基础资料/Gy_Unit.html', 'yes']
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
@@ -796,7 +802,7 @@
                                    //更新表格缓存的数据
                                    obj.update({
                                        "HUnitID": checkStatus.data[0].HItemID
                                        , "HUnitIDName": checkStatus.data[0].HName
                                        , "HUnitIDName": checkStatus.data[0].计量单位名称
                                    })
                                    layer.close(index);//关闭弹窗
                                }
@@ -814,7 +820,7 @@
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ["../../Baseset/基础资料/Gy_EmployeeList.html", "yes"]
                                , content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html', 'yes']
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
@@ -827,12 +833,14 @@
                                    //更新表格缓存的数据
                                    obj.update({
                                        "HICMOEmpID": checkStatus.data[0].HItemID
                                        , "HICMOEmpIDName": checkStatus.data[0].HName
                                        , "HICMOEmpIDName": checkStatus.data[0].部门名称
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                            })
                        }
                        obj.event = "";
                        return false;
                    }
@@ -871,6 +879,7 @@
                $.ajax({
                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
                    type: "GET",
                    async: false,
                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.data.length != 0) {
@@ -887,6 +896,10 @@
                                if (dataCols[1] == 1) {
                                    option.cols[0][i + 1]["hide"] = true;
                                }
                                //设置列宽
                                if (dataCols[3] > 0) {
                                    option.cols[0][i + 1]["width"] = dataCols[3];
                                }
                                //设置内容字体大小
                                if (data1.data[0].HFontSize != 0) {
                                    option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
@@ -894,11 +907,11 @@
                                    option.cols[0][i + 1]["style"] = "font-size:100%";
                                }
                                //设置列宽
                                if (data1.data[0].HColumnWidth != 0) {
                                    option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
                                } else {
                                    option.cols[0][i + 1]["width"] = "";
                                }
                                //if (data1.data[0].HColumnWidth != 0) {
                                //    option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
                                //} else {
                                //    option.cols[0][i + 1]["width"] = "";
                                //}
                                //显示列
                                if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
                                    option.cols[0][i + 1]["hide"] = false;
@@ -952,6 +965,7 @@
                $.ajax({
                    url: GetWEBURL() + "/Sc_WorkDemandPlanBill/Sc_WorkDemandPlanBillList",
                    type: "GET",
                    async: false,
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (d) {
@@ -960,7 +974,7 @@
                            "HBillNo": d.data[0].单据号
                            , "HInterID": d.data[0].hmainid
                            , "HAddress": d.data[0].交货地点
                            , "HProdORGID": d.data[0].主生产组织
                            , "HProdORGID": d.data[0].HProdORGID
                            , "HDeptID": d.data[0].HDeptID
                            , "HDeptIDName": d.data[0].车间名称
                            , "HSettleCurrId": d.data[0].HSettleCurrId
@@ -1013,9 +1027,9 @@
                        }
                        form.render('select');
                        form.render('checkbox');
                    }
                })
            }
@@ -1040,7 +1054,7 @@
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(num);
                var sMainSub = sMainStr + ';' + sSubStr + ';' + OperationType + ";" + sessionStorage["HUserName"];
                var index = layer.load();
                $.ajax({
                    type: "POST",