chenhaozhe
2025-05-21 94853e46b9d4911fb4cf00389f00a4b820db5d3c
WebTM/views/²É¹º¹ÜÀí/²É¹º¶©µ¥/Cg_POOrderBillQuery.html
@@ -23,6 +23,7 @@
            background: #ceedfa;
            color: black
        }
    </style>
</head>
@@ -210,7 +211,7 @@
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_ReadScheme" id="set_ReadScheme"><i class="layui-icon layui-icon-set"></i>读取方案</button>
                            </div>
                        </script>
                        <table class="" id="mainTableSub" lay-filter="mainTableSub"></table>
                        <table class="" id="mainTableSub" lay-filter="mainTableSub" style="margin-top:35px"></table>
                        <script type="text/html" id="toolbarDemoSub">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_CloseRow" id="set_CloseRow"><i class="layui-icon layui-icon-form"></i>行关闭</button>
@@ -291,8 +292,8 @@
                    case 'btn-Delete': set_DeleteBill();
                        break;
                    //浏览
                    case 'btn-view': get_ViewReport();
                        break;
                    //case 'btn-view': get_ViewReport();
                    //    break;
                    //打印
                    case 'btn-print': get_PrintReport();
                        break;
@@ -452,7 +453,7 @@
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                //初始化表格
                set_InitGrid();
                //直接执行列表筛选 åŠ è½½æ•°æ®åˆ°ç½‘æ ¼
                ////直接执行列表筛选 åŠ è½½æ•°æ®åˆ°ç½‘æ ¼
                get_FastQuery(table, option,1)
                //查询当前登录用户有没有在当前模块设置默认过滤方案
