duhe
2025-06-19 f2ff5a79bc4eb7bc321f181e9cc63334b4e9460f
WebTM/views/Baseset/»ù´¡×ÊÁÏ/Sc_ProcessExchangeBillListView.html
@@ -13,12 +13,12 @@
    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-card-body" style="padding: 15px;">
                <form class="layui-form" action="" lay-filter="component-form-group">
                <form class="layui-form" action="" lay-filter="component-form-group" onsubmit="return false;">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">过滤列</label>
                            <div class="layui-input-inline">
                                <input type="text" name="Value" id="Value" lay-verify="Value" autocomplete="off" placeholder="请输入过滤列" class="layui-input">
                                <input type="text" class="layui-input" name="Value" id="Value" lay-verify="Value" value="" placeholder="请输入过滤列" autocomplete="off">
                            </div>
                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HQuery">快速查询</button>
                            <button type="button" lay-submit="" class="layui-btn" lay-filter="FH">返回</button>
@@ -28,18 +28,25 @@
            </div>
        </div>
    </div>
    <table class="layui-hide" id="mainTable"></table>
    <table class="" id="mainTable" lay-filter="mainTable"></table>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js" type="text/javascript"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script>
        //引用的单据及模块:工序流转卡。
        layui.use(['table', 'form', 'layer'], function () {
            var table = layui.table
            , form = layui.form
            , layer = layui.layer;
                , form = layui.form
                , layer = layui.layer;
            var sWhere = "";
            var params = get_UrlVars();
            var HProcID = params[params[0]]; //从参数中获取 å·¥åºid
            var HSourceID = params[params[1]]; //从参数中获取 ç”Ÿäº§èµ„源id
            var HMaterID = params[params[2]];//从参数中获取物料ID
            form.on('submit(HQuery)', function () {//选择单位
                //var sMainStr = JSON.stringify(table.cache['mainTable']);
                RoadQuery($('#Value').val());
@@ -47,134 +54,176 @@
            form.on('submit(FH)', function () {//选择单位
                //var sMainStr = JSON.stringify(table.cache['mainTable']);
                var checkStatus = table.checkStatus('mainTable')
                 , data = checkStatus.data;
                    , data = checkStatus.data;
                parent.GetProcessExchangeValue(data);
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            });
            RoadQuery($('#Value').val());
            //#region åŒå‡»è¿”回数据
            table.on('rowDouble(mainTable)', function (obj) {
                var data = [];
                data.push(obj.data);
                parent.GetProcExValue(data);
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            });
            //#endregion
            //#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;
                    }
                });
            })
            //#endregion
            table.render({
                elem: '#mainTable'
                // , url: '/demo/table/user/'
               , data: []
              , cellMinWidth: 80 //全局定义常规单元格的最小宽度,layui 2.2.1 æ–°å¢ž
              , cols: [[
                  { type: 'radio' }
                  , { field: 'hmainid', width: 150, title: 'hmainid', hide: true }
                  , { field: 'hicmointerid', width: 150, title: 'hicmointerid', hide: true }
                  , { field: 'HICMOEntryID', width: 150, title: 'HICMOEntryID', hide: true }
                  , { field: 'HWorkShopID', width: 150, title: 'HWorkShopID', hide: true }
                  , { field: 'HMaterID', width: 150, title: 'HMaterID', hide: true }
                  , { field: 'HUnitID', width: 150, title: 'HUnitID', hide: true }
                  , { field: 'HSupID', width: 150, title: 'HSupID', hide: true }
                  , { field: 'hsubid', width: 150, title: 'hsubid', hide: true }
                  , { field: 'HProcID', width: 150, title: 'HProcID', hide: true }
                  , { field: 'HCenterID', width: 150, title: 'HCenterID', hide: true }
                  , { field: 'HDeptID', width: 150, title: 'HDeptID', hide: true }
                  , { field: 'HGroupID', width: 150, title: 'HGroupID', hide: true }
                  , { field: 'HWorkerID', width: 150, title: 'HWorkerID', hide: true }
                  , { field: 'HSourceID', width: 150, title: 'HSourceID', hide: true }
                  , { field: 'HBillType', width: 150, title: 'HBillType', hide: true }
                  , { field: '日期', width: 150, title: '日期' }
                  , { field: '单据号', width: 150, title: '单据号' }
                  , { field: '任务单号', width: 150, title: '任务单号' }
                  , { field: '生产订单号', width: 150, title: '生产订单号' }
                  , { field: '生产车间代码', width: 150, title: '生产车间代码' }
                  , { field: '生产车间', width: 150, title: '生产车间' }
                  , { field: '产品代码', width: 150, title: '产品代码' }
                  , { field: '产品', width: 150, title: '产品' }
                  , { field: '规格型号', width: 150, title: '规格型号' }
                  , { field: '批号', width: 150, title: '批号' }
                  , { field: '单位代码', width: 150, title: '单位代码' }
                  , { field: '单位', width: 150, title: '单位' }
                  , { field: '生产数量', width: 150, title: '生产数量' }
                  , { field: '任务单数量', width: 150, title: '任务单数量' }
                  , { field: '订单跟踪号', width: 150, title: '订单跟踪号' }
                  , { field: '计划开工日期', width: 150, title: '计划开工日期' }
                  , { field: '计划完工日期', width: 150, title: '计划完工日期' }
                  , { field: '摘要', width: 150, title: '摘要' }
                  , { field: '内部单据号', width: 150, title: '内部单据号' }
                  , { field: '委外订单内码', width: 150, title: '委外订单内码' }
                  , { field: '委外订单子内码', width: 150, title: '委外订单子内码' }
                  , { field: '委外订单号', width: 150, title: '委外订单号' }
                  , { field: '供应商代码', width: 150, title: '供应商代码' }
                  , { field: '供应商', width: 150, title: '供应商' }
                  , { field: '委外加工单位', width: 150, title: '委外加工单位' }
                  , { field: '表头备注', width: 150, title: '表头备注' }
                  , { field: '工序号', width: 150, title: '工序号' }
                  , { field: '工序代码', width: 150, title: '工序代码' }
                  , { field: '工序', width: 150, title: '工序' }
                  , { field: '加工说明', width: 150, title: '加工说明' }
                  , { field: '工作中心代码', width: 150, title: '工作中心代码' }
                  , { field: '工作中心', width: 150, title: '工作中心' }
                  , { field: '加工车间代码', width: 150, title: '加工车间代码' }
                  , { field: '加工车间', width: 150, title: '加工车间' }
                  , { field: '班组代码', width: 150, title: '班组代码' }
                  , { field: '班组', width: 150, title: '班组' }
                  , { field: '操作工代码', width: 150, title: '操作工代码' }
                  , { field: '操作工', width: 150, title: '操作工' }
                  , { field: '生产资源代码', width: 150, title: '生产资源代码' }
                  , { field: '生产资源', width: 150, title: '生产资源' }
                  , { field: '计划数量', width: 150, title: '计划数量' }
                  , { field: '流转卡数量', width: 150, title: '流转卡数量' }
                  , { field: '时间单位', width: 150, title: '时间单位' }
                  , { field: '工序计划加工时间', width: 150, title: '工序计划加工时间' }
                  , { field: '子计划开工日期', width: 150, title: '子计划开工日期' }
                  , { field: '子计划完工日期', width: 150, title: '子计划完工日期' }
                  , { field: '实际开工日期', width: 150, title: '实际开工日期' }
                  , { field: '实际完工日期', width: 150, title: '实际完工日期' }
                  , { field: '开工余量天数', width: 150, title: '开工余量天数' }
                  , { field: '开工余量固数', width: 150, title: '开工余量固数' }
                  , { field: '上道固定天数', width: 150, title: '上道固定天数' }
                  , { field: '生产周期', width: 150, title: '生产周期' }
                  , { field: '加工单价', width: 150, title: '加工单价' }
                  , { field: '加工费用金额', width: 150, title: '加工费用金额' }
                  , { field: '末道工序', width: 150, title: '末道工序' }
                  , { field: '首道工序', width: 150, title: '首道工序' }
                  , { field: '下道流转工序', width: 150, title: '下道流转工序' }
                  , { field: '流转标记', width: 150, title: '流转标记' }
                  , { field: '委外标记', width: 150, title: '委外标记' }
                  , { field: '行关闭人', width: 150, title: '行关闭人' }
                  , { field: '关闭类型', width: 150, title: '关闭类型' }
                  , { field: '表体备注', width: 150, title: '表体备注' }
                  , { field: '制单人', width: 150, title: '制单人' }
                  , { field: '制单日期', width: 150, title: '制单日期' }
                  , { field: '审核人', width: 150, title: '审核人' }
                  , { field: '审核日期', width: 150, title: '审核日期' }
                  , { field: '修改人', width: 150, title: '修改人' }
                  , { field: '修改日期', width: 150, title: '修改日期' }
                  , { field: '关闭人', width: 150, title: '关闭人' }
                  , { field: '关闭日期', width: 150, title: '关闭日期' }
                  , { field: '作废人', width: 150, title: '作废人' }
                  , { field: '作废日期', width: 150, title: '作废日期' }
                  , { field: '拆分数量', width: 150, title: '拆分数量' }
                  , { field: '剩余数量', width: 150, title: '剩余数量' }
                  , { field: '不良品关联数量', width: 150, title: '不良品关联数量' }
                  , { field: '进站关联数量', width: 150, title: '进站关联数量' }
                  , { field: '出站关联数量', width: 150, title: '出站关联数量' }
                  , { field: '排序号', width: 150, title: '排序号' }
                  , { field: '源单主内码', width: 150, title: '源单主内码' }
                  , { field: '源单子内码', width: 150, title: '源单子内码' }
                  , { field: '源单单号', width: 150, title: '源单单号' }
                  , { field: '源单类型', width: 150, title: '源单类型' }
              ]]
                , data: []
                , cellMinWidth: 80 //全局定义常规单元格的最小宽度,layui 2.2.1 æ–°å¢ž
                , cols: [[
                    { type: 'check' }
                    , { field: 'hmainid', width: 150, title: 'hmainid', hide: true }
                    , { field: 'hicmointerid', width: 150, title: 'hicmointerid', hide: true }
                    , { field: 'HICMOEntryID', width: 150, title: 'HICMOEntryID', hide: true }
                    , { field: 'HWorkShopID', width: 150, title: 'HWorkShopID', hide: true }
                    , { field: 'HMaterID', width: 150, title: 'HMaterID', hide: true }
                    , { field: 'HUnitID', width: 150, title: 'HUnitID', hide: true }
                    , { field: 'HSupID', width: 150, title: 'HSupID', hide: true }
                    , { field: 'hsubid', width: 150, title: 'hsubid', hide: true }
                    , { field: 'HProcID', width: 150, title: 'HProcID', hide: true }
                    , { field: 'HCenterID', width: 150, title: 'HCenterID', hide: true }
                    , { field: 'HDeptID', width: 150, title: 'HDeptID', hide: true }
                    , { field: 'HGroupID', width: 150, title: 'HGroupID', hide: true }
                    , { field: 'HWorkerID', width: 150, title: 'HWorkerID', hide: true }
                    , { field: 'HSourceID', width: 150, title: 'HSourceID', hide: true }
                    , { field: 'HBillType', width: 150, title: 'HBillType', hide: true }
                    , { field: '日期', width: 150, title: '日期',templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>"}
                    , { field: '单据号', width: 170, title: '单据号' }
                    , { field: '工序', width: 140, title: '工序' }
                    , { field: '生产资源', width: 150, title: '生产资源' }
                    , { field: '工作中心', width: 150, title: '工作中心' }
                    , { field: '任务单号', width: 170, title: '任务单号' }
                    , { field: '生产车间', width: 150, title: '生产车间' }
                    , { field: '产品代码', width: 150, title: '产品代码' }
                    , { field: '产品', width: 150, title: '产品' }
                    , { field: '批号', width: 150, title: '批号' }
                    , { field: '生产订单号', width: 170, title: '生产订单号' }
                    , { field: '生产车间代码', width: 150, title: '生产车间代码' }
                    , { field: '规格型号', width: 150, title: '规格型号' }
                    , { field: '单位代码', width: 150, title: '单位代码' }
                    , { field: '单位', width: 150, title: '单位' }
                    , { field: '生产数量', width: 150, title: '生产数量' }
                    , { field: '任务单数量', width: 150, title: '任务单数量' }
                    , { field: '订单跟踪号', width: 150, title: '订单跟踪号' }
                    , { field: '计划开工日期', width: 150, title: '计划开工日期' }
                    , { field: '计划完工日期', width: 150, title: '计划完工日期' }
                    , { field: '摘要', width: 150, title: '摘要' }
                    , { field: '内部单据号', width: 150, title: '内部单据号' }
                    , { field: '委外订单内码', width: 150, title: '委外订单内码' }
                    , { field: '委外订单子内码', width: 150, title: '委外订单子内码' }
                    , { field: '委外订单号', width: 150, title: '委外订单号' }
                    , { field: '供应商代码', width: 150, title: '供应商代码' }
                    , { field: '供应商', width: 150, title: '供应商' }
                    , { field: '委外加工单位', width: 150, title: '委外加工单位' }
                    , { field: '表头备注', width: 150, title: '表头备注' }
                    , { field: '工序号', width: 150, title: '工序号' }
                    , { field: '工序代码', width: 150, title: '工序代码' }
                    , { field: '加工说明', width: 150, title: '加工说明' }
                    , { field: '工作中心代码', width: 150, title: '工作中心代码' }
                    , { field: '工作中心', width: 150, title: '工作中心' }
                    , { field: '加工车间代码', width: 150, title: '加工车间代码' }
                    , { field: '加工车间', width: 150, title: '加工车间' }
                    , { field: '班组代码', width: 150, title: '班组代码' }
                    , { field: '班组', width: 150, title: '班组' }
                    , { field: '操作工代码', width: 150, title: '操作工代码' }
                    , { field: '操作工', width: 150, title: '操作工' }
                    , { field: '生产资源代码', width: 150, title: '生产资源代码' }
                    , { field: '计划数量', width: 150, title: '计划数量' }
                    , { field: '流转卡数量', width: 150, title: '流转卡数量' }
                    , { field: '时间单位', width: 150, title: '时间单位' }
                    , { field: '工序计划加工时间', width: 150, title: '工序计划加工时间' }
                    , { field: '子计划开工日期', width: 150, title: '子计划开工日期' }
                    , { field: '子计划完工日期', width: 150, title: '子计划完工日期' }
                    , { field: '实际开工日期', width: 150, title: '实际开工日期' }
                    , { field: '实际完工日期', width: 150, title: '实际完工日期' }
                    , { field: '开工余量天数', width: 150, title: '开工余量天数' }
                    , { field: '开工余量固数', width: 150, title: '开工余量固数' }
                    , { field: '上道固定天数', width: 150, title: '上道固定天数' }
                    , { field: '生产周期', width: 150, title: '生产周期' }
                    , { field: '加工单价', width: 150, title: '加工单价' }
                    , { field: '加工费用金额', width: 150, title: '加工费用金额' }
                    , { field: '末道工序', width: 150, title: '末道工序' }
                    , { field: '首道工序', width: 150, title: '首道工序' }
                    , { field: '下道流转工序', width: 150, title: '下道流转工序' }
                    , { field: '流转标记', width: 150, title: '流转标记' }
                    , { field: '委外标记', width: 150, title: '委外标记' }
                    , { field: '行关闭人', width: 150, title: '行关闭人' }
                    , { field: '关闭类型', width: 150, title: '关闭类型' }
                    , { field: '表体备注', width: 150, title: '表体备注' }
                    , { field: '制单人', width: 150, title: '制单人' }
                    , { field: '制单日期', width: 150, title: '制单日期' }
                    , { field: '审核人', width: 150, title: '审核人' }
                    , { field: '审核日期', width: 150, title: '审核日期' }
                    , { field: '修改人', width: 150, title: '修改人' }
                    , { field: '修改日期', width: 150, title: '修改日期' }
                    , { field: '关闭人', width: 150, title: '关闭人' }
                    , { field: '关闭日期', width: 150, title: '关闭日期' }
                    , { field: '作废人', width: 150, title: '作废人' }
                    , { field: '作废日期', width: 150, title: '作废日期' }
                    , { field: '拆分数量', width: 150, title: '拆分数量' }
                    , { field: '剩余数量', width: 150, title: '剩余数量' }
                    , { field: '不良品关联数量', width: 150, title: '不良品关联数量' }
                    , { field: '进站关联数量', width: 150, title: '进站关联数量' }
                    , { field: '出站关联数量', width: 150, title: '出站关联数量' }
                    , { field: '排序号', width: 150, title: '排序号' }
                    , { field: '源单主内码', width: 150, title: '源单主内码' }
                    , { field: '源单子内码', width: 150, title: '源单子内码' }
                    , { field: '源单单号', width: 150, title: '源单单号' }
                    , { field: '源单类型', width: 150, title: '源单类型' }
                ]]
                , page: true
                , limits: [50, 500, 5000, 50000]
                , limit: 50
            });
            ///加载显示数据
            function RoadQuery(Where) {
                var index = layer.load();
                var Value = Where;
                if (Value == null) {
                    Value = '';
            function RoadQuery(Value) {
                var index = layer.load();
                if (Value != "") {
                    sWhere = " and å•据号 like '%" + Value + "%' ";
                }
                if (HProcID != '' && HProcID != undefined && HProcID != 0) {
                    sWhere += ' and HProcID=' + HProcID
                }
                if (HSourceID != '' && HSourceID != undefined && HSourceID != 0) {
                    sWhere += ' and HSourceID=' + HSourceID + ''
                }
                if (HMaterID != '' && HMaterID != undefined && HMaterID != 0) {
                    sWhere += ' and HMaterID=' + HMaterID
                }
                $.ajax({
                    type: "get",
                    url: GetWEBURL() + "/Web/GetSc_ProcessExchangeBillListView",
                    async: true,
                    data: { "ICMOBill": Value, "OrganizationID": sessionStorage["OrganizationID"] },
                    //data: { "Value": Value },
                    data: { "sWhere": sWhere,  "OrganizationID": sessionStorage["OrganizationID"] },
                    success: function (result) {
                        if (result.count == 1) {
                            ajaxReturnData = JSON.parse(JSON.stringify(result)).data;