1
cwjbxqmz
2024-01-26 b742f00aac8e1e1bb628232383c35e67f4a41e4e
WebTM/views/Éú²ú¹¤Ðò¹ÜÀí/ίÍ⹤ÐòÅɹ¤µ¥/WW_EntrustProcSendWorkBillList.html
@@ -6,9 +6,10 @@
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
      <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/soulTable.slim.js"></script>
</head>
<body>
@@ -138,12 +139,13 @@
                        <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-Pushdown"><i class="layui-icon layui-icon-form"></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-Pushdown"><i class="layui-icon layui-icon-form"></i>下推委外汇报单</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-PushdownZC"><i class="layui-icon layui-icon-form"></i>下推委外转出单</button>
                        </div>
                    </script>
                </div>
@@ -206,13 +208,14 @@
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'code', 'table', 'element', 'layer'], function () {
        }).use(['index', 'form', 'laydate', 'code', 'table', 'element', 'layer','soulTable'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , laydate = layui.laydate
                , table = layui.table
                , form = layui.form
                , soulTable = layui.soulTable
                , element = layui.element;
            //常规用法
            laydate.render({
@@ -236,76 +239,69 @@
                // , where: { msg: "", NowPage: 1, OnePage: 10 }
                , cellMinWidth: 100
                , cols: [[
                    //{ checkbox: true, fixed: true }
                    { type: 'checkbox', fixed: 'left' }
                    , { field: 'hmainid', title: 'hmainid', sort: true, fixed: true, hide: true }
                    , { field: '日期', title: '日期', sort: true, width: 120 }
                    , { field: '单据号', title: '单据号', sort: true, width: 170 }
                    , { field: 'HDeptID ', title: 'HDeptID', width: 105 }
                    , { field: '部门代码', title: '部门代码' }
                    , { field: '部门', title: '部门' }
                    , { field: 'HMaterID', title: 'HMaterID' }
                    , { field: '物料代码', title: '物料代码' }
                    , { field: '物料名称', title: '物料名称', width: 115 }
                    , { field: '规格型号', title: '规格型号', width: 115 }
                    , { field: 'HUnitID', title: 'HUnitID' }
                    , { field: '计量单位代码', title: '计量单位代码', width: 160 }
                    , { field: '计量单位', title: '计量单位', width: 160 }
                    , { field: 'HSupID', title: 'HSupID', width: 160 }
                    , { field: '供应商代码', title: '供应商代码', width: 160 }
                    , { field: '供应商名称', title: '供应商名称', width: 160 }
                    , { field: 'HprocID ', title: 'HprocID', width: 215 }
                    ////, { field: 'hunitid', title: 'hunitid' }
                    , { field: '工序代码 ', title: '工序代码 ', width: 115 }
                    , { field: '工序', title: '工序' }
                    ////, { field: 'hempid', title: 'hempid' }
                    , { field: 'HGroupID   ', title: 'HGroupID', width: 100 }
                    , { field: '班组代码', title: '班组代码' }
                    , { field: '班组名称', title: '班组名称' }
                    , { field: 'HSourceID', title: 'HSourceID' }
                    , { field: '资源代码', title: '资源代码' }
                    ////, { field: 'HCenterID', title: 'HCenterID' }
                    , { field: '生产资源', title: '生产资源' }
                    , { field: 'HWorkerID ', title: 'HWorkerID' }
                    ////, { field: 'hbomid', title: 'hbomid' }
                    , { field: '职员代码', title: '职员代码' }
                    ////, { field: 'HRoutingInterID', title: 'HRoutingInterID' }
                    , { field: '职员   ', title: '职员' }
                    , { field: 'hsubid', title: 'hsubid', hide: true }
                    , { field: '数量', title: '数量' }
                    , { field: '计划开工日期', title: '计划开工日期' }
                    , { field: '计划完工日期', title: '计划完工日期' }
                    , { field: '计划工时', title: '计划工时' }
                    , { field: '表体备注', title: '表体备注' }
                    , { field: 'HICMOInterID', title: 'HICMOInterID ' }
                    , { field: '生产任务单号', title: '生产任务单号' }
                    , { field: 'HSeOrderInterID', title: 'HSeOrderInterID' }
                    , { field: '销售订单号', title: '销售订单号' }
                    ////, { field: 'hsubid', title: 'hsubid' }
                    , { 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: 'HBillType', title: 'HBillType' }
                    , { field: 'HQtyDecimal', title: 'HQtyDecimal' }
                    , { field: 'HPriceDecimal', title: 'HPriceDecimal' }
                    , { field: 'HDeptID ', title: 'HDeptID', width: 105, sort: true }
                    , { field: '部门代码', title: '部门代码', sort: true }
                    , { field: '部门', title: '部门', sort: true }
                    , { field: 'HMaterID', title: 'HMaterID', sort: true }
                    , { field: '物料代码', title: '物料代码', sort: true }
                    , { field: '物料名称', title: '物料名称', width: 115, sort: true }
                    , { field: '规格型号', title: '规格型号', width: 115, sort: true }
                    , { field: 'HUnitID', title: 'HUnitID', sort: true }
                    , { field: '计量单位代码', title: '计量单位代码', width: 160, sort: true }
                    , { field: '计量单位', title: '计量单位', width: 160, sort: true }
                    , { field: 'HSupID', title: 'HSupID', width: 160, sort: true }
                    , { field: '供应商代码', title: '供应商代码', width: 160, sort: true }
                    , { field: '供应商名称', title: '供应商名称', width: 160, sort: true }
                    , { field: 'HprocID ', title: 'HprocID', width: 215, sort: true }
                    , { field: '工序代码 ', title: '工序代码 ', width: 115, sort: true }
                    , { field: '工序', title: '工序', sort: true }
                    , { field: 'HGroupID   ', title: 'HGroupID', width: 100, sort: true }
                    , { field: '班组代码', title: '班组代码', sort: true }
                    , { field: '班组名称', title: '班组名称', sort: true }
                    , { field: 'HSourceID', title: 'HSourceID', sort: true }
                    , { field: '资源代码', title: '资源代码', sort: true }
                    , { field: '生产资源', title: '生产资源', sort: true }
                    , { field: 'HWorkerID ', title: 'HWorkerID', sort: true }
                    , { field: '职员代码', title: '职员代码', sort: true }
                    , { field: '职员   ', title: '职员', sort: true }
                    , { field: 'hsubid', title: 'hsubid', hide: true, sort: true }
                    , { field: '数量', title: '数量', sort: true }
                    , { field: '计划开工日期', title: '计划开工日期', sort: true }
                    , { field: '计划完工日期', title: '计划完工日期', sort: true }
                    , { field: '计划工时', title: '计划工时', sort: true }
                    , { field: '表体备注', title: '表体备注', sort: true }
                    , { field: 'HICMOInterID', title: 'HICMOInterID ', sort: true }
                    , { field: '生产任务单号', title: '生产任务单号', sort: true }
                    , { field: 'HSeOrderInterID', title: 'HSeOrderInterID', sort: true }
                    , { field: '销售订单号', title: '销售订单号', sort: true }
                    , { field: '表头备注', title: '表头备注', sort: true }
                    , { field: '制单人', title: '制单人', sort: true }
                    , { field: '制单日期', title: '制单日期', sort: true }
                    , { field: '审核人', title: '审核人', sort: true }
                    , { field: '审核日期', title: '审核日期', sort: true }
                    , { field: '修改人', title: '修改人 ', sort: true }
                    , { field: '修改日期', title: '修改日期', sort: true }
                    , { field: '关闭人', title: '关闭人', sort: true }
                    , { field: '关闭日期', title: '关闭日期', sort: true }
                    , { field: '作废人', title: '作废人', sort: true }
                    , { field: '作废日期', title: '作废日期', sort: true }
                    , { field: '源单主内码', title: '源单主内码', sort: true }
                    , { field: '源单子内码', title: '源单子内码', sort: true }
                    , { field: '源单单号', title: '源单单号', sort: true }
                    , { field: '源单类型', title: '源单类型', sort: true }
                    , { field: '行关闭人', title: '行关闭人', sort: true }
                    , { field: 'HBillType', title: 'HBillType', sort: true }
                    , { field: 'HQtyDecimal', title: 'HQtyDecimal', sort: true }
                    , { field: 'HPriceDecimal', title: 'HPriceDecimal', sort: true }
                ]]
                //, skin: 'row' //表格风格
                // , even: true
                , page: true //是否显示分页
                , limits: [10, 20, 50, 100]
                , limits: [50, 500, 5000, 20000]
                , limit: 50 //每页默认显示的数量
                //, height: 500
                , done: function (res, curr, count) {
@@ -350,147 +346,40 @@
                        }
                        break;
                    //case 'btn-getCheckData':
                    //    var data = checkStatus.data;
                    //    layer.alert(JSON.stringify(data));
                    //    break;
                    ////case 'getCheckLength':
                    ////    var data = checkStatus.data;
                    ////    layer.msg('选中了:' + data.length + ' ä¸ª');
                    ////    break;
                    ////case 'isAll':
                    ////    layer.msg(checkStatus.isAll ? '全选' : '未全选');
                    ////    break;
                    //自定义头工具栏右侧图标 - æç¤º
                    //case 'btn-reload':
                    //    _cur_page = $(".layui-laypage-em").next().html();
                    //    RoadHBillNo(sql);
                    //    break;
                    //case 'btn-confirm':
                    //    var checkStatus = table.checkStatus('mainTable')
                    //        , data = checkStatus.data;
                    //    _cur_page = $(".layui-laypage-em").next().html();
                    //    if (data[0]["状态"] == "未确认") {
                    //        layer.confirm('是否确认单据?', { icon: 3, title: '提示' }, function (index) {
                    //            $.ajax({
                    //                type: "get",
                    //                url: GetWEBURL() + "POOrderAccept",
                    //                data: { "HInterID": data[0]["hmainid"].toString(), "HBillNo": data[0]["单据号"].toString(), "HUser": sessionStorage["HUserName"] },
                    //                success: function (result) {
                    //                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                    //                        layer.msg(result.Message, { icon: 1 });
                    //                        RoadHBillNo(sql);
                    //                    }
                    //                    else {
                    //                        // $("#verifycode").click();
                    //                        layer.msg(result.Message, { icon: 5 });
                    //                    }
                    //                    layer.closeAll("loading");
                    //                }
                    //            })
                    case 'btn-PushdownZC':
                        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() + ',';
                    //            layer.close(index);
                    //        });
                        }
                    //    }
                    //    else {
                    //        layer.msg("必须是未确认单据才能进行确认操作!", { icon: 5 });
                    //    }
                    //    break;
                    //case 'btn-back':
                    //    var checkStatus = table.checkStatus('mainTable')
                    //        , data = checkStatus.data;
                    //    _cur_page = $(".layui-laypage-em").next().html();
                    //    var HBackRemark;
                    //    if (data[0]["状态"] == "未确认") {
                        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: ['../委外工序计划转出单/WW_Add_EntrustProcessSendOutBill.html?HInterID=' + data[0].hmainid.toString() + '&lentryid=' + rows.toString().substring(0, rows.length - 1), 'yes']
                                , resize: false
                                , cancel: function () {
                                    //$(".layui-btn").removeClass("layui-btn-disabled");
                                }
                    //        layer.prompt({
                    //            formType: 2,
                    //            //value: '',
                    //            title: '请输入驳回理由',
                    //            area: ['400px', '200px'] //自定义文本域宽高
                    //        }, function (value, index, elem) {
                    //            HBackRemark = value.toString();
                    //            $.ajax({
                    //                type: "get",
                    //                url: GetWEBURL() + "POOrderRefuse",
                    //                data: { "HInterID": data[0]["hmainid"].toString(), "HBillNo": data[0]["单据号"].toString(), "HUser": sessionStorage["HUserName"], "HBackRemark": HBackRemark },
                    //                success: function (result) {
                    //                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                    //                        layer.msg("拒绝成功!", { icon: 1 });
                    //                        RoadHBillNo(sql);
                    //                    }
                    //                    else {
                    //                        // $("#verifycode").click();
                    //                        layer.msg(result.Message, { icon: 5 });
                    //                    }
                    //                    layer.closeAll("loading");
                    //                }
                    //            })
                    //            //alert(value); //得到value
                    //            layer.close(index);
                    //        });
                            });
                    //    }
                    //    else {
                    //        layer.msg("必须是未确认单据才能进行驳回操作!", { icon: 5 });
                    //    }
                    //    break;
                    //case 'btn-details':
                    //    var checkStatus = table.checkStatus('mainTable')
                    //        , data = checkStatus.data;
                    //    var linterid = data[0].hmainid.toString();
                    //    //if (AllowLoadData(sSubStr) != false) {//非空验证
                    //    layer.open({
                    //        type: 2
                    //        , area: ['100%', '100%']
                    //        , title: '采购订单'
                    //        , shade: 0.6 //遮罩透明度
                    //        , maxmin: true //允许全屏最小化
                    //        , anim: 0 //0-6的动画形式,-1不开启
                    //        , content: '../../../src/views/SRM/SRM_POOrderBill.html?linterid=' + linterid
                    //        , resize: false
                    //        , cancel: function () {
                    //            //$(".layui-btn").removeClass("layui-btn-disabled");
                    //        }
                    //    })
                    //    break;
                    //case 'btn-generate':
                    //    var checkStatus = table.checkStatus('mainTable')
                    //        , data = checkStatus.data;
                    //    ajaxLabelData = data;
                    //    var rows = '';
                    //    var HEntry = '';
                    //    for (var i = 0; i < data.length; i++) {
                    //        if (data[i]["状态"] == "已确认") {
                    //            rows += data[i].hmainid.toString() + ',' + data[i].hsubid.toString() + ';';
                    //        }
                    //        else {
                    //            HEntry += (i + 1) + ',';
                    //        }
                    //    }
                    //    if (HEntry != '') {
                    //        HEntry = HEntry.substring(0, HEntry.length - 1);
                    //        layer.msg("第" + HEntry + "行未确认!", { icon: 5 });
                    //    }
                    //    else {
                    //        layer.open({
                    //            type: 2
                    //            , area: ['100%', '100%']
                    //            , title: '送货单'
                    //            , shade: 0.6 //遮罩透明度
                    //            , maxmin: false //允许全屏最小化
                    //            , anim: 0 //0-6的动画形式,-1不开启
                    //            , content: ['../../views/SRM/SRM_POInStockBill_Edit.html?linterid=' + data[0].hmainid.toString() + '&lentryid=' + rows.toString() + '&lSourceBillType=1102', 'yes']
                    //            , resize: false
                    //            //, cancel: function () {
                    //            //    $(".layui-btn").removeClass("layui-btn-disabled");
                    //            //}
                    //        })
                    //    }
                    //    break;
                        }
                        break;
                    case 'btn-exit':
                        //var index = parent.layer.getFrameIndex(window.name);
                        //element.tabDelete('layadmin-layout-tabs', this);
@@ -509,7 +398,7 @@
                    type: "get",
                    url: GetWEBURL() + "/Sc_ProcessMangement/MES_WW_EntrustProcSendWorkBill_Json",
                    async: true,
                    data: { "sqlWhere": sqlWhere },//"HSupNo": sessionStorage["HUserName"],
                    data: { "sqlWhere": sqlWhere, "user": sessionStorage["HUserName"] },//"HSupNo": sessionStorage["HUserName"],
                    success: function (result) {
                        if (result.count == 1) {
                            ajaxReturnData = JSON.parse(JSON.stringify(result)).data;
@@ -521,7 +410,7 @@
                            }
                            , loading: false
                            , done: function (index, res) {
                                soulTable.render(this);
                            }
                        });
                        } else {