wtt
2024-10-28 07cf94734c36d4eae6ddbc4dd338bf5af81a2193
WebTM/views/Éú²ú¹ÜÀí/²úÁ¿»ã±¨µ¥/Sc_ProductReportBillList.html
@@ -32,11 +32,10 @@
                        <button type="button" class="layui-btn" lay-submit="" lay-filter="Delete" id="Delete"><i class="layui-icon layui-icon-add"></i>删除</button>
                        <button type="button" class="layui-btn" lay-submit="" lay-filter="AskReport" id="AskReport"><i class="layui-icon layui-icon-add"></i>申请检验</button>
                        <button type="button" class="layui-btn" lay-submit="" lay-filter="Exit" id="Exit"><i class="layui-icon layui-icon-add"></i>退出</button>
                        <span  id="top-title">产量汇报</span>
                        <button type="button" class="layui-btn" lay-submit="" lay-filter="ProdReport" id="ProdReport"><i class="layui-icon layui-icon-add"></i>生产汇报</button>
                        <span id="top-title">产量汇报</span>
                    </div>
                    <div class="layui-card-body" style="padding: 1px;">
                        <div class="layui-collapse">
                            <div class="layui-colla-item">
                                <div class="layui-colla-title layui-inline">
@@ -185,6 +184,25 @@
            //#endregion
            table.on('row(mainTable)', function (obj) {
                //选中行改变颜色
                var flag = !obj.tr.find(':checkbox:first').prop('checked');
                obj.tr.find(':checkbox').prop('checked', flag);
                if (flag) {
                    obj.tr.find('.layui-form-checkbox').addClass('layui-form-checked');  //设置复选框选中样式
                    $(obj.tr.selector).attr({ "style": "background:#ceedfa;color:black" });//改变当前tr背景颜色和字体颜色
                } else {
                    obj.tr.find('.layui-form-checkbox').removeClass('layui-form-checked');//取消复选框选中样式
                    $(obj.tr.selector).attr({ "style": "background:" });//取消当前tr颜色
                }
                //mainTable ä¸ºè¡¨æ ¼ID   æ³¨æ„æ­¤å¤„如果ID不正确将导致你在监听复选框时获取不到你选择的数据,前面的只是添加或删除选中未选中样式以及设置背景色,字体颜色
                layui.each(table.cache.mainTable, function (i, l) {
                    if (obj.tr.index() == l.LAY_TABLE_INDEX) {
                        l.LAY_CHECKED = flag;
                    }
                });
            })
            //#region æœ¬é¡µé¢æ‰€æœ‰è¢«è°ƒç”¨çš„æ–¹æ³•
            //初始化表格
