ch
2021-04-08 2edb37abd1e6f18289d846d23e3c18bd66a2539b
WebTM/views/Éú²ú¹¤Ðò¹ÜÀí/¹¤Ðò¼Æ»®µ¥/Sc_ProcessPlanList.html
@@ -66,12 +66,9 @@
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-getCheckData"><i class="layui-icon layui-icon-tips"></i>预览</button>-->
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-reload"><i class="layui-icon layui-icon-refresh"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-confirm" id="btn_confirm"><i class="layui-icon layui-icon-ok-circle"></i>确认</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-back" id="btn_back"><i class="layui-icon layui-icon-close-fill"></i>驳回</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-details"><i class="layui-icon layui-icon-form"></i>详情</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-generate"><i class="layui-icon layui-icon-file"></i>生成送货单</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>退出</button>
                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-reload"><i class="layui-icon layui-icon-refresh"></i>刷新</button>-->
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Pushdown"><i class="layui-icon layui-icon-form"></i>下推</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="add"><i class="layui-icon">&#xe608;</i>添加</button>
                            </div>
                        </script>
@@ -80,6 +77,11 @@
            </div>
        </div>
    </div>
    <script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
@@ -103,69 +105,184 @@
            var option = {
                elem: '#mainTable'
                //, toolbar: '#toolbarDemo'
                , toolbar: '#toolbarDemo'
                ,height: 'full-50' 
                , page: true
                ,cellMinWidth: 90
                , cols: [[
                    { type: 'checkbox' }
                    //{ field: 'hmainid', title: 'hmainid', sort: true, width: 165 }
                    { field: 'HDate', title: '日期', sort: true, width: 120 }
                    , { field: 'HBillNo', title: '单据号', sort: true, width: 170 }
                     , { field: 'hmainid', title: 'hmainid', sort: true, fixed: true, hide: true }
                    ,{ field: '日期', title: '日期', sort: true, width: 120 }
                    , { field: '单据号', title: '单据号', sort: true, width: 170 }
                    //, { field: 'HBillStatus ', title: '单据状态', width: 105 }
                    , { field: 'HICMOBillNo', title: '任务单号' }
                    , { field: 'HMaterID', title: 'HMaterID' }
                    ////, { field: 'hunitid', title: 'hunitid' }
                    , { field: 'HMaterID ', title: '产品ID ', width: 115 }
                    , { field: 'HMaterNumber', title: '产品代码' }
                    , { field: '物料代码 ', title: '物料代码 ', width: 115 }
                    , { field: '物料名称', title: '物料名称' }
                    ////, { field: 'hempid', title: 'hempid' }
                    , { field: 'HUnitID', title: '单位ID', width: 100 }
                    , { field: '规格型号', title: '规格型号', width: 100 }
                    , { field: 'HUnitNumber', title: '单位代码' }
                    , { field: 'HPlanQty', title: '生产数量' }
                    , { field: 'HPlanBeginDate', title: '计划开工日期' }
                    , { field: 'HPlanEndDate', title: '计划完工日期' }
                    , { field: '单位', title: '单位' }
                    , { field: 'hunitid', title: 'hunitid' }
                    , { field: '计量单位代码', title: '计量单位代码' }
                    ////, { field: 'HCenterID', title: 'HCenterID' }
                    , { field: 'HExplanation', title: '摘要' }
                    , { field: 'HRemark ', title: '备注' }
                    , { field: '计量单位', title: '计量单位' }
                    , { field: '生产数量 ', title: '生产数量' }
                    ////, { field: 'hbomid', title: 'hbomid' }
                    , { field: 'HInnerBillNo', title: '内部单据号' }
                    , { field: 'HSupID', title: '委外加工单位' }
                    , { field: 'HMarker', title: '检验人' }
                    , { field: 'HBacker', title: '退回人' }
                    , { field: 'HBackDate', title: '退回日期' }
                    , { field: 'HChecker', title: '审核人' }
                    , { field: 'HCheckDate', title: '审核日期' }
                    , { field: 'HMaker', title: '制单人' }
                    , { field: 'HMakeDate', title: '制单日期' }
                    , { field: 'HUpDater', title: '修改人' }
                    , { field: 'HUpDateDate', title: '修改日期' }
                    , { field: 'HCloseMan', title: '关闭人' }
                    , { field: 'HCloseDate', title: '关闭日期' }
                    , { field: 'HCloseType', title: '关闭类型' }
                    , { field: '计划开工日期', title: '计划开工日期' }
                    , { field: '计划完工日期', title: '计划完工日期' }
                    , { field: '摘要', title: '摘要' }
                    , { field: '表头备注', title: '表头备注' }
                    , { field: '内部单据号', title: '内部单据号' }
                    , { field: 'hicmointerid', title: 'hicmointerid' }
                    , { field: '任务单号', title: '任务单号' }
                    , { field: '制单人', title: '制单人' }
                    , { field: '制单日期', title: '制单日期' }
                    , { field: '审核人', title: '审核人' }
                    , { field: '审核日期', title: '审核日期' }
                    , { field: '修改人', title: '修改人' }
                    , { field: '修改日期', title: '修改日期' }
                    , { field: '关闭人', title: '关闭人' }
                    ////, { field: 'hsubid', title: 'hsubid' }
                    , { field: 'HDeleteMan', title: '作废人' }
                    , { field: 'HDeleteDate', title: '作废日期' }
                    //, { field: '源单子内码', title: '源单子内码' }
                    //, { field: '制单人', title: '制单人' }
                    //, { field: '制单日期', title: '制单日期' }
                    //, { field: '审核人', title: '审核人' }
                    //, { field: '审核日期', title: '审核日期' }
                    //, { field: '修改人', title: '修改人' }
                    //, { field: '修改日期', title: '修改日期' }
                    //, { field: '关闭人', title: '关闭人' }
                    //, { field: '关闭日期', title: '关闭日期' }
                    //, { field: '作废人', title: '作废人' }
                    //, { field: '作废日期', title: '作废日期' }
                    //, { field: '行关闭人', title: '行关闭人' }
                    //, { field: '关闭类型', title: '关闭类型' }
                    //, { field: '单据类型', title: '单据类型' }
                    //, { field: '计划跟踪号', title: '计划跟踪号' }
                    , { field: '关闭日期', title: '关闭日期' }
                    , { field: '关闭类型', title: '关闭类型' }
                    , { field: '作废人', title: '作废人' }
                    , { field: '作废日期', title: '作废日期' }
                    , { field: 'hsubid', title: 'hsubid'  , fixed: true, hide: true}
                    , { field: '工序计划单号', title: '工序计划单号' }
                    , { field: '工序号', title: '工序号' }
                    , { field: 'hprocid', title: 'hprocid' }
                    , { field: '工序代码', title: '工序代码' }
                    , { field: '工序', title: '工序' }
                    , { field: '加工说明', title: '加工说明' }
                    , { field: '开工固天', title: '开工固天' }
                    , { field: '开工固数', title: '开工固数' }
                    , { field: 'HCenterID', title: 'HCenterID' }
                    , { field: '工作中心代码', title: '工作中心代码' }
                    , { field: '工作中心', title: '工作中心' }
                    , { field: 'HDeptID', title: 'HDeptID' }
                    , { field: '加工车间代码', title: '加工车间代码' }
                    , { field: '加工车间', title: '加工车间' }
                    , { field: 'HGroupID', title: 'HGroupID' }
                    , { field: '班组代码', title: '班组代码' }
                    , { field: '班组名称', title: '班组名称' }
                    , { field: 'HWorkerID', title: 'HWorkerID' }
                    , { field: '操作员代码', title: '操作员代码' }
                    , { field: '操作员', title: '操作员' }
                    , { field: 'HSourceID', title: 'HSourceID' }
                    , { field: '资源代码', title: '资源代码' }
                    , { field: '生产资源', title: '生产资源' }
                    , { field: '计划数量', title: '计划数量' }
                    , { field: '关联数量', title: '关联数量' }
                    , { field: '时间单位', title: '时间单位' }
                    , { field: '计划加工时间', title: '计划加工时间' }
                    , { field: '工序计划开工日期', title: '工序计划开工日期' }
                    , { field: '工序计划完工日期', title: '工序计划完工日期' }
                    , { field: '准备时间', title: '准备时间' }
                    , { field: '排队时间', title: '排队时间' }
                    , { field: '转移时间', title: '转移时间' }
                    , { field: '表体备注', title: '表体备注' }
                    , { field: '批次', title: '批次' }
                    , { field: '源单主内码', title: '源单主内码' }
                    , { field: '源单子内码', title: '源单子内码' }
                    , { field: '源单单号', title: '源单单号' }
                    , { field: '源单类型', title: '源单类型' }
                    , { field: '销售订单主ID', title: '销售订单主ID' }
                    , { field: '销售订单子ID', title: '销售订单子ID' }
                    , { field: '销售订单号', title: '销售订单号' }
                    , { field: 'HBillType', title: 'HBillType' }
                    , { field: '单据类型', title: '单据类型' }
                    , { field: 'HBillSubType', title: 'HBillSubType' }
                    , { field: 'HQtyDecimal', title: 'HQtyDecimal' }
                    , { field: 'HPriceDecimal', title: 'HPriceDecimal' }
                     //,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:150}
                ]]
            };