@@ -463,108 +464,13 @@
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , height: 'full-330'
                    , height: 'full-300'
                    , page: true
                    , totalRow: true
                    , cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
                    , cols: [[
                        { type: 'checkbox', fixed: 'left', totalRowText: '合计' }
                        ,{ field: 'hmainid', title: 'hmainid', sort: true, hide: true }
                        , { field: '日期', title: '日期', width: 120, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '单据号', title: '单据号', width: 150, }
                        , { field: '状态', title: '状态', width: 100, sort: true }
                        , { field: 'HBillType', title: 'HBillType', hide: true, sort: true }
                        , { field: '行状态', title: '行状态', width: 125, sort: true }
                        , { field: '供应商', title: '供应商', width: 150 }
                        , { field: '业务员', title: '业务员', width: 100 }
                        //, { field: 'HBillType', title: 'HBillType', hide: true }
                        //, { field: 'HSupID', title: 'HSupID', hide: true }
                        //, { field: '业务状态', title: '业务状态', width: 100, hide: true }
                        , { field: '分配状态', title: '分配状态', width: 100 }
                        , { field: '发布状态', title: '发布状态', width: 100 }
                        , { field: '供应商协同状态', title: '供应商协同状态', width: 135 }/*物料代码,物料名称,规格型号,批号,数量,单位,源单单号*/
                        , { field: '反馈状态', title: '供应商反馈状态', width: 135 }
                        , { field: '物料编码', title: '物料编码', width: 120 }
                        , { field: '物料代码', title: '物料代码', width: 130 }
                        , { field: '旧物料编码', title: '旧物料编码', width: 130 }
                        , { field: '物料名称', title: '物料名称', width: 130 }
                        , { field: '数量', title: '订单数量', width: 100, totalRow: true }
                        , { field: '打印条码数量', title: '打印条码数量', width: 120, totalRow: true  }
                        /* å®‰ç‘žæ–°å¢žå­—段 begin */
                        , { field: '可打印条码数量', title: '可打印条码数量', width: 120, totalRow: true}
                        /* å®‰ç‘žæ–°å¢žå­—段 end */
                        , { field: '关联数量', title: '已发货数量', width: 120, totalRow: true}
                        , { field: '未关联数量', title: '可发货数量', width: 120, totalRow: true}
                        /* å®‰ç‘žæ–°å¢žå­—段 begin */
                        , { field: '退料数量', title: '退料数量', width: 120, totalRow: true}
                        , { field: '实收数量', title: '实收数量', width: 120, totalRow: true}
                        , { field: '入库数量', title: '入库数量', width: 120, totalRow: true}
                        , { field: '剩余入库数量', title: '剩余入库数量', width: 120, totalRow: true}
                        , { field: '剩余收料数量', title: '剩余收料数量', width: 120, totalRow: true}
                        /* å®‰ç‘žæ–°å¢žå­—段 end */
                        , { field: '完成状态', title: '完成状态', width: 100 }
                        , { field: 'HUnitID', title: 'HUnitID', hide: true }
                        , { field: '规格型号', title: '规格型号', width: 100 }
                        //, { field: 'HUnitID', title: 'HUnitID', hide: true }  é‡å¤
                        , { field: '计量单位代码', title: '计量单位代码', width: 120 , hide: true }
                        , { field: '计量单位', title: '计量单位', width: 100 }
                        , { field: '批号', title: '批号', width: 100 }
                        , { field: '数量', title: '数量', width: 100, totalRow: true }
                        , { field: '源单单号', title: '源单单号', width: 100 }
                        //, { field: '供应商代码', title: '供应商代码', width: 120, hide: true}
                        //, { field: '业务员代码', title: '业务员代码', width: 100, hide: true}
                        //, { field: 'HPriority', title: 'HPriority', width: 100, hide: true }
                        , { field: '优先级', title: '优先级', width: 100 }
                        , { field: '交货地点', title: '交货地点', width: 100}
                        , { field: 'HPSStyleID', title: 'HPSStyleID', hide: true }
                        , { field: '采购方式代码', title: '采购方式代码', width: 120, hide: true }
                        , { field: '采购方式', title: '采购方式', width: 100}
                        , { field: 'HSSID', title: 'HSSID', hide: true }
                        , { field: '结算方式代码', title: '结算方式代码', width: 120}
                        , { field: '结算方式', title: '结算方式', width: 100}
                        , { field: '结算日期', title: '结算日期', width: 120, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.结算日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: 'HCurID', title: 'HCurID', hide: true }
                        , { field: '币别代码', title: '币别代码', width: 100, hide: true }
                        , { field: '币别', title: '币别', width: 100}
                        , { field: '汇率', title: '汇率', width: 100}
                        , { field: 'HDeptID', title: 'HDeptID', hide: true }
                        , { field: '部门代码', title: '部门代码', width: 100, hide: true }
                        , { field: '部门', title: '部门', width: 100}
                        , { field: 'HManagerID', title: 'HManagerID', hide: true }
                        , { field: '主管代码', title: '主管代码', width: 100, hide: true }
                        , { field: '主管', title: '主管', width: 100}
                        , { field: 'HEmpID', title: 'HEmpID', hide: true }
                        , { field: '摘要', title: '摘要', width: 100 }
                        , { field: 'HWHID', title: '主表仓库ID', width: 120, hide: true}
                        , { field: '仓库', title: '主表仓库', width: 100, hide: true}
                        , { field: '表头备注', title: '表头备注', width: 100}
                        , { field: 'hsubid', title: 'hsubid', hide: true }
                        , { field: 'HMaterID', title: 'HMaterID', hide: true }
                        , { field: '单价', title: '单价', width: 100}
                        , { field: '金额', title: '金额', width: 100, totalRow: true }
                        , { field: '税率', title: '税率', width: 100}
                        , { field: '税额', title: '税额', width: 100}
                        , { field: '折扣率', title: '折扣率', width: 100}
                        , { field: '价税合计', title: '价税合计', width: 100}
                        , { field: '交货日期', title: '交货日期', width: 120, templet: "<div>{{d.交货日期 ==null ?'':layui.util.toDateString(d.交货日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '计划跟踪号', title: '计划跟踪号', width: 100}
                        , { field: '表体备注', title: '表体备注', width: 100}
                        , { field: '制单人', title: '制单人', width: 100}
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '审核人', title: '审核人', width: 100}
                        , { field: '审核日期', title: '审核日期', width: 120, templet: "<div>{{d.审核日期 ==null ?'':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '修改人', title: '修改人', width: 100}
                        , { field: '修改日期', title: '修改日期', width: 120, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '关闭人', title: '关闭人', width: 100}
                        , { field: '关闭日期', title: '关闭日期', width: 120, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '行关闭人', title: '行关闭人', width: 125, sort: true }
                       , { field: '行关闭日期', title: '行关闭日期', width: 200, templet: "<div>{{d.行关闭人 == ''?'':layui.util.toDateString(d.行关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '作废人', title: '作废人', width: 100}
                        , { field: '作废日期', title: '作废日期', width: 120, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                ]]
                    , cols: [[]]
                    , done: function (res, curr, count) {
                        soulTable.render(this);
@@ -574,8 +480,8 @@
                optionSub = {
                    elem: '#mainTableSub'
                    , toolbar: '#toolbarDemoSub'
                    , height: 'full-500'
                    , page: true
                    //, height: 'full-500'
                    , page: false
                    , totalRow: true
                    , cellMinWidth: 90
                    , limit: 50
@@ -593,6 +499,7 @@
                $.ajax({
                    url: GetWEBURL() + '/Cg_POOrderBill/QueryList',
                    type: "GET",
                    async: false,
                    data: { "sWhere": sWhere  , "user": sessionStorage["HUserName"]},
                    success: function (data1) {
                        if (data1.count == 1) {
@@ -611,7 +518,7 @@
                                }
                            }
                            //在列表左边添加勾选框
                            col.push({ type: 'radio', fixed: 'left', totalRowText: '合计'});
                            col.push({ type: 'checkbox', fixed: 'left', totalRowText: '合计'});
                            for (var i = 0; i < data.length; i++) {
                                // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                                if ($.inArray(data[i].name, titleData) > -1) {
@@ -1279,7 +1186,7 @@
                $("#HBillNo").val("");
                $("#HEmpName").val("");
                $("#HSupName").val("");
                $("#HOrgID").val(sessionStorage["OrganizationID"]);
                /*$("#HOrgID").val(sessionStorage["OrganizationID"]);*/
                $("#ColContent").val("");
                $("#ColName").val("0");
                $("#Comparator").val("0");
@@ -1575,15 +1482,26 @@
            //#region è¡Œç‚¹å‡»äº‹ä»¶
            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;
                    }
                });
                //显示子表
                get_DisplaySub(obj.data);
                //判断是否已经被选中
                if (obj.tr.find('.layui-form-radioed').length == 0) {
                    //触发单选框选中事件
                    obj.tr.find('i[class="layui-anim layui-icon"]').trigger("click");
                }
            })
            //子表单选
            table.on('row(mainTableSub)', function (obj) {
@@ -1595,6 +1513,22 @@
            })
            //#endregion
            //#region æŽ’序后选择
            table.on('sort(mainTable)', function (obj) { //注:sort æ˜¯å·¥å…·æ¡äº‹ä»¶åï¼Œtest æ˜¯ table åŽŸå§‹å®¹å™¨çš„å±žæ€§ lay-filter="对应的值"
                table.reload('mainTable', {
                    initSort: obj //记录初始排序,如果不设的话,将无法标记表头的排序状态。 layui 2.1.1 æ–°å¢žå‚æ•°
                    , where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
                        field: obj.field //排序字段   åœ¨æŽ¥å£ä½œä¸ºå‚数字段  field order
                        , order: obj.type //排序方式   åœ¨æŽ¥å£ä½œä¸ºå‚数字段  field order
                    }
                });
                option.data = layui.table.cache["mainTable"];
                table.render(option);
                //刷新按钮显示
                var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象
                Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
            });
            //#endregion
            //#region åˆå§‹æ—¥æœŸé—´éš” ä¸‹æ‹‰åˆ—表
            function setSelect_HInitTimeCycle() {
@@ -1690,7 +1624,7 @@
                            //隐藏显示过滤方案的标签信息
                            document.getElementById("HFilterScheme_Now").style.display = "none";
                            ////执行查询方法
                            //get_FastQuery()
                            get_FastQuery()
                            //form.render("select");
                        }
                    }, error: function () {
@@ -1884,7 +1818,7 @@
                var addSWhere = "";
                if (openType == 2) {
                    addSWhere = " and çŠ¶æ€ = '已审核' and è¡ŒçŠ¶æ€ = '' and HOrgID = " + HOrgID;
                    addSWhere = " and å®¡æ ¸äºº! = '' and å…³é—­äºº = ''";
                }
                return addSWhere;
            }