@@ -194,9 +212,12 @@
                    elem: '#mainTable'
                    , height: 'full-50'
                    , page: true
                    , limit:500
                    , totalRow: true
                    , limits: [100, 500, 1000, 2000]
                    , cellMinWidth: 90
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                        { type: 'checkbox', fixed: 'left', totalRowText: '合计' }
                        , { field: 'HInterID', title: 'HInterID', sort: true, hide: true, width: 200 }
                        , { field: 'HDate', title: '日期', width: 200, templet: "<div>{{d.HDate ==null ?'':layui.util.toDateString(d.HDate, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: 'HBillNo', title: '单据号', width: 200 }
@@ -213,7 +234,7 @@
                        , { field: 'HMaterCode', title: '产品代码', width: 200 }
                        , { field: 'HMaterName', title: '产品名称', width: 200 }
                        , { field: 'HMaterSpec', title: '产品规格', width: 200 }
                        , { field: 'HQty', title: '汇报数量', width: 200 }
                        , { field: 'HQty', title: '汇报数量', width: 200, totalRow: true }
                        , { field: 'HSourceID', title: '生产资源ID', width: 200, hide: true }
                        , { field: 'HSourceCode', title: '生产资源代码', width: 200 }
                        , { field: 'HSourceName', title: '生产资源', width: 200 }
@@ -229,10 +250,10 @@
                };
            }
            //报工平台进入(有源单)
            //报工平台进入(有源单) åªèƒ½çœ‹åˆ°å½“前生产资源上开工了的生产订单的产量汇报单
            function set_AddNew()
            {
                sWhere = " where a.HSourceID='" + HSourceID + "' and a.HICMOBillNo='" + workcode + "' and HICMOInterID='" + (HICMOInterID == "null" ? 0 : HICMOInterID) + "' and HICMOEntryID='" + (HICMOEntryID == "null" ? 0 : HICMOEntryID) + "' and HMaker='" + HMaker + "' ";
                sWhere = " where HSourceID='" + HSourceID + "' and HICMOBillNo='" + workcode + "' and HICMOInterID='" + (HICMOInterID == "null" ? 0 : HICMOInterID) + "' and HICMOEntryID='" + (HICMOEntryID == "null" ? 0 : HICMOEntryID) + "' and HMaker='" + HMaker + "' ";
                SchWhere = sWhere;
                console.log(sWhere);
                //进入页面显示的缓存列表
@@ -266,12 +287,13 @@
                    var InterID = data[0].HInterID.toString();
                    var HICMOInID = data[0].HICMOInterID.toString();
                    var HICMOEnID = data[0].HICMOEntryID.toString();
                    //逻辑删除方法
                    layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                        $.ajax({
                            type: "GET",
                            url: GetWEBURL() + "Sc_MESBeginWorkBill/DeltetMESProductReportBill", //方法所在页面和方法名
                            data: { "HInterID": InterID, "HICMOInterID": HICMOInID, "HICMOEntryID": HICMOEnID },
                            data: { "HInterID": InterID, "HICMOInterID": HICMOInID, "HICMOEntryID": HICMOEnID, "UserName":sessionStorage["HUserName"] },
                            success: function (result) {
                                if (result.count == 1) {
                                    layer.msg(result.Message, { time: 1 * 2000, icon: 1 });
@@ -342,6 +364,33 @@
                    });
            })
            //生产汇报
            form.on('submit(ProdReport)', function (data) {
                var checkStatus = table.checkStatus('mainTable');
                var TabData = checkStatus.data;
                var HInterID = TabData[0].HInterID;
                if (checkStatus.data.length != 1) {
                    layer.alert("请选择一条数据!同一订单的生产数量将由系统判断并自动带出。");
                } else {
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '生产汇报单-编辑'
                        , shade: 0.6
                        , maxmin: false
                        , anim: 0
                        , content: ['../生产汇报单/Sc_Add_ICMOReportBillList.html?OperationType=2&linterid=' + HInterID.toString() + '&HSouceBillType=' + 3724, 'yes']
                        , resize: false
                        , cancel: function () {
                        }
                        , end: function () {
                        }
                    })
                }
            })
            //退出
            form.on('submit(Exit)', function (data)
            {
@@ -367,19 +416,19 @@
                    var Source = $("#Source").val();  //资源
                    sWhere += SchWhere;
                    if (HDate) {
                        sWhere += " and CONVERT(varchar(100),a.HDate, 23) >= '" + HDate + "'";
                        sWhere += " and CONVERT(varchar(100),HDate, 23) >= '" + HDate + "'";
                    }
                    if (HDate1) {
                        sWhere += " and CONVERT(varchar(100),a.HDate, 23) <= '" + HDate1 + "'";
                        sWhere += " and CONVERT(varchar(100),HDate, 23) <= '" + HDate1 + "'";
                    }
                    if (HBillNo) {
                        sWhere += " and a.HBillNo like '%" + HBillNo + "%'";
                        sWhere += " and HBillNo like '%" + HBillNo + "%'";
                    }
                    if (Part) {
                        sWhere += " and concat(m.HNumber,m.HName,m.HModel) like '%" + Part + "%'";
                        sWhere += " and concat(HNumber,HName,HModel) like '%" + Part + "%'";
                    }
                    if (Source) {
                        sWhere += " and s.HName like '%" + Dept + "%'";
                        sWhere += " and HName like '%" + Dept + "%'";
                    }
                    $.ajax({
                        //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",