//监听行工具事件
  //table.on('tool(mainTable)', function(obj){
  //  var data = obj.data;
  //  //console.log(obj)
  //  if(obj.event == 'del'){
  //    layer.confirm('真的删除行么', function(index){
  //      obj.del();
  //      layer.close(index);
  //    });
  //  } else if(obj.event == 'edit'){
  //    layer.prompt({
  //      formType: 2
  //      ,value: data.HDate
  //    }, function(value, index){
  //      obj.update({
  //        HDate: value
  //      });
  //      layer.close(index);
  //      });
  //      //layer.alert('我是编辑上');
  //  }
  //});
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                    case 'btn-Pushdown':
                        var checkStatus = table.checkStatus('mainTable')
                        , data = checkStatus.data;
                        ajaxLabelData = data;
                        var rows = '';
                        var HEntry = '';
                          for (var i = 0; i < data.length; i++) {
                                rows += data[i].hmainid.toString() + ',' ;
                        }
                        if (checkStatus.data.length < 1)
                        {
                            layer.msg('请选择一行数据下推');
                        } else
                        {
            //页面层
            layer.open({
                           type: 2 //Page层类型
                           ,area: ['100%', '100%']
                           ,title: '新增派工单'
                           ,shade: 0.6 //遮罩透明度
                           ,maxmin: false //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../工序派工单/Sc_Add_ProcessSendWork.html?HInterID=' + data[0].hmainid.toString() + '&lentryid=' + rows.toString().substring(0, rows.length - 1), '&PlanBeginDate=' + data[0].计划开工日期.toString(), '&PlanEndDate=' + data[0].计划完工日期.toString(), 'yes']
                               , resize: false
                             , cancel: function () {
                                //$(".layui-btn").removeClass("layui-btn-disabled");
                            }
                       });
                        }
                        break;
                    case 'add':
                        var date = new Date();
                        var day = date.getDate();
                        var month = date.getMonth() + 1;
                        var year = date.getFullYear();
                        var shijian = year + "/" + month + "/" + day;
                        layer.msg(shijian);
                        break;
                    case '':
                        layer.msg('');
                        break;
                };
            });
            //进入页面显示的缓存列表
            var index0 = layer.load(0, { shade: false });
            $.ajax({
                //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                url: GetWEBURL() + '/LEMS/MES_Sc_ProcessPlanMain_Json',
                url: GetWEBURL() + '/Sc_ProcessMangement/MES_Sc_ProcessPlanMain_Json',
                type: "GET",
                data: { "sWhere": sWhere },
                success: function (data1) {
@@ -212,7 +329,7 @@
                }
                var index = layer.load(0, { shade: false });
                $.ajax({
                    url: GetWEBURL() + '/LEMS/MES_Sc_ProcessPlanMain_Json',
                    url: GetWEBURL() + '/Sc_ProcessMangement/MES_Sc_ProcessPlanMain_Json',
                    type: "GET",
                    data: { "sWhere": sWhere },
                    success: function (data1) {