PDA添加报工平台,开工停工产量汇报完工功能,欠料报表汇总和明细修改
8个文件已添加
5个文件已修改
6356 ■■■■■ 已修改文件
WebTM/WebTM.csproj 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/index_Mobile.html 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/报工平台_PDA/IpadIndex_PDA.html 1453 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/报工平台_PDA/IpadSourceIndex_PDA.html 488 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/报工平台_PDA/LineBind_PDA.html 253 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/报工平台_PDA/产量汇报/Sc_Add_ProductReportBillList_PDA.html 933 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/报工平台_PDA/产量汇报/Sc_ProductReportBillList_PDA.html 555 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/报工平台_PDA/停工/Sc_Add_MESStopWorkBillList_PDA.html 900 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/报工平台_PDA/完工/Sc_Add_MESEndWorkBillList_PDA.html 840 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/报工平台_PDA/开工/Sc_Add_MESBeginWorkBillList_PDA.html 840 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/报工平台功能页/Gy_ButtonList.html 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/欠料运算/JIT_MaterialLevelShorAnalysisDetailReport.html 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/欠料运算/JIT_MaterialLevelShorAnalysisReport.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/WebTM.csproj
@@ -572,6 +572,13 @@
    <Content Include="views\生产管理\异常反馈单\Sc_MESExecptFeedBackBillType.html" />
    <Content Include="views\生产管理\报工台工序\开工\Sc_SwipeCardStart.html" />
    <Content Include="views\生产管理\报工台工序\微瑕品记录单\Sc_SubtleFlawBillList.html" />
    <Content Include="views\生产管理\报工平台_PDA\IpadIndex_PDA.html" />
    <Content Include="views\生产管理\报工平台_PDA\IpadSourceIndex_PDA.html" />
    <Content Include="views\生产管理\报工平台_PDA\LineBind_PDA.html" />
    <Content Include="views\生产管理\报工平台_PDA\产量汇报\Sc_ProductReportBillList_PDA.html" />
    <Content Include="views\生产管理\报工平台_PDA\产量汇报\Sc_Add_ProductReportBillList_PDA.html" />
    <Content Include="views\生产管理\报工平台_PDA\完工\Sc_Add_MESEndWorkBillList_PDA.html" />
    <Content Include="views\生产管理\报工平台_PDA\开工\Sc_Add_MESBeginWorkBillList_PDA.html" />
    <Content Include="views\生产管理\报工平台功能页\Gy_ButtonList.html" />
    <Content Include="views\生产管理\报工平台功能页\LineBind_Button.html" />
    <Content Include="views\生产管理\欠料运算\JIT_MaterialLevelShorAnalysis.html" />
@@ -582,6 +589,7 @@
    <Content Include="views\生产管理\班次开班单\Sc_ShiftsBeginInfoBill_Add_Edit.html" />
    <Content Include="views\生产管理\提料计划\JIT_PickUpCalculate.html" />
    <Content Include="views\生产管理\生产任务单\Sc_ICMOBillOrProcessExchangeResumeList.html" />
    <Content Include="views\生产管理\报工平台_PDA\停工\Sc_Add_MESStopWorkBillList_PDA.html" />
    <Content Include="views\生产管理\生产开工单\Sc_MESBeginWorkBillList_PDA.html" />
    <Content Include="views\生产管理\生产报表\SC_BOMReport.html" />
    <Content Include="views\生产管理\生产报表\Sc_ProductionInProgressReport.html" />
WebTM/views/index_Mobile.html
@@ -188,6 +188,24 @@
                                        å¼€å·¥å•
                                    </a>
                                </dd>
                                <dd>
                                    <a href="生产管理/报工平台_PDA/IpadSourceIndex_PDA.html" target="main_self_frame" style="color: aqua;">
                                        <img src="../layuiadmin/myicon/单据录制.svg" alt="单据录制" style="width:25px;height:25px;margin-right: 5px;" />
                                        è®¾å¤‡è¿è¡ŒçŠ¶æ€æŸ¥è¯¢
                                    </a>
                                </dd>
                                <dd>
                                    <a href="生产管理/报工平台_PDA/产量汇报/Sc_ProductReportBillList_PDA.html" target="main_self_frame" style="color: aqua;">
                                        <img src="../layuiadmin/myicon/单据录制.svg" alt="单据录制" style="width:25px;height:25px;margin-right: 5px;" />
                                        äº§é‡æ±‡æŠ¥åˆ—表
                                    </a>
                                </dd>
                                <!--<dd>
        <a href="生产管理/生产停工单/Sc_Add_MESStopWorkBillList_PDA.html" target="main_self_frame" style="color: aqua;">
            <img src="../layuiadmin/myicon/单据录制.svg" alt="单据录制" style="width:25px;height:25px;margin-right: 5px;" />
            åœå·¥å•
        </a>
    </dd>-->
                                <dd>
                                    <a href="车间管理/工序流转/MES_StationOutBillList_PDA_QiaoYi.html?type=czd" target="main_self_frame" style="color: aqua;">
                                        <img src="../layuiadmin/myicon/单据录制.svg" alt="单据录制" style="width:25px;height:25px;margin-right: 5px;" />
WebTM/views/Éú²ú¹ÜÀí/±¨¹¤Æ½Ì¨_PDA/IpadIndex_PDA.html
New file
@@ -0,0 +1,1453 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>报工平台</title>
    <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, maximum-scale=1">
    <!--引用layui样式文件-->
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <link href="../../../layuiadmin/layui/css/global.css" rel="stylesheet" />
    <!--自定义样式-->
    <link href="../../../layuiadmin/layui/css/ReportPlatform.css" rel="stylesheet" />
    <!--引用layui js文件-->
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/echarts.min.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
</head>
<body>
    <!-- è®©IE8/9支持媒体查询,从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <div style="margin: 20px 20px;">
        <!--<blockquote class="layui-elem-quote">注意:下述演示中的颜色只是做一个区分作用,并非栅格内置。</blockquote>-->
        <div class="layui-row layui-col-space10">
            <div class="layui-col-sm12 layui-col-md8">
                <div class="layui-tab layui-tab-card" lay-filter="TabTest">
                    <ul class="layui-tab-title">
                        <li class="layui-this">工单列表</li>
                    </ul>
                    <div class="layui-tab-content content3">
                        <div class="layui-tab-item layui-show">
                            <div class="layui-row layui-col-space10" id="btomleft" style="height:600px;display:block;overflow-y:auto;">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-col-sm12 layui-col-md4">
                <fieldset style="border: 1px solid #eee;box-shadow: 0 2px 5px 0 rgb(0 0 0 / 10%);">
                    <legend style="color: #5FB878">操作台</legend>
                    <div class="content4">
                        <!--<div class="layui-row layui-col-space10">
                            <div class="layui-col-sm12 layui-col-md4" onclick="OpenWork(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-play imgicon"></span>
                                    <span class="imgtitle">开工</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="OpenReport(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-list imgicon"></span>
                                    <span class="imgtitle">汇报</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="OpenEnd(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-logout imgicon"></span>
                                    <span class="imgtitle">完工</span>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row layui-col-space10" style="display:none;">
                            <div class="layui-col-sm12 layui-col-md4" onclick="KSOpenWork(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-pause imgicon"></span>
                                    <span class="imgtitle">快速开工</span>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row layui-col-space10">
                            <div class="layui-col-sm12 layui-col-md4" onclick="SOP(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-read imgicon"></span>
                                    <span class="imgtitle">作业指导书</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="OpenFistCheck(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-search imgicon"></span>
                                    <span class="imgtitle">首检</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="OpenProcess(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-search imgicon"></span>
                                    <span class="imgtitle">巡检</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="ProcessCheck(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-search imgicon"></span>
                                    <span class="imgtitle">末检</span>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row layui-col-space10">
                            <div class="layui-col-sm12 layui-col-md4" onclick="OpenInSpection(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-release imgicon"></span>
                                    <span class="imgtitle">报检申请</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="OpenMaterToSource(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-engine imgicon"></span>
                                    <span class="imgtitle">上料防错</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="BadGather(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-chart imgicon"></span>
                                    <span class="imgtitle">不良采集</span>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row layui-col-space10">
                            <div class="layui-col-sm12 layui-col-md4" onclick="OpenStop(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-pause imgicon"></span>
                                    <span class="imgtitle">停工</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="Abnormal(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-unlink imgicon"></span>
                                    <span class="imgtitle">异常申请</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="Esc(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-close imgicon"></span>
                                    <span class="imgtitle">退出</span>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row layui-col-space10">
                            <div class="layui-col-sm12 layui-col-md4" onclick="CurrentStatus(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-console imgicon"></span>
                                    <span class="imgtitle">当前状态</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="CodingReport(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-console imgicon"></span>
                                    <span class="imgtitle">当前工单(汇报)</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="BeginDotCheck(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-search imgicon"></span>
                                    <span class="imgtitle">设备启动点检</span>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row layui-col-space10">
                            <div class="layui-col-sm12 layui-col-md4" onclick="PreventErrMouldCheck(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-engine imgicon"></span>
                                    <span class="imgtitle">防错验证</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="TakeSample(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-form imgicon"></span>
                                    <span class="imgtitle">检验取样</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="TechParam(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-tabs imgicon"></span>
                                    <span class="imgtitle">工艺参数点检</span>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row layui-col-space10">
                            <div class="layui-col-sm12 layui-col-md4" onclick="SingErrMsg(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-layer imgicon"></span>
                                    <span class="imgtitle">异常签到处理</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="ErrMsgBackCheck(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-layer imgicon"></span>
                                    <span class="imgtitle">异常验收</span>
                                </div>
                            </div>
                            <div class="layui-col-sm12 layui-col-md4" onclick="SubtleFlaw(event,this)">
                                <div class="cnt bottomright">
                                    <span class="layui-icon layui-icon-log imgicon"></span>
                                    <span class="imgtitle">微瑕品汇报</span>
                                </div>
                            </div>
                        </div>-->
                        <!--数据插入动态按钮SQL,然后此页面写点击事件即可,网页绑定新按钮即可使用-->
                        <!--insert into Gy_BGButtons (HNumber,HName,HIcno,HOnclick,HSize,HOrder) values ('按钮代码','按钮名字','按钮图标','按钮点击事件','按钮默认大小,默认是中(大,中,小)','按钮默认排序 é»˜è®¤0')-->
                        <div class="layui-row layui-col-space10" id="button-container">
                        </div>
                    </div>
                </fieldset>
            </div>
        </div>
    </div>
    <script>
        var wktag = 0;
        var workcode = "";          //工单号
        var HDeptID = "";          //车间ID
        var HDept = "";            //车间
        var HSourceID = "";        //生产资源ID
        var HSourceName = "";      //生产资源
        var HSourceID1 = "";        //生产资源ID1
        var HSourceName1 = "";      //生产资源1
        var HSourceInterID = "";   //源单主内码
        var HProcExchInterID = "";   //流转卡id
        var HSourceEntryID = "";   //源单子内码
        var HSourceBillNo = "";    //源单单号
        var HSourceBillType = "";  //源单类型
        var HICMOInterID = "";     //生产订单主内码
        var HICMOEntryID = "";     //生产订单子内码
        var HICMOBillNo = "";      //任务单号
        var HMaterName = "";      //产品名称
        var HMaterID = 0;          //产品ID
        var HProQty = [];       //时间点产量
        var HBadQty = [];       //不良数量
        var HBadReason = [];       //不良原因
        var HEmpName = "";      //操作员
        var HManagerName = "";      //负责人
        var HGroupName = "";      //班组
        var HProcID = 0;      //工序
        var HSBName = "";   //设备名称
        //注意:选项卡 ä¾èµ– element æ¨¡å—,否则无法进行功能性操作
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , laydate = layui.laydate
                , element = layui.element;
            var params = get_UrlVars();
            var OperationType = 0;
            var linterid = 0;
            if (typeof (params[params[0]]) == "undefined") {
                parent.location.href = "../../../views/index_Mobile.html";
            } else {
                OperationType = params[params[0]];//操作类型
                linterid = params[params[1]];//源单id
            }
            fetchButtonsData();
            fetchListData(linterid);
        });
        var HManagerID = 0;
        var HGroupID = 0;
        //加载当前用户按钮
        function fetchButtonsData() {
            $.ajax({
                url: GetWEBURL() + '/ReportPlatForm/getButtonlist',
                type: "GET",
                data: { "user": sessionStorage["HUserName"] },
                success: function (data1) {
                    if (data1.data && data1.data.length > 0) {
                        // æ¸…空现有内容
                        $("#button-container").empty();
                        var colClass = ''; // åŠ¨æ€è®¾ç½®åˆ—çš„æ ·å¼
                        let largestColClass = 'layui-col-xs4';  // é»˜è®¤æ–°å¢žæŒ‰é’®å¤§å°ï¼ˆå‡è®¾æœ€å¤šæ˜¯ 3 ä¸ªæŒ‰é’®ä¸€æŽ’)
                        // éåŽ†æ¯ä¸ªæŒ‰é’®æ•°æ®å¹¶ç”Ÿæˆå¯¹åº”çš„ HTML
                        data1.data.forEach(function (buttonData, index) {
                            // æ ¹æ® defaultSize å­—段选择合适的列宽
                            switch (buttonData.按钮大小) {
                                case '小':
                                    colClass = 'layui-col-xs4'; // ä¸€æŽ’4个
                                    break;
                                case '中':
                                    colClass = 'layui-col-xs4'; // ä¸€æŽ’3个
                                    break;
                                case '大':
                                    colClass = 'layui-col-xs6'; // ä¸€æŽ’2个
                                    break;
                                default:
                                    colClass = 'layui-col-md4'; // é»˜è®¤è®¾ç½®ä¸ºä¸­ç­‰å¤§å°ï¼ˆ3个一排)
                            }
                            // æ›´æ–°æœ€å¤§åˆ—宽:取最大列宽
                            if (colClass === 'layui-col-md6') {
                                largestColClass = colClass; // å¦‚果当前列宽是 'layui-col-md6',说明是最宽的
                            } else if (colClass === 'layui-col-md4' && largestColClass !== 'layui-col-md6') {
                                largestColClass = colClass; // é»˜è®¤åˆ—宽为 'layui-col-md4',小于 'layui-col-md6'
                            } else if (colClass === 'layui-col-md3' && largestColClass === 'layui-col-md4') {
                                largestColClass = colClass; // å¦‚果当前列宽是 'layui-col-md3',小于 'layui-col-md4'
                            }
                            var html = '';
                            html += '<div class="' + colClass + '" id="btn' + index + '">';
                            html += '    <div class="cnt bottomright" id="button' + index + '" onclick="' + buttonData.事件名称 + '(event, this)">';
                            html += '        <span class="layui-icon ' + buttonData.图标 + ' imgicon"></span>';
                            html += '        <span class="imgtitle">' + buttonData.名称 + '</span>';
                            html += '    </div>';
                            html += '    <span class="layui-icon layui-icon-delete delete" onclick="deleteButton(event, \'' + buttonData.HItemID + '\')"></span>'; // ä¿®æ”¹åˆ é™¤æŒ‰é’®äº‹ä»¶ï¼Œä¼ é€’ id1 å’Œ id2
                            html += '</div>';
                            // å°†ç”Ÿæˆçš„ HTML è¿½åŠ åˆ° #button-container
                            $("#button-container").append(html);
                        });
                        // æ·»åŠ ä¸€ä¸ªæ–°å¢žæŒ‰é’®
                        var html1 = '';
                        html1 += '<div class="layui-col-sm12 ' + largestColClass + '">';
                        html1 += '    <div class="cnt bottomright">';
                        html1 += '        <span class="layui-icon layui-icon-addition imgtitle" onclick="Add_Buttton(event,this,1)"></span>';
                        html1 += '    </div>';
                        html1 += '</div>';
                        $("#button-container").append(html1);
                    } else {
                        // å¦‚果没有按钮数据,展示默认的空白新增按钮
                        var html1 = '';
                        html1 += '<div class="layui-col-sm12 layui-col-xs4">';
                        html1 += '    <div class="cnt bottomright">';
                        html1 += '        <span class="layui-icon layui-icon-addition imgtitle" onclick="Add_Buttton(event,this,1)"></span>';
                        html1 += '    </div>';
                        html1 += '</div>';
                        $("#button-container").append(html1);
                    }
                },
                error: function (error) {
                    console.log('获取按钮数据失败', error);
                }
            });
        }
        //加载工单列表
        //选中资源
        function fetchListData(HSourceID) {
            if (HSourceID != "0" && HSourceID != null && HSourceID!="") {
                $('.ctop').removeClass('check');  //删除不同父级clss样式相同的所有元素
                //执行联动事件
                $.ajax({
                    url: GetWEBURL() + "/ReportPlatForm/SearchGetWorkBillList",
                    type: "GET",
                    data: { "HSourceID": HSourceID },
                    dataType: "json",//数据类型可以为 text xml json  script  jsonp
                    success: function (data) {
                        var LoadData1 = data.data.h_p_JIT_GetWorkBillListInfoBySource;
                        if (LoadData1.length > 0)  //工单列表数据
                        {
                            for (var i = 0; i < LoadData1.length; i++) {
                                var html1 = '';
                                //汇报总数大于计划数量,调整背景色提示
                                if (LoadData1[i].HDateFinishQty > LoadData1[i].HDatePlanQty) {
                                    html1 += '<div class="layui-col-sm12 layui-col-md3" style="background-color:#F595A0;border-radius: 3%;">';
                                } else {
                                    html1 += '<div class="layui-col-sm12 layui-col-md3">';
                                }
                                html1 += '<div class="cns" id="bs' + (i + 1) + '" onclick="CheckBtom(this,' + (i + 1) + ')">';
                                html1 += '<dl>';
                                html1 += '<dd class="tcenter">';
                                html1 += '<h1 style="display:none;"><span>单据类型:</span><span id="ty' + (i + 1) + '">' + LoadData1[i].HBillType + '</span></h1>';
                                //HSourceInterID实际取值:Sc_ICMOBillStatus_Tmp  HInterID(单据主ID)
                                html1 += '<h1 style="display:none;"><span>源单主内码:</span><span id="sm' + (i + 1) + '">' + LoadData1[i].HSourceInterID + '</span></h1>';
                                html1 += '<h1 style="display:none;"><span>流转卡主ID:</span><span id="lzk' + (i + 1) + '">' + LoadData1[i].HProcExchInterID + '</span></h1>';
                                html1 += '<h1 style="display:none;"><span>源单子内码:</span><span id="sb' + (i + 1) + '">' + LoadData1[i].HSourceEntryID + '</span></h1>';
                                html1 += '<h1 style="display:none;"><span>源单单号:</span><span id="sw' + (i + 1) + '">' + LoadData1[i].HSourceBillNo + '</span></h1>';
                                html1 += '<h1 style="display:none;"><span>源单类型:</span><span id="st' + (i + 1) + '">' + LoadData1[i].HSourceBillType + '</span></h1>';
                                html1 += '<h1 style="display:none;"><span>生产订单号主ID:</span><span id="df' + (i + 1) + '">' + LoadData1[i].HICMOInterID + '</span></h1>';
                                html1 += '<h1 style="display:none;"><span>生产订单子ID:</span><span id="ds' + (i + 1) + '">' + LoadData1[i].HICMOEntryID + '</span></h1>';
                                html1 += '<h1><span>工单号:</span><span id="wk' + (i + 1) + '">' + LoadData1[i].HICMOBillNo + '</span><span style="margin-left:25px;">日期:</span><span>' + LoadData1[i].计划日期 + '</span></h1>';
                                html1 += '<h1 style="display:none;"><span>产品ID:</span><span id="materid' + (i + 1) + '">' + LoadData1[i].HMaterID + '</span></h1>';
                                html1 += '<h1 style="display:none;"><span>工序ID:</span><span id="procid' + (i + 1) + '">' + LoadData1[i].HProcID + '</span></h1>';
                                html1 += '<h1><span>产品名称:</span><span id="ptn' + (i + 1) + '">[' + LoadData1[i].HMaterNumber + ']-[' + LoadData1[i].HMaterName + ']</span></h1>';
                                html1 += '<h1><span>产品型号:</span><span id="pts' + (i + 1) + '">' + LoadData1[i].HModel + '</span></h1>';
                                html1 += '<h1><span>计划数量:</span><span>' + LoadData1[i].HDatePlanQty + '</span><span style="margin-left:20px;">汇报总数:</span><span>' + LoadData1[i].HDateFinishQty + '</span></h1>';
                                switch (LoadData1[i].HICMOStatus) {
                                    case "待生产":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border3"></span><span>' + LoadData1[i].HICMOStatus + '</span><span style="margin-left:5px;">领料状态:</span><span>' + LoadData1[i].领料状态 + '</span></h1>';
                                        break;
                                    case "生产中":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border2"></span><span>' + LoadData1[i].HICMOStatus + '</span><span style="margin-left:5px;">领料状态:</span><span>' + LoadData1[i].领料状态 + '</span></h1>';
                                        break;
                                    case "挂起":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border1"></span><span>' + LoadData1[i].HICMOStatus + '</span><span style="margin-left:5px;">领料状态:</span><span>' + LoadData1[i].领料状态 + '</span></h1>';
                                        break;
                                    case "完工":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border4"></span><span>' + LoadData1[i].HICMOStatus + '</span><span style="margin-left:5px;">领料状态:</span><span>' + LoadData1[i].领料状态 + '</span></h1>';
                                        break;
                                }
                                html1 += '<span class="prs">生产进度:</span>';
                                html1 += '<div class="layui-progress layui-progress-big" lay-showPercent="yes">';
                                html1 += '<div class="layui-progress-bar" lay-percent="' + ((LoadData1[i].HDateFinishQty / LoadData1[i].HDatePlanQty) * 100).toFixed(2) + '%" style="width:' + ((LoadData1[i].HDateFinishQty / LoadData1[i].HDatePlanQty) * 100).toFixed(2) + '%;">';
                                html1 += '<span class="layui-progress-text">' + ((LoadData1[i].HDateFinishQty / LoadData1[i].HDatePlanQty) * 100).toFixed(2) + '%</span>';
                                html1 += '</div > ';
                                html1 += '</div>';
                                html1 += '</dd>';
                                html1 += '</dl>';
                                html1 += '</div>';
                                html1 += '</div>';
                                $("#btomleft").append(html1);
                            }
                        }
                    },
                    error: function (err) {
                        layer.alert(err.Message, { time: 1 * 2000, icon: 5 });
                        return false;
                    }
                });
            }
        }
        // åˆ é™¤æŒ‰é’®çš„事件处理函数
        function deleteButton(event, HItemID) {
            event.stopPropagation(); // é˜²æ­¢äº‹ä»¶å†’泡,避免触发按钮的点击事件
            //逻辑删除方法
            layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                $.ajax({
                    url: GetWEBURL() + "/ReportPlatForm/DeleteButtonlist",
                    type: "GET",
                    data: { "HItemID": HItemID },
                    dataType: "json",//数据类型可以为 text xml json  script  jsonp
                    success: function (data) {
                        if (data.count > 0) {
                            fetchButtonsData(); //执行查询过程
                            layer.close(index);
                            layer.msg(data.Message, { time: 1 * 2000, icon: 1 });
                            return false;
                        }
                        else {
                            layer.alert(data.Message, { time: 1 * 2000, icon: 5 });
                            return false;
                        }
                    },
                    error: function (err) {
                        layer.alert(err.Message, { time: 1 * 2000, icon: 5 });
                        return false;
                    }
                });
            })
        }
        //添加按钮
        function Add_Buttton(event, obj, i) {
            event.stopPropagation();  //阻止冒泡
            //页面层-自定义
            layer.open({
                type: 2 //此处以iframe举例
                , title: '按钮绑定'
                , area: ['90%', '90%']
                , shadeClose: false //开启遮罩关闭
                , shade: 0.5
                , maxmin: true
                , content: ['../../生产管理/报工平台功能页/LineBind_Button.html', 'yes']
                , btn: ['确定', '取消']
                , btn1: function (index, layero, e) {
                    //按钮【按钮一】的回调
                    var body = layer.getChildFrame('body', index); //得到iframe页的body内容
                    var HUserName = sessionStorage["HUserName"];
                    var HButtonID = body.find("#HButtonID").val();
                    var HButtonName = body.find("#HName").val();
                    var HButtonSize = body.find("#HButtonSize").val();
                    var HButtonOrder = body.find("#HButtonOrder").val();
                    $.ajax(
                        {
                            url: GetWEBURL() + "/ReportPlatForm/AddButtonlist", //方法所在页面和方法名
                            dataType: "json",
                            type: "Get",
                            async: false,
                            data: {
                                "HUserName": HUserName,
                                "HButtonID": HButtonID,
                                "HButtonName": HButtonName,
                                "HButtonSize": HButtonSize,
                                "HButtonOrder": HButtonOrder
                            },
                            success: function (data) {
                                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                    fetchButtonsData(); //执行查询过程
                                    layer.close(index);
                                    layer.msg(data.Message, { time: 1 * 2000, icon: 1 });
                                    return false;
                                }
                                else {
                                    layer.close(index);
                                    layer.alert(data.Message, { icon: 5 });
                                    return false;
                                }
                            },
                            error: function (err) {
                                layer.alert(err.Message, { time: 1 * 2000, icon: 5 });
                                return false;
                            }
                        });
                }
                , btn2: function (index, layero) {
                    //按钮【按钮二】的回调
                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                }
                , zIndex: layer.zIndex //重点1
                , success: function (layero, index) {
                }
                , end: function () {
                }
            });
        }
        //工单列表选中
        function CheckBtom(obj, i) {
            var partid = $(obj).parent().attr("id");   //获取父级id
            workcode = $("#wk" + i + "").html(); //通过样式ID获取html内容(工单号)
            HBillType = $("#ty" + i + "").html(); //通过样式ID获取html内容(单据类型)
            HSourceInterID = $("#sm" + i + "").html(); //通过样式ID获取html内容(源单主内码)
            HProcExchInterID = $("#lzk" + i + "").html(); //流转卡ID
            HSourceEntryID = $("#sb" + i + "").html(); //通过样式ID获取html内容(源单子内吗)
            HSourceBillNo = $("#sw" + i + "").html(); //通过样式ID获取html内容(源单单号)
            HSourceBillType = $("#st" + i + "").html(); //通过样式ID获取html内容(源单类型)
            HICMOInterID = $("#df" + i + "").html();     //生产订单主内码
            HICMOEntryID = $("#ds" + i + "").html();     //生产订单子内码
            HICMOBillNo = $("#wk" + i + "").html();     //生产订单号
            HMaterName = $("#ptn" + i + "").html();     //产品名称
            HMaterID = $("#materid" + i + "").html();     //产品ID
            HProcID = $("#procid" + i + "").html();     //工序ID
            if (workcode != "" && workcode != null) {
                $('.cns').removeClass('check1');  //删除不同父级clss样式相同的所有元素
                $("#bs" + i + "").addClass('check1'); // æ·»åŠ å½“å‰å…ƒç´ çš„æ ·å¼
                wktag = 1;
            }
        }
        //非空验证
        function AllowLoadData(body) {  //非空验证
            var Result = true;
            if (body.find("#HSourceID").val() == '' || body.find("#HSourceID").val() == null) {
                layer.msg("生产资源不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return Result = false;
            }
            if (body.find("#HManagerID").val() == '' || body.find("#HManagerID").val() == null) {
                layer.msg("负责人不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return Result = false;
            }
            if (body.find("#HGroupID").val() == '' || body.find("#HGroupID").val() == null) {
                layer.msg("班组不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return Result = false;
            }
            if (body.find("#HCreateDate").val() == '' || body.find("#HCreateDate").val() == null) {
                layer.msg("创建日期不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return Result = false;
            }
            return Result;
        }
        //将s转化为时分秒格式 h:m:s
        function getSeconds(s) {
            var sTime = parseInt(s);// ç§’
            var mTime = 0;// åˆ†
            var hTime = 0;// æ—¶
            if (sTime > 60) {//如果秒数大于60,将秒数转换成整数
                //获取分钟,除以60取整数,得到整数分钟
                mTime = parseInt(sTime / 60);
                //获取秒数,秒数取佘,得到整数秒数
                sTime = parseInt(sTime % 60);
                //如果分钟大于60,将分钟转换成小时
                if (mTime > 60) {
                    //获取小时,获取分钟除以60,得到整数小时
                    hTime = parseInt(mTime / 60);
                    //获取小时后取佘的分,获取分钟除以60取佘的分
                    mTime = parseInt(mTime % 60);
                }
            }
            var result = '';
            if (sTime >= 0 && sTime < 10) {
                result = "0" + parseInt(sTime) + "";
            } else {
                result = "" + parseInt(sTime) + "";
            }
            if (mTime >= 0 && mTime < 10) {
                result = "0" + parseInt(mTime) + ":" + result;
            } else {
                result = "" + parseInt(mTime) + ":" + result;
            }
            if (hTime >= 0 && hTime < 10) {
                result = "0" + parseInt(hTime) + ":" + result;
            } else {
                result = "" + parseInt(hTime) + ":" + result;
            }
            return result;
        }
        //开工按钮点击事件
        function OpenWork(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "开工")) {
                layer.alert("单据状态不满足开工条件!", { icon: 5 });
                return false;
            }
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '新增开工单',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '../../生产管理/报工平台_PDA/开工/Sc_Add_MESBeginWorkBillList_PDA.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HBillType": HBillType,
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //快速开工
        function KSOpenWork(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "开工")) {
                layer.alert("单据状态不满足开工条件!", { icon: 5 });
                return false;
            }
            var indexOpen = layer.open({
                type: 1
                , title: "确认开工吗?"
                , closeBtn: false
                , area: '300px;'
                , shade: 0.8
                , id: 'LAY_layuipro' //设定一个id,防止重复弹出
                , btn: ['确定', '取消']
                , btnAlign: 'c'
                , moveType: 1 //拖拽模式,0或者1
                , content: '<div style="padding: 50px; line-height: 22px; font-weight: 300;text-align:center;">设备编号:' + HSourceName1 + '<br>工单号:' + workcode + '<br>产品名称:' + HMaterName + '<br></div>'
                , btn1: function (index, layero, e) {
                    //新增开工单
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Sc_MESBeginWorkBill/SaveGetMESBeginWorkFrom_KS", //方法所在页面和方法名
                        data: { "HBillType": HBillType, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "HSourceBillNo": HSourceBillNo, "user": sessionStorage["HUserName"], "HSourceBillType": HSourceBillType },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    //window.location.reload();
                                });
                                layer.close(indexOpen);
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
            });
        }
        //SOP ä½œä¸šæŒ‡å¯¼ä¹¦
        function SOP(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '作业指导书',
                closeBtn: 1,
                shift: 2,
                area: ['95%', '95%'],
                maxmin: true,
                content: '生产管理/作业指导书/Gy_SOPBill_Video.html?OperationType=5&HMaterID=' + HMaterID + '&HSourceNo=' + workcode + '&HSourceEntryID=' + HSourceEntryID + '&HProcID=' + HProcID,
                end: function () {
                },
            });
            /* window.open("../../../views/生产管理/作业指导书/Gy_SOPBill_Video.html?OperationType=5&HMaterID=" + HMaterID + "&HSourceNo=" + workcode + "&HSourceEntryID=" + HSourceEntryID);*/
        }
        //汇报按钮点击事件
        function OpenReport(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "汇报")) {
                layer.alert("单据状态不满足汇报条件!", { icon: 5 });
                return false;
            }
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '新增产量汇报单',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '../../生产管理/报工平台_PDA/产量汇报/Sc_Add_ProductReportBillList_PDA.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HBillType": HBillType,
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //完工单按钮点击事件
        function OpenEnd(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "完工")) {
                layer.alert("单据状态不满足完工条件!", { icon: 5 });
                return false;
            }
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '新增完工单',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '../../生产管理/报工平台_PDA/完工/Sc_Add_MESEndWorkBillList_PDA.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HBillType": HBillType,
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //停工单按钮点击事件
        function OpenStop(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "停工")) {
                layer.alert("单据状态不满足停工条件!", { icon: 5 });
                return false;
            }
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '新增停工单',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '../../生产管理/报工平台_PDA/停工/Sc_Add_MESStopWorkBillList_PDA.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HBillType": HBillType,
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //报检申请按钮点击事件
        function OpenInSpection(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            var IsCheck = false;
            //根据系统参数控制,判断生产订单是否做了首件检验单和工序检验单,如果有其中一种检验单没做,则不让做生产汇报单
            $.ajax({
                url: GetWEBURL() + "/ReportPlatForm/IsCheck",
                type: "GET",
                data: { "HICMOInterID": HICMOInterID, "HICMOEntryID": HICMOEntryID, "HICMOBillNo": HICMOBillNo },
                async: false,
                success: function (data) {
                    if (data.code == 0) {
                        layer.alert(data.Message);
                        return false;
                    } else {
                        IsCheck = true;
                    }
                },
                error: function (err) {
                    layer.alert(data.Message);
                    return false;
                }
            });
            if (IsCheck == true) {
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '产量汇报列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['100%', '100%'],
                    maxmin: true,
                    content: '生产管理/产量汇报单/Sc_ProductReportBillList.html?OperationType=2&linterid=&HSouceBillType=',
                    end: function () {
                    },
                    success: function (dom, index) {
                        var data = [];
                        data.push({
                            "workcode": workcode,
                            "HSourceID": HSourceID1,
                            "HSourceName": HSourceName1,
                            "HICMOInterID": HICMOInterID,
                            "HICMOEntryID": HICMOEntryID,
                            "HMaker": sessionStorage["HUserName"],    //sessionStorage["HUserName"]
                            "Czybm": sessionStorage["Czybm"],
                            //"HEmpID": "0",    //sessionStorage["HEmpID"]
                            "HSourceBillType": HSourceBillType
                        });
                        //通过索引获取到当前iframe弹出层
                        var iframe = window['layui-layer-iframe' + index];
                        //调用iframe弹出层内的方法
                        iframe.edit(data);
                    },
                });
            }
        }
        //上料防错单
        function OpenMaterToSource() {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '新增上料防错单',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '生产管理/上料防错单/Sc_Add_MaterToSourceBillList.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HBillType": HBillType,
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //首检检验
        function OpenFistCheck(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            layer.open({
                type: 2
                , area: ['100%', '100%']
                , title: '首件检验单-编辑'
                , shade: 0.6
                , maxmin: false
                , anim: 0
                , content: ['质量管理/首件检验单/QC_Add_Edit_FirstPieceCheckBill.html?OperationType=2&linterid=' + HProcExchInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HICMOEntryID + '&HSourceEntryID=' + HSourceEntryID + '', 'yes']
                , resize: false
                , cancel: function () {
                }
                , end: function () {
                }
            })
        }
        //过程检验
        function OpenProcess(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            layer.open({
                type: 2
                , area: ['100%', '100%']
                , title: '巡检检验单-编辑'
                , shade: 0.6
                , maxmin: false
                , anim: 0
                , content: ['质量管理/巡检记录单/QC_Add_Edit_PatrolProcCheckOtherill.html?OperationType=2&linterid=' + HProcExchInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HICMOEntryID + '&HSourceEntryID=' + HSourceEntryID + '', 'yes']
                , resize: false
                , cancel: function () {
                }
                , end: function () {
                }
            })
        }
        //末检
        function ProcessCheck(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            layer.open({
                type: 2
                , area: ['100%', '100%']
                , title: '工序检验单-编辑'
                , shade: 0.6
                , maxmin: false
                , anim: 0
                , content: ['质量管理/工序检验单/QC_ProcessCheckBill.html?OperationType=2&linterid=' + HProcExchInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HICMOEntryID + '&HSourceEntryID=' + HSourceEntryID + '', 'yes']
                , resize: false
                , cancel: function () {
                }
                , end: function () {
                }
            })
        }
        //不良采集
        function BadGather() {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "不良采集")) {
                layer.alert("单据状态不满足不良采集条件!", { icon: 5 });
                return false;
            }
            layer.open({
                type: 2
                , area: ['100%', '100%']
                , title: '质量汇报单-编辑'
                , shade: 0.6
                , maxmin: false
                , anim: 0
                , content: ['生产管理/质量汇报单/Sc_QualityReportBill.html?OperationType=2&linterid=' + HSourceInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HSourceEntryID, 'yes']
                , resize: false
                , cancel: function () {
                }
                , end: function () {
                }
            })
        }
        //微瑕品汇报
        function SubtleFlaw() {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "微瑕品汇报")) {
                layer.alert("单据状态不满足微瑕品汇报条件!", { icon: 5 });
                return false;
            }
            layer.open({
                type: 2
                , area: ['100%', '100%']
                , title: '微瑕品汇报单-编辑'
                , shade: 0.6
                , maxmin: false
                , anim: 0
                , content: ['生产管理/质量汇报单/Sc_QualityReportBill.html?OperationType=2&linterid=' + HSourceInterID + '&HSouceBillType=' + HBillType + '&HICMOEntryID=' + HSourceEntryID + '&HBillSubType=微瑕品', 'yes']
                , resize: false
                , cancel: function () {
                }
                , end: function () {
                }
            })
        }
        //当前工单按钮点击事件
        function CurrentStatus(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '当前工单',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '生产管理/工单/Sc_CurrentTicket.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HEquipName": $("#HEquipName1").text(),
                        "HEquipCode": $("#HEquipCode1").text(),
                        "HICMOBillNo": workcode,
                        "HICMOInterID": HICMOInterID,
                        "HICMOEntryID": HICMOEntryID,
                        "HSourceID": HSourceID1,
                        "HEmpName": HEmpName,
                        "HManagerName": HManagerName,
                        "HGroupName": HGroupName,
                        "HBillType": HBillType,
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //当前工单(汇报)按钮点击事件
        function CodingReport(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "斯莫尔汇报")) {
                layer.alert("单据状态不满足汇报条件!", { icon: 5 });
                return false;
            }
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '当前工单',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '车间管理/工序出站汇报单/Cj_StationOutBill_CurrentWork.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HEquipName": $("#HEquipName1").text(),
                        "HEquipCode": $("#HEquipCode1").text(),
                        "HICMOBillNo": workcode,
                        "HICMOInterID": HICMOInterID,
                        "HICMOEntryID": HICMOEntryID,
                        "HSourceID": HSourceID1,
                        "HSourceName": HSourceName1,
                        "HEmpName": HEmpName,
                        "HManagerID": HManagerID,
                        "HManagerName": HManagerName,
                        "HGroupName": HGroupName,
                        "HGroupID": HGroupID,
                        "HBillType": HBillType,
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //设备启动点检按钮点击事件
        function BeginDotCheck(event, obj) {
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '新增设备启动点检单',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '车间管理/启动点检单/Sc_WorkBeginDotCheckBill.html?OperationType=4&linterid=&HSouceBillType=',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HMaterID": HMaterID,
                        "HProcID": HProcID,
                        "HSourceID": HSourceID1,
                        "SCOrder": HSourceBillNo
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //异常按钮点击事件
        function Abnormal(event, obj) {
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '异常反馈类型',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '生产管理/异常反馈单/Sc_MESExecptFeedBackBillType.html',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HICMOBillNo": HICMOBillNo,//工单号
                        "HSourceName": HSBName, //设备
                        "HSourceBillNo": HSourceBillNo //工序流转卡
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //防错验证清单按钮点击事件
        function PreventErrMouldCheck(event, obj) {
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '新增防错验证',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '车间管理/防错验证/Qc_PreventErrMouldCheckBill.html?OperationType=4&linterid=&HSouceBillType=',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HMaterID": HMaterID,
                        "HProcID": HProcID,
                        "SCOrder": HSourceBillNo
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //检验取样按钮点击事件
        function TakeSample(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '新增开工单',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '质量管理/检验取样还样单/QC_Add_TakeSampleCheckBill.html?OperationType=2&linterid=&HSouceBillType=',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HBillType": HBillType,
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //工艺参数点检点击事件
        function TechParam(event, obj) {
            if (wktag == 0) {
                layer.alert("请选择工单列表", { icon: 5 });
                return false;
            }
            if (WorkStaus(HSourceID1, workcode, HSourceInterID, "工艺参数点检")) {
                layer.alert("单据状态不满足工艺参数点检条件!", { icon: 5 });
                return false;
            }
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '新增工艺参数点检单',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '设备管理/设备工艺参数订单点检表/SB_EquipICMOTechParamBillEdit.html?OperationType=4&linterid=&HEntryID=',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HBillType": HBillType,
                        "HSourceInterID": HSourceInterID,
                        "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo,
                        "HSourceBillType": HSourceBillType
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                },
            });
        }
        //异常签到处理点击事件
        function SingErrMsg(event, obj) {
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '新增异常签到处理单',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '生产管理/异常反馈单/OA_ErrMsgBackSignBill_BrushCard.html?OperationType=2',
                end: function () {
                }
            });
        }
        //异常验收点击事件
        function ErrMsgBackCheck(event, obj) {
            layer.open({
                type: 2,
                skin: 'layui-layer-rim', //加上边框
                title: '新增异常反馈验收单',
                closeBtn: 1,
                shift: 2,
                area: ['100%', '100%'],
                maxmin: true,
                content: '质量管理/异常反馈/OA_ErrMsgBackSelfQuery_BGT.html?OperationType=2',
                end: function () {
                },
                success: function (dom, index) {
                    var data = [];
                    data.push({
                        "HSourceID": HSourceID1,
                        "HSourceName": HSourceName1
                    });
                    //通过索引获取到当前iframe弹出层
                    var iframe = window['layui-layer-iframe' + index];
                    //调用iframe弹出层内的方法
                    iframe.edit(data);
                }
            });
        }
        //退出
        function Esc(event, obj) {
            parent.location.href = "index.html"
        }
        //单据状态验证
        function WorkStaus(HSourceID1, workcode, HSourceInterID, btn) {
            var flag = false;
            var sWhere = "";
            switch (btn) {
                case "开工":
                    sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('0','2')";   //是否有不为开工开工状态、停工状态
                    break;
                case "完工":
                    sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1','2')";   //是否有不为开工、完工状态
                    break;
                case "停工":
                    sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1')";   //是否有不为停工挂起状态
                    break;
                case "汇报":
                    sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1','2')";   //是否有不为开工、停工挂起状态
                    break;
                case "斯莫尔汇报":
                    sWhere = " where HSourceID='" + HSourceID1 + "' and HSourceBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1','2')";   //是否有不为开工、停工挂起状态
                    break;
                case "报检申请":
                    //        break;
                    //    default:
                    //}
                    $.ajax({
                        url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkBillStaus",
                        type: "GET",
                        data: { "sWhere": JSON.stringify(sWhere) },
                        dataType: "json",//数据类型可以为 text xml json  script  jsonp
                        async: false,
                        success: function (data) {
                            if (data.count > 0) {
                                flag = true;
                            }
                            else {
                                flag = false;
                            }
                        },
                        error: function (err) {
                            flag = false;
                        }
                    });
                    return flag;
            }
        }
    </script>
</body>
</html>
WebTM/views/Éú²ú¹ÜÀí/±¨¹¤Æ½Ì¨_PDA/IpadSourceIndex_PDA.html
New file
@@ -0,0 +1,488 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>报工平台</title>
    <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, maximum-scale=1">
    <!--引用layui样式文件-->
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <link href="../../../layuiadmin/layui/css/global.css" rel="stylesheet" />
    <!--自定义样式-->
    <link href="../../../layuiadmin/layui/css/ReportPlatform.css" rel="stylesheet" />
    <!--引用layui js文件-->
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/echarts.min.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
</head>
<body>
    <!-- è®©IE8/9支持媒体查询,从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <div style="margin: 20px 20px;">
        <!--<blockquote class="layui-elem-quote">注意:下述演示中的颜色只是做一个区分作用,并非栅格内置。</blockquote>-->
        <div class="layui-row layui-col-space10">
            <div class="layui-col-sm12 layui-col-md8">
                <div class="layui-form-item" style="margin: 1% 2%;text-align: right;">
                    <button type="button" lay-submit="" lay-filter="Cancel" id="Cancel" class="layui-btn layui-btn-radius layui-btn-danger">退出</button>
                </div>
                <fieldset style="border: 1px solid #eee;box-shadow: 0 2px 5px 0 rgb(0 0 0 / 10%);">
                    <legend style="color: #5FB878">生产资源</legend>
                    <div class="layui-content">
                        <div class="layui-row layui-col-space10" id="topleft">
                        </div>
                    </div>
                </fieldset>
            </div>
        </div>
    </div>
    <script>
        var wktag = 0;
        var workcode = "";          //工单号
        var HDeptID = "";          //车间ID
        var HDept = "";            //车间
        var HSourceID = "";        //生产资源ID
        var HSourceName = "";      //生产资源
        var HSourceID1 = "";        //生产资源ID1
        var HSourceName1 = "";      //生产资源1
        var HSourceInterID = "";   //源单主内码
        var HProcExchInterID = "";   //流转卡id
        var HSourceEntryID = "";   //源单子内码
        var HSourceBillNo = "";    //源单单号
        var HSourceBillType = "";  //源单类型
        var HICMOInterID = "";     //生产订单主内码
        var HICMOEntryID = "";     //生产订单子内码
        var HICMOBillNo = "";      //任务单号
        var HMaterName = "";      //产品名称
        var HMaterID = 0;          //产品ID
        var HProQty = [];       //时间点产量
        var HBadQty = [];       //不良数量
        var HBadReason = [];       //不良原因
        var HEmpName = "";      //操作员
        var HManagerName = "";      //负责人
        var HGroupName = "";      //班组
        var HProcID = 0;      //工序
        var HSBName = "";   //设备名称
        //注意:选项卡 ä¾èµ– element æ¨¡å—,否则无法进行功能性操作
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , laydate = layui.laydate
                , element = layui.element;
            //window å…¨å±€å˜é‡
            //退出
            $(document).ready(function () {
                $("#Cancel").on('click', function () {
                    layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                        parent.location.href = "../../../views/index_Mobile.html";
                    });
                });
            });
            TSLoad();
        });
        function TSLoad() {
            $("#topleft").html("");
            var HUserName = sessionStorage["HUserName"];  //sessionStorage["HUserName"];     //默认当前登录人员
            $.ajax({
                url: GetWEBURL() + "/ReportPlatForm/SearchGetLineBindBillList",
                type: "GET",
                data: { "HUserName": HUserName },
                dataType: "json",//数据类型可以为 text xml json  script  jsonp
                success: function (data) {
                    var LoadData = data.data.h_p_JIT_GetSourceInfoByUser;
                    if (LoadData.length > 0)// è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                    {
                        HSBName = LoadData[0].HSourceName;
                        for (var i = 1; i <= LoadData.length + 1; i++) {
                            if (i <= LoadData.length) {
                                var html1 = '';
                                html1 += '<div class="layui-col-sm12 layui-col-md3">';
                                html1 += '<div class="cnt ctop" id="ts' + i + '" onclick="Check(this,' + i + ')">';
                                html1 += '<dl>';
                                html1 += '<dd>';
                                html1 += '<h1 style="display:none;"><span>资源ID:</span><span id="eqpid' + i + '">' + LoadData[i - 1].HSourceID + '</span></h1>';
                                html1 += '<h1><span>设备编号:</span><span id="eqp' + i + '">' + LoadData[i - 1].HSourceName + '</span></h1>';
                                html1 += '<h1><span>设备代码:</span><span id="eqp' + i + '">' + LoadData[i - 1].HSourceNumber + '</span></h1>';
                                html1 += '<h1><span>操作员:</span><span id="HEmpName' + i + '">' + LoadData[i - 1].HUserName + '</span></h1>';
                                html1 += '<h1><span>生产班组:</span><span id="HGroupName' + i + '">' + LoadData[i - 1].GroupName + '</span></h1>';
                                //html1 += '<h1><span>当前工单:</span><span id="po' + i + '">' + (LoadData[i - 1].HSourceBillNo == null ? '' : LoadData[i - 1].HSourceBillNo) + '</span></h1>';
                                //html1 += '<h1><span>产品名称:</span><span id="ptn' + i + '">' + (LoadData[i - 1].HName == null ? '' : LoadData[i - 1].HName) + '</span></h1>';
                                //html1 += '<h1><span>产品规格:</span><span id="pts' + i + '">' + (LoadData[i - 1].HModel == null ? '' : LoadData[i - 1].HModel) + '</span></h1>';
                                html1 += '<h1><span>负责人:</span><span id="us' + i + '">' + LoadData[i - 1].HEmpName + '</span></h1>';
                                switch (LoadData[i - 1].HStatus) {
                                    case "空闲":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border6"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                        break;
                                    case "开机":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border4"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                        break;
                                    case "停机":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border3"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                        break;
                                    case "生产":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border2"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                        break;
                                    case "维修进行中":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border5"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                        break;
                                    case "维修结束":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border1"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                        break;
                                    case "维修终止":
                                        html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border1"></span><span>' + LoadData[i - 1].HStatus + '</span></h1>';
                                        break;
                                    default:
                                }
                                html1 += '<h1 hidden> <span id="HGroupID' + i + '">' + LoadData[i - 1].HGroupID + '</span></h1>';
                                html1 += '<h1 hidden> <span id="HManagerID' + i + '">' + LoadData[i - 1].HManagerID + '</span></h1>';
                                html1 += '</dd>';
                                html1 += '</dl>';
                                html1 += '</div>';
                                html1 += '</div>';
                                $("#topleft").append(html1);
                                $("#ts" + i + "").append('<span class="layui-icon layui-icon-delete delete"  onclick="Delete(event,this,' + i + ')"></span>'); //在当前div后追加加一个span删除
                            }
                            else {
                                var html1 = '';
                                html1 += '<div class="layui-col-sm12 layui-col-md3">';
                                html1 += '<div class="cnt ctop" id="ts' + i + '" onclick="Check(this,' + i + ')">';
                                html1 += '<span class="layui-icon layui-icon-addition imgicon0" onclick="Add(event,this,' + i + ')"></span>';
                                html1 += '</div>';
                                html1 += '</div>';
                                $("#topleft").append(html1);
                            }
                        }
                    }
                    else {
                        var html1 = '';
                        html1 += '<div class="layui-col-sm12 layui-col-md3">';
                        html1 += '<div class="cnt ctop" id="ts1" onclick="Check(this,1)">';
                        html1 += '<span class="layui-icon layui-icon-addition imgicon0" onclick="Add(event,this,1)"></span>';
                        html1 += '</div>';
                        html1 += '</div>';
                        $("#topleft").append(html1);
                    }
                },
                error: function (err) {
                    layer.alert(err.Message, { time: 1 * 2000, icon: 5 });
                    return false;
                }
            });
        }
        var HManagerID = 0;
        var HGroupID = 0;
        //选中资源
        function Check(obj, i) {
            wktag = 0;
            HProQty = [];       //时间点产量
            HBadQty = [];       //不良数量
            HBadReason = [];       //不良原因
            var partid = $(obj).parent().attr("id");   //获取父级id
            var eqpid = "eqpid" + i;                   //获取指定资源样式ID
            var HSourceID = $("#" + eqpid + "").html(); //通过样式ID获取html内容(资源ID)
            HSourceID1 = $("#" + eqpid + "").html(); //通过样式ID获取html内容(资源ID)
            var eqp = "eqp" + i;                       //获取指定资源样式ID
            var HSourceName = $("#" + eqp + "").html(); //通过样式ID获取html内容(资源)
            HSourceName1 = $("#" + eqp + "").html(); //通过样式ID获取html内容(资源)
            var emp = "HEmpName" + i;                   //获取指定资源样式ID
            var us = "us" + i;                   //获取指定资源样式ID
            var gro = "HGroupName" + i;                   //获取指定资源样式ID
            HEmpName = $("#" + emp + "").html(); //通过样式ID获取html内容(资源ID)
            HManagerName = $("#" + us + "").html(); //通过样式ID获取html内容(资源ID)
            HGroupName = $("#" + gro + "").html(); //通过样式ID获取html内容(资源ID)
            HManagerID = "HManagerID" + i;
            HGroupID = "HGroupID" + i;
            HManagerID = $("#" + HManagerID + "").html();
            HGroupID = $("#" + HGroupID + "").html();
            parent.location.href = "../../../views/生产管理/报工平台_PDA/IpadIndex_PDA.html?Type=1&HSourceID=" + HSourceID;
            //if (HSourceID != "" && HSourceID != null) {
            //    $('.ctop').removeClass('check');  //删除不同父级clss样式相同的所有元素
            //    $("#ts" + i + "").addClass('check'); // æ·»åŠ å½“å‰å…ƒç´ çš„æ ·å¼
            //    //执行联动事件
            //    $.ajax({
            //        url: GetWEBURL() + "/ReportPlatForm/SearchGetWorkBillList",
            //        type: "GET",
            //        data: { "HSourceID": HSourceID },
            //        dataType: "json",//数据类型可以为 text xml json  script  jsonp
            //        success: function (data) {
            //            var LoadData1 = data.data.h_p_JIT_GetWorkBillListInfoBySource;
            //            var LoadData2 = data.data.h_p_JIT_GetWorkBillListInfoBySource1;
            //            var LoadData3 = data.data.h_p_JIT_GetWorkBillListInfoBySource2; //时间点产量
            //            var LoadData4 = data.data.h_p_JIT_GetWorkBillListInfoBySource3; //不良分析
            //        },
            //        error: function (err) {
            //            layer.alert(err.Message, { time: 1 * 2000, icon: 5 });
            //            return false;
            //        }
            //    });
            //}
        }
        //添加资源
        function Add(event, obj, i) {
            event.stopPropagation();  //阻止冒泡
            //页面层-自定义
            layer.open({
                type: 2 //此处以iframe举例
                , title: '产线绑定'
                , area: ['90%', '90%']
                , shadeClose: false //开启遮罩关闭
                , shade: 0.5
                , maxmin: true
                , content: ['../../生产管理/报工平台_PDA/LineBind_PDA.html', 'yes']
                , btn: ['确定', '取消']
                , btn1: function (index, layero, e) {
                    //按钮【按钮一】的回调
                    var body = layer.getChildFrame('body', index); //得到iframe页的body内容
                    //var from = layer.getChildFrame('#from0', index); //得到iframe页的from内容
                    if (!AllowLoadData(body))//数据验证
                    {
                        return false;
                    }
                    var HUserName = sessionStorage["HUserName"];
                    var HSourceID = body.find("#HSourceID").val();
                    var HSourceCode = body.find("#HSourceCode").val();
                    var HSourceName = body.find("#HSourceName").val();
                    var HManagerID = body.find("#HManagerID").val();
                    var HManagerName = body.find("#HManagerName").val();
                    var HGroupID = body.find("#HGroupID").val();
                    var HGroupName = body.find("#HGroupName").val();
                    var HCreateDate = body.find("#HCreateDate").val();
                    var HRemark = body.find("#HRemark").val();
                    if (HSourceID == 0) {
                        layer.msg("生产资源不能为空", { time: 1 * 2000, icon: 1 });
                    } else {
                        $.ajax(
                            {
                                url: GetWEBURL() + "/ReportPlatForm/SaveGetLineBindBillList", //方法所在页面和方法名
                                dataType: "json",
                                type: "Get",
                                async: false,
                                data: {
                                    "HUserName": HUserName,
                                    "HSourceID": HSourceID,
                                    "HSourceName": HSourceName,
                                    "HManagerID": HManagerID,
                                    "HManagerName": HManagerName,
                                    "HGroupID": HGroupID,
                                    "HGroupName": HGroupName,
                                    "HCreateDate": HCreateDate,
                                    "HRemark": HRemark
                                },
                                success: function (data) {
                                    if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                        TSLoad(); //执行查询过程
                                        layer.close(index);
                                        layer.msg(data.Message, { time: 1 * 2000, icon: 1 });
                                        return false;
                                    }
                                    else {
                                        layer.close(index);
                                        layer.alert(data.Message, { icon: 5 });
                                        return false;
                                    }
                                },
                                error: function (err) {
                                    layer.alert(err.Message, { time: 1 * 2000, icon: 5 });
                                    return false;
                                }
                            });
                    }
                }
                , btn2: function (index, layero) {
                    //按钮【按钮二】的回调
                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                }
                , zIndex: layer.zIndex //重点1
                , success: function (layero, index) {
                }
                , end: function () {
                }
            });
        }
        //删除资源
        function Delete(event, obj, i) {
            event.stopPropagation();  //阻止冒泡
            //获取父级id
            var partid = $(obj).parent().attr("id");
            var eqpid = "eqpid" + i;                   //获取指定资源样式ID
            HSourceID = $("#" + eqpid + "").html(); //通过样式ID获取html内容(资源ID)
            //逻辑删除方法
            layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                $.ajax({
                    url: GetWEBURL() + "/ReportPlatForm/DeleteGetLineBindBillList",
                    type: "GET",
                    data: { "HSourceID": HSourceID, "user": sessionStorage["HUserName"] },
                    dataType: "json",//数据类型可以为 text xml json  script  jsonp
                    success: function (data) {
                        if (data.count > 0) {
                            TSLoad(); //执行查询过程
                            layer.close(index);
                            layer.msg(data.Message, { time: 1 * 2000, icon: 1 });
                            return false;
                        }
                        else {
                            layer.alert(data.Message, { time: 1 * 2000, icon: 5 });
                            return false;
                        }
                    },
                    error: function (err) {
                        layer.alert(err.Message, { time: 1 * 2000, icon: 5 });
                        return false;
                    }
                });
            })
        }
        //非空验证
        function AllowLoadData(body) {  //非空验证
            var Result = true;
            if (body.find("#HSourceID").val() == '' || body.find("#HSourceID").val() == null) {
                layer.msg("生产资源不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return Result = false;
            }
            if (body.find("#HManagerID").val() == '' || body.find("#HManagerID").val() == null) {
                layer.msg("负责人不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return Result = false;
            }
            if (body.find("#HGroupID").val() == '' || body.find("#HGroupID").val() == null) {
                layer.msg("班组不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return Result = false;
            }
            if (body.find("#HCreateDate").val() == '' || body.find("#HCreateDate").val() == null) {
                layer.msg("创建日期不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return Result = false;
            }
            return Result;
        }
        //将s转化为时分秒格式 h:m:s
        function getSeconds(s) {
            var sTime = parseInt(s);// ç§’
            var mTime = 0;// åˆ†
            var hTime = 0;// æ—¶
            if (sTime > 60) {//如果秒数大于60,将秒数转换成整数
                //获取分钟,除以60取整数,得到整数分钟
                mTime = parseInt(sTime / 60);
                //获取秒数,秒数取佘,得到整数秒数
                sTime = parseInt(sTime % 60);
                //如果分钟大于60,将分钟转换成小时
                if (mTime > 60) {
                    //获取小时,获取分钟除以60,得到整数小时
                    hTime = parseInt(mTime / 60);
                    //获取小时后取佘的分,获取分钟除以60取佘的分
                    mTime = parseInt(mTime % 60);
                }
            }
            var result = '';
            if (sTime >= 0 && sTime < 10) {
                result = "0" + parseInt(sTime) + "";
            } else {
                result = "" + parseInt(sTime) + "";
            }
            if (mTime >= 0 && mTime < 10) {
                result = "0" + parseInt(mTime) + ":" + result;
            } else {
                result = "" + parseInt(mTime) + ":" + result;
            }
            if (hTime >= 0 && hTime < 10) {
                result = "0" + parseInt(hTime) + ":" + result;
            } else {
                result = "" + parseInt(hTime) + ":" + result;
            }
            return result;
        }
        //退出
        function Esc(event, obj) {
            parent.location.href = "index.html"
        }
        //单据状态验证
        function WorkStaus(HSourceID1, workcode, HSourceInterID, btn) {
            var flag = false;
            var sWhere = "";
            switch (btn) {
                case "开工":
                    sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('0','2')";   //是否有不为开工开工状态、停工状态
                    break;
                case "完工":
                    sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1','2')";   //是否有不为开工、完工状态
                    break;
                case "停工":
                    sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1')";   //是否有不为停工挂起状态
                    break;
                case "汇报":
                    sWhere = " where HSourceID='" + HSourceID1 + "' and HICMOBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1','2')";   //是否有不为开工、停工挂起状态
                    break;
                case "斯莫尔汇报":
                    sWhere = " where HSourceID='" + HSourceID1 + "' and HSourceBillNo='" + workcode + "' and HInterID='" + HSourceInterID + "' and hicmostatus not in('1','2')";   //是否有不为开工、停工挂起状态
                    break;
                case "报检申请":
                    //        break;
                    //    default:
                    //}
                    $.ajax({
                        url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkBillStaus",
                        type: "GET",
                        data: { "sWhere": JSON.stringify(sWhere) },
                        dataType: "json",//数据类型可以为 text xml json  script  jsonp
                        async: false,
                        success: function (data) {
                            if (data.count > 0) {
                                flag = true;
                            }
                            else {
                                flag = false;
                            }
                        },
                        error: function (err) {
                            flag = false;
                        }
                    });
                    return flag;
            }
        }
    </script>
</body>
</html>
WebTM/views/Éú²ú¹ÜÀí/±¨¹¤Æ½Ì¨_PDA/LineBind_PDA.html
New file
@@ -0,0 +1,253 @@
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>产线绑定</title>
    <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">
    <!--引用layui样式文件-->
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <!--引用layui js文件-->
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <style type="text/css">
        .maintitle {
            background-color: #1492ff;
            color: #fff;
            padding: 5px 10px;
            border: none;
            border-radius: 4px;
        }
        .title {
            border-left: 4px solid #1492ff;
            padding-left: 6px;
            margin: 20px 10px 4px;
            font-size: 16px;
            color: #333;
        }
        .buttom_box_little {
            width: 60px;
            height: 36px;
            color: #fff;
            background-color: #1492ff;
            border-radius: 4px;
            border: none;
            margin: 10px;
        }
        .layui-input {
            width: 93%;
        }
        .layui-inline, img {
            display: block;
            vertical-align: middle
        }
        .layui-input, .layui-textarea {
            display: inline-block;
            width: 100%;
            padding-left: 10px;
        }
        .laydate-time-list ol {
            overflow-x: hidden !important;
            overflow-y: auto !important;
        }
        .layui-form-label {
            padding: 9px 5px;
        }
        .layui-input-block {
            margin-left: 85px;
            min-height: 36px;
        }
    </style>
</head>
<body>
    <div id="layout1" class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <form id="form0" class="layui-form" lay-filter="component-form-group" action="">
                        <!--<div class="layui-card-header">
                            <div class="layui-btn-group">
                                <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">保存</button>
                                <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">退出</button>
                            </div>
                        </div>-->
                        <div class="layui-card-body">
                            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                                <h1 style="text-align:center;"><b>产线绑定</b></h1>
                                <div class="layui-tab-content">
                                    <div class="layui-form-item" style="padding-top: 10px;">
                                        <div class="layui-row">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 75px;padding: 9px 5px;">用户名:</label>
                                                <div class="layui-input-block" style="margin-left: 85px;">
                                                    <input type="text" name="HUserName" id="HUserName" class="layui-input" style="background-color:#efefef4d;width:83%;" readonly>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 75px;padding: 9px 5px;">生产资源:</label>
                                                <div class="layui-input-block">
                                                    <input type="text" name="HSourceName" id="HSourceName" class="layui-input" placeholder="用户绑定生产资源" style="width:80%;">
                                                    <input type="hidden" name="HSourceCode" id="HSourceCode" class="layui-input" style="width:80%;">
                                                    <input type="hidden" name="HSourceID" id="HSourceID" value="0" class="layui-input">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HSource" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 75px;padding: 9px 5px;">负责人:</label>
                                                <div class="layui-input-block">
                                                    <input type="text" name="HManagerName" id="HManagerName" placeholder="用户绑定保管员" class="layui-input" style="width:80%;">
                                                    <input type="hidden" name="HManagerID" id="HManagerID" value="0" class="layui-input">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HManager" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 75px;padding: 9px 5px;">班组:</label>
                                                <div class="layui-input-block">
                                                    <input type="text" name="HGroupName" id="HGroupName" class="layui-input" value="" placeholder="用户绑定班组" style="width: 80%;">
                                                    <input type="hidden" name="HGroupID" id="HGroupID" class="layui-input" value="0">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HGroupList" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 75px;padding: 9px 5px;">创建日期:</label>
                                                <div class="layui-input-block" style="margin-left: 85px;">
                                                    <input type="text" name="HCreateDate" id="HCreateDate" class="layui-input" style="background-color:#efefef4d;width:83%;" disabled dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd">
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 75px;padding: 9px 5px;">备注:</label>
                                                <div class="layui-input-block">
                                                    <textarea placeholder="请输入备注" class="layui-textarea" name="HRemark" id="HRemark" style="width:83%;"></textarea>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , laydate = layui.laydate
                , element = layui.element;
            //日期时间选择器
            laydate.render({
                elem: '#HCreateDate'
                , type: 'datetime'
            });
            //初始化数据
            $("#HUserName").val(sessionStorage["HUserName"]);     //创建人
            $("#HCreateDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));      //单据日期
            $("#HSourceID").val(sessionStorage["HSourceID"]);      //生产资源id
            $("#HSourceName").val(sessionStorage["HSource"]);      //生产资源
            $("#HManagerID").val(sessionStorage["HKeeperID"]);      //负责人id
            $("#HManagerName").val(sessionStorage["HKeeper"]);      //负责人
            $("#HGroupID").val(sessionStorage["HGroupID"]);      //生产班组id
            $("#HGroupName").val(sessionStorage["HGroup"]);      //生产班组
            //选择生产资源弹窗
            form.on('submit(HSource)', function () {//生产资源
                console.log($('#HProcNo').val())
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '生产资源'
                    , shade: 0.6 //遮罩透明度
                    //, maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../Baseset/基础资料/Gy_GetProductionResourcesList.html', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            //选择负责人
            form.on('submit(HManager)', function () {
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '职员列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            //选择生产班组弹窗
            form.on('submit(HGroupList)', function () {//选择生产班组
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '本站工序'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../Baseset/基础资料/Gy_GetProductionTeamList.html', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            //以上为layui模块
        });
        //返回生产班组
        function GetProductionTeamValue(obj) {
            $("#HGroupName").val(obj[0].班组);
            $("#HGroupID").val(obj[0].HItemID);
        }
        //返回生产资源
        function GetProductionResourcesValue(obj) {
            $("#HSourceName").val(obj[0].生产资源);
            $("#HSourceID").val(obj[0].HItemID);
        }
        //返回操作员
        function GetHWorkerValue(obj) {
            $("#HManagerName").val(obj[0].HName);
            $("#HManagerID").val(obj[0].HItemID);
        }
    </script>
</body>
</html>
WebTM/views/Éú²ú¹ÜÀí/±¨¹¤Æ½Ì¨_PDA/²úÁ¿»ã±¨/Sc_Add_ProductReportBillList_PDA.html
New file
@@ -0,0 +1,933 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title class="sckgd">产量汇报单</title>
    <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, maximum-scale=1">
    <!--引用layui样式文件-->
    <link rel="stylesheet" href="../../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../../layuiadmin/style/admin.css" media="all">
    <!--引用layui js文件-->
    <script src="../../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <!--自定义样式-->
    <style>
        .layui-form-label {
            font-size: 14px;
            width: 85px;
            text-align: inherit;
        }
        /*全局设置输入框高度*/
        .layui-input {
            height: 30px;
        }
        /*设置表头输入框*/
        .t1_input {
            padding: 1%;
        }
        /*本站信息td*/
        .bz_td {
            display: -webkit-box; /*设置按钮不换行*/
            padding: 1%; /*设置输入框边距*/
        }
        /*设置本站信息按钮高度*/
        .bz_btu {
            height: 30px;
            width: 60px;
            line-height: 30px;
        }
        th {
            width: 70px;
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="layui-fluid" style="padding: 0;">
        <div class="layui-card">
            <div class="layui-card-body" style="padding: 1px;">
                <form class="layui-form" action="" lay-filter="formData" id="formData" style="background-color:white;">
                    <div style="background-color:#0085E8;">
                        <span style="color: white;" class="jzd"><i class="layui-icon layui-icon-form"></i>产量汇报单</span>
                    </div>
                    <div class="layui-form-item" style="margin: 1% 2%;text-align: right;">
                        <button type="button" lay-submit="" lay-filter="Add" class="layui-btn layui-btn-radius">新增</button>
                        <button type="button" lay-submit="" lay-filter="Saver" id="Saver" class="layui-btn layui-btn-radius">保存</button>
                        <button type="button" lay-submit="" lay-filter="Cancel" class="layui-btn layui-btn-radius layui-btn-danger">退出</button>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-tab layui-tab-card" lay-filter="TabTest">
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <table style="width:80%;">
                                        <tbody>
                                            <tr>
                                                <th>条形码</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HBarCode" class="layui-input" id="HBarCode" placeholder="请输入条形码后回车" style="border-radius: 50px;" disabled>
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu layui-btn-radius" lay-filter="QueDin" style="line-height: 30px;">确定</button>
                                                </td>
                                            </tr>
                                            <!--<tr>
        <th>设备</th>
        <td class="bz_td">
            <input type="text" name="HEquipName" class="layui-input" id="HEquipName" placeholder="请扫描设备二维码" style="border-radius: 50px;">
            <input type="hidden" name="HEquipID" id="HEquipID" value="0" autocomplete="off" class="layui-input">
        </td>
    </tr>-->
                                            <tr>
                                                <th>源单单号</th>
                                                <td class="bz_td">
                                                    <input type="hidden" name="HProcExchBillNo" id="HProcExchBillNo" class="layui-input" value="" style="border-radius: 50px;">
                                                    <input type="text" name="HSourceBillNo" id="HSourceBillNo" class="layui-input" value="" style="border-radius: 50px;">
                                                    <input type="hidden" name="HSourceInterID" id="HSourceInterID" class="layui-input" value="0" style="border-radius: 50px;">
                                                    <input type="hidden" name="HSourceEntryID" id="HSourceEntryID" class="layui-input" value="0" style="border-radius: 50px;">
                                                    <input type="hidden" name="HSourceBillType" id="HSourceBillType" class="layui-input" value="" style="border-radius: 50px;">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>生产订单</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HICMOBillNo" id="HICMOBillNo" class="layui-input" value="" style="border-radius: 50px;">
                                                    <input type="hidden" name="HICMOInterID" id="HICMOInterID" class="layui-input" value="0" style="border-radius: 50px;">
                                                    <input type="hidden" name="HICMOEntryID" id="HICMOEntryID" class="layui-input" value="0" style="border-radius: 50px;">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>生产资源</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HSourceName" class="layui-input" id="HSourceName" placeholder="选择生产资源" style="border-radius: 50px;">
                                                    <input type="hidden" name="HSourceID" id="HSourceID" value="0" autocomplete="off" class="layui-input">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="ProductionResources-BT" id="ProductionResources-BT" style="font-weight:bolder">...</button>
                                                </td>
                                            </tr>
                                            <!--<tr>
        <th>流水号</th>
        <td class="bz_td">
            <input type="text" name="HProcNo" class="layui-input" id="HProcNo" placeholder="选择流水号" style="background-color:#efefef4d;border-radius: 50px;">
            <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="SerialNum-BT" id="SerialNum-BT" style="font-weight:bolder">...</button>
        </td>
    </tr>
    <tr>
        <th>当前工序</th>
        <td class="bz_td">
            <input type="text" name="HProcName" class="layui-input" id="HProcName" placeholder="当前工序" style="border-radius: 50px;background-color:#efefef4d;" readonly>
            <input type="hidden" name="HProcID" id="HProcID" value="0" autocomplete="off" class="layui-input">
        </td>
    </tr>-->
                                            <tr>
                                                <th>产品代码</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMaterNumber" class="layui-input" id="HMaterNumber" placeholder="产品代码" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>产品名称</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMaterName" class="layui-input" id="HMaterName" placeholder="产品名称" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                    <input type="hidden" name="HMaterID" id="HMaterID" value="0" autocomplete="off" class="layui-input">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>计划数量</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HPlanQty" class="layui-input" id="HPlanQty" style="border-radius: 50px;" value="0">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>不良数量</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HBadQty" class="layui-input" id="HBadQty" style="border-radius: 50px;" value="0">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>报废数量</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HWasterQty" class="layui-input" id="HWasterQty" style="border-radius: 50px;" value="0">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>报工数量</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HQty" class="layui-input" id="HQty" style="border-radius: 50px;" value="0">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>生产班组</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HGroupName" class="layui-input" id="HGroupName" placeholder="选择生产班组" style="background-color:#efefef4d;border-radius: 50px;">
                                                    <input type="hidden" name="HGroupID" id="HGroupID" value="0" autocomplete="off" class="layui-input">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="ProductionTeam-BT" id="ProductionTeam-BT" style="font-weight:bolder">...</button>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>操作员</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HEmpName" class="layui-input" id="HEmpName" placeholder="选择接收人" style="background-color:#efefef4d;border-radius: 50px;" readonly>
                                                    <input type="hidden" name="HEmpID" id="HEmpID" value="0" autocomplete="off" class="layui-input">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="HEmployeeID-BT" id="HEmployeeID-BT" style="font-weight:bolder">...</button>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>车间</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HDeptName" class="layui-input set_height" id="HDeptName" placeholder="选择车间" style="border-radius: 50px; background-color: #efefef4d;" readonly>
                                                    <input type="hidden" name="HDeptID" id="HDeptID" value="0" autocomplete="off" class="layui-input set_height">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="btnHDept" id="btnHDept" style="font-weight:bolder;">...</button>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>生产班次</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HWorkShiftName" class="layui-input set_height" id="HWorkShiftName" placeholder="选择班次" style="border-radius: 50px; background-color: #efefef4d;" readonly>
                                                    <input type="hidden" name="HWorkShiftID" id="HWorkShiftID" value="0" autocomplete="off" class="layui-input set_height">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="btnHWorkShift" id="btnHWorkShift" style="font-weight:bolder;">...</button>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>开工时间</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HWorkBeginDate" class="layui-input" id="HWorkBeginDate" style="border-radius: 50px;" model="datetime" dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>报工时间</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HWorkReportDate" class="layui-input" id="HWorkReportDate" style="border-radius: 50px;" model="datetime" dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>单据日期</th>
                                                <td class="t1_input">
                                                    <input type="text" name="HDate" class="layui-input" id="HDate" style="border-radius: 50px;" placeholder="请选择日期" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>单据号</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HBillNo" class="layui-input" id="HBillNo" placeholder="单据号" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                    <input type="hidden" name="HInterID" id="HInterID" value="0" autocomplete="off" class="layui-input">
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="layui-tab-item">
                                    <table style="width:80%;">
                                        <tbody>
                                            <tr>
                                                <th>制单人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMaker" class="layui-input" id="HMaker" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>制单日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMakeDate" class="layui-input" id="HMakeDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>修改人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HUpDater" class="layui-input" id="HUpDater" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>修改日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HUpDateDate" class="layui-input" id="HUpDateDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>审核人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HChecker" class="layui-input" id="HChecker" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>审核日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HCheckDate" class="layui-input" id="HCheckDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>关闭人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HCloseMan" class="layui-input" id="HCloseMan" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>关闭日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HCloseDate" class="layui-input" id="HCloseDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>作废人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HDeleteMan" class="layui-input" id="HDeleteMan" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>作废日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HDeleteDate" class="layui-input" id="HDeleteDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                            </div>
                            <ul class="layui-tab-title">
                                <li class="layui-this">单据信息</li>
                                <li>制单信息</li>
                            </ul>
                        </div>
                    </div>
                    <!--隐藏字段-->
                    <input type="hidden" name="lngProcInterID" id="lngProcInterID">
                    <input type="hidden" name="lngBillKey" id="lngBillKey" value="0">
                    <input type="hidden" name="lngBillSubKey" id="lngBillSubKey" value="0">
                    <!--<input type="hidden" name="HMaker" id="HMaker">--><!--制单人-->
                    <input type="hidden" name="eventType" id="eventType" value="Add">
                    <input type="hidden" name="HeqSouID" id="HeqSouID" value="0">
                </form>
            </div>
        </div>
    </div>
    <script>
        //获取参数
        var HBillType = "";  //单据类型
        var HSourceInterID = ""; //源单主内码
        var HSourceEntryID = "";  //源单子内码
        var HSourceBillNo = "";   //源单单号
        var HSourceBillType = "";  //源单类型
        var refSav = "";   //提交类型
        //获取页面跳转参数  //单据编辑状态: 1.无源单新增  Â 2.有源单新增  Â 3.编辑  4.浏览  5.变更
        var params = get_UrlVars();
        if (typeof (params[params[0]]) == "undefined") {
            var OperationType = 1;//操作类型
        } else {
            var OperationType = params[params[0]];//操作类型
            var linterid = params[params[1]];//源单id
            var HSBillType = params[params[2]];//源单类型
        }
        var edit = function (data) {
            HBillType = data[0].HBillType;
            HSourceInterID = data[0].HSourceInterID;
            HSourceEntryID = data[0].HSourceEntryID;
            HSourceBillNo = data[0].HSourceBillNo;
            HSourceBillType = data[0].HSourceBillType;
        }
        layui.config({
            base: '../../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element','upload'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , laydate = layui.laydate
                , element = layui.element;
            //流转卡是否扫描标记
            var HProcExchBillNoFlag = false;
            //日期时间选择器
            laydate.render({
                elem: '#HWorkBeginDate'
                , type: 'datetime'
            });
            laydate.render({
                elem: '#HWorkReportDate'
                , type: 'datetime'
            });
            //判断是否新增
            if (OperationType == 1 || OperationType == 2 || OperationType == 5) {
                //获取最大单据号
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '3724' },
                    success: function (d) {
                        $("#HInterID").val(0);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        layer.close(ajaxLoad);
                    }
                    , error: function () {
                        layer.close(ajaxLoad);
                        layer.msg("获取单据号失败,请刷新重试!");
                    }
                });
                GetDefValByUser();
                set_AddNew();
            }
            //进入页面默认光标在条形码上
            $("#HBarCode").focus();
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //#region ç¡®å®šæŒ‰é’®
            form.on('submit(QueDin)', function (data) {//
                var HBarCode = $('#HBarCode').val();
                if (!HBarCode) {
                    layer.msg("条形码不能为空!")
                    return;
                }
                txtHBarCode_KeyDown(HBarCode);
            });
            //#endregion
            //#region æ–°å¢žæŒ‰é’®
            form.on('submit(Add)', function () {//提交
                layer.confirm('新增后页面数据将消失?', { icon: 3, title: '提示' }, function (index) {
                    location.replace('Sc_MESBeginWorkBillList_PDA.html?type=' + params[params[0]]);
                });
            })
            //#endregion
            //#region ä¿å­˜æŒ‰é’®
            form.on('submit(Saver)', function (data) {//提交
                var refSav = "";
                if (OperationType == 1 || OperationType == 2 || OperationType == 5) {
                    refSav = "Add";
                } else {
                    refSav = "Update";
                }
                if ($("#HSourceID").val() == '' || $("#HSourceID").val() == null || $("#HSourceID").val() == 0) {
                    layer.msg("生产资源不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HSourceInterID").val() == '' || $("#HSourceInterID").val() == null || $("#HSourceInterID").val() == 0) {
                    layer.msg("源单单号不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HEmpID").val() == '' || $("#HEmpID").val() == null||$("#HEmpID").val() == '0') {
                    layer.msg("操作员不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HGroupID").val() == '' || $("#HGroupID").val() == null || $("#HGroupID").val() == '0') {
                    layer.msg("班组不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HDeptID").val() == '' || $("#HDeptID").val() == null || $("#HDeptID").val() == '0') {
                    layer.msg("车间不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HICMOInterID").val() == '' || $("#HICMOInterID").val() == null || $("#HICMOInterID").val() == '0') {
                    layer.msg("生产订单不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if (!OverStepQty()) {
                    return Result = false;
                }
                var msg = JSON.stringify(data.field) + ";" + refSav;
                var index = layer.load();
                $.ajax({
                    type: "POST",
                    url: GetWEBURL() + "/Sc_MESBeginWorkBill/SaveGetMESProductReportFrom",
                    async: true,
                    data: { "msg": msg },
                    dataType: "json",
                    success: function (result) {
                        if (result.count == 1) {
                            $('#Saver').addClass("layui-btn-disabled").attr("disabled", true);//禁用保存按钮
                            $("#HInterID").val(result.HInterID);//获取提交成功返回的单据主ID
                            layer.msg(result.Message, { time: 1 * 2000, icon: 1 }, function (index) {
                                if (result.Verify == "Y") //自动审核
                                {
                                    layer.close(index);
                                    SaveVerify(); //审核
                                }
                                else {
                                    layer.close(index);
                                }
                            });
                            layer.close(index);
                        }
                        else {
                            layer.close(index);
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            });
            //#endregion
            //条形码回车方法
            $('#HBarCode').on('keydown', function (event) {
                var HBarCode = $('#HBarCode').val();
                if (event.keyCode == 13) {
                    if (!HBarCode) {
                        layer.msg("空白码,条形码不能为空!")
                        return;
                    }
                    txtHBarCode_KeyDown(HBarCode);
                }
            });
            //流水号(工序号)回车方法
            $('#HProcNo').on('keydown', function (event) {
                var sProcNo = $('#HProcNo').val();
                var sBillNo = $('#HMainSourceBillNo').val();
                if (event.keyCode == 13) {
                    if (!HProcExchBillNoFlag) {
                        layer.msg("流转卡没有扫描,或者没有按回车键,请扫描流转卡或者在流转卡文本框中按回车键!");
                        return;
                    }
                    txtHProcNo_KeyDown(sBillNo, sProcNo);
                }
            });
            //选择生产班组弹窗
            form.on('submit(ProductionTeam-BT)', function () {//选择生产班组
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '本站工序'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../Baseset/基础资料/Gy_GetProductionTeamList.html', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            //选择生产资源弹窗
            form.on('submit(ProductionResources-BT)', function () {//生产资源
                console.log($('#HProcNo').val())
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '生产资源'
                    , shade: 0.6 //遮罩透明度
                    //, maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../Baseset/基础资料/Gy_GetProductionResourcesList.html', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            //选择操作人
            form.on('submit(HEmployeeID-BT)', function () {
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '职员列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            //选择流水号弹窗
            form.on('submit(SerialNum-BT)', function () {//生产资源
                var value = $("#lngProcInterID").val();
                // åˆ¤æ–­æ˜¯å¦å·²ç»è¾“入流水号,是则弹出模态框,否则给出提示
                if (value) {
                    layer.open({
                        type: 2
                        , area: ['80%', '80%']
                        , title: '流水号'
                        , shade: 0.6 //遮罩透明度
                        //, maxmin: true //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: [`../../../Baseset/基础资料/Gy_GetProcNoList.html?HInterID=${value}`, 'yes']
                        , resize: false
                        , cancel: function (index, layero) {
                        }
                        , end: function () {
                            var sProcNo = $('#HProcNo').val();
                            var sBillNo = $('#HMainSourceBillNo').val();
                            if (sProcNo != "") {
                                txtHProcNo_KeyDown(sBillNo, sProcNo);
                            }
                        }
                    })
                } else {
                    layer.alert('请您确认输入流转卡号后重试^_^', { icon: 7 });
                }
            });
            //选择部门弹窗
            form.on('submit(btnHDept)', function () {//部门
                layer.open({
                    type: 2 //类型
                    , skin: 'layui-layer-rim'//加上边框
                    , area: ['90%', '90%']//大小
                    , title: '部门列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../../Baseset/基础资料/Gy_DepartmentList.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        //获取数据
                        $("#HDeptID").val(checkStatus.data[0].HItemID);
                        $("#HDeptName").val(checkStatus.data[0].HName);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                })
            });
            //退出--全屏版
            form.on('submit(Cancel)', function () {
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    parent.location.href = "../../../../views/index_Mobile.html";
                });
            })
            //新增
            form.on('submit(Add)', function () {
                var index = parent.layer.getFrameIndex(window.name); // å…ˆå¾—到当前 iframe å±‚的索引
                parent.layer.close(index); // å†æ‰§è¡Œå…³é—­
            })
            //#endregion
            //#region æœ¬é¡µé¢æ‰€æœ‰è¢«è°ƒç”¨çš„æ–¹æ³•
            //#region é€šè¿‡ç™»å½•用户获取默认值
            function GetDefValByUser() {
                var index = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Cj_StationInBill/GetDefValByUser",
                    type: "GET",
                    async: false,
                    data: { "Czybm": sessionStorage["Czybm"], "Czymc": sessionStorage["HUserName"] },
                    success: function (result) {
                        var data = result.data[0];
                        form.val("formData", {
                            //"HSourceID": data.HSourceID,
                            //"HSourceName": data.生产资源名称,
                            "HGroupID": data.HGroupID,
                            "HGroupName": data.生产班组名称,
                            "HEmpID": data.HEmpID,
                            "HEmpName": data.操作员名称
                        });
                        layer.close(index);
                    }
                    , error: function () {
                        layer.close(index);
                        layer.msg("接口请求失败");
                    }
                })
            }
            //#endregion
            //条形码回车方法
            function txtHBarCode_KeyDown(HBarCode) {
                var ajaxLoad = layer.load();
                var sql = "select * from Sc_ICMOBillStatus_Tmp where HICMOBillNo =  '" + HBarCode + "'" ;
                $.ajax({
                    url: GetWEBURL() + '/Gy_SOPBillList/WindowPrintList',
                    type: "GET",
                    async: false,
                    data: { "sWhere": sql },
                    success: function (data1) {
                        if (data1.count == 1) {
                            HSourceInterID = data1.data[0].HInterID;
                            HSourceEntryID = data1.data[0].HICMOEntryID;
                            HSourceBillNo = HBarCode;
                            HSourceBillType = data1.data[0].HBillType;
                        } else {
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                            layer.close(ajaxLoad);
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                        layer.close(ajaxLoad);
                    }
                });
                $.ajax(
                    {
                        type: "GET",
                        url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkFrom", //方法所在页面和方法名
                        async: false,
                        data: {
                            "HSourceInterID": HSourceInterID,
                            "HSourceEntryID": HSourceEntryID,
                            "HSourceBillNo": HSourceBillNo,
                            "HSourceBillType": HSourceBillType
                        },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1)// è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            {
                                var LoadData = data.data.h_p_JIT_GetInfoByICMOStatusInterID;
                                $("#HProcID").val(LoadData[0].HProcID); //当前工序ID
                                $("#HProcName").val(LoadData[0].HProcName); //当前工序
                                $("#HMaterID").val(LoadData[0].HMaterID); //产品ID
                                $("#HMaterCode").val(LoadData[0].HMaterNumber); //产品代码
                                $("#HMaterName").val(LoadData[0].HMaterName); //产品名称
                                $("#HMaterSpec").val(LoadData[0].HModel); //产品规格
                                $("#HSourceID").val(LoadData[0].HSourceID); //生产资源ID
                                $("#HSourceName").val(LoadData[0].HSourceName); //生产资源
                                $("#HMainSourceBillNo").val(LoadData[0].HICMOBillNo); //源单单号(暂时取值订单编号)
                                $("#HMainSourceInterID").val(LoadData[0].HSourceInterID); //源单主内码(取值HInterID)
                                $("#HMainSourceEntryID").val(LoadData[0].HSourceEntryID); //源单子内码(源单行号)
                                $("#HMainSourceBillType").val(HSourceBillType); //源单类型
                                $("#HDeptID").val(LoadData[0].HDeptID); //车间ID
                                $("#HDeptName").val(LoadData[0].HDeptName); //车间
                                $("#HICMOInterID").val(LoadData[0].HICMOInterID); //生产订单ID
                                $("#HICMOEntryID").val(LoadData[0].HICMOEntryID); //生产订单子ID
                                $("#HICMOBillNo").val(LoadData[0].HICMOBillNo); //生产订单
                                //HCenterID = LoadData[0].HCenterID == null ? sessionStorage["HWorkCenterID"] : LoadData[0].HCenterID;//工作中心id
                                layer.close(ajaxLoad);
                            }
                            else {
                                layer.alert(data.Message, { icon: 5 });
                                layer.close(ajaxLoad);
                            }
                        },
                        error: function (err) {
                            layer.alert(err, { icon: 5 });
                            layer.close(ajaxLoad);
                        }
                    });
            }
            //流水号回车方法
            function txtHProcNo_KeyDown(sBillNo, sProcNo) {
                var index = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Cj_StationInBill/txtHProcNo_KeyDown",
                    type: "GET",
                    data: { "sBillNo": sBillNo, "sProcNo": sProcNo },
                    success: function (result) {
                        if (result.count == 1) {
                            var data = result.data[0];
                            form.val("formData", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                                "HProcName": data.工序,
                                "HProcID": data.HProcID,
                                "HSourceID": data.HSourceID,
                                "HSourceName": data.生产资源
                            });
                            $("#HProcNo").attr("readonly", "readonly");
                            $("#HProcNo").css("background-color", "#efefef4d");
                            layer.close(index);
                        }
                        else {
                            layer.close(index);
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.msg("接口请求失败!" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            }
            //审核提交
            function SaveVerify() {
                var HSourceID = $("#HSourceID").val();  //生产资源ID
                var HSourceInterID = $("#HSourceInterID").val(); //源单主内码
                var HSourceEntryID = $("#HSourceEntryID").val();//源单子内码
                var HSourceBillNo = $("#HSourceBillNo").val();//源单单号
                var HICMOInterID = $("#HICMOInterID").val();//生产订单主ID
                var HICMOEntryID = $("#HICMOEntryID").val();//生产订单子ID
                var HInterID = $("#HInterID").val();//产量汇报临时表主ID
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/Sc_MESBeginWorkBill/MESProductAuditProcessReportList", //方法所在页面和方法名
                    async: true,
                    data: {
                        "HSourceID": HSourceID, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID,
                        "HSourceBillNo": HSourceBillNo, "HICMOInterID": HICMOInterID, "HICMOEntryID": HICMOEntryID,
                        "HInterID": HInterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"]
                    },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            layer.msg(data.Message, { time: 1 * 2000, icon: 1 }, function (index) {
                                //layer.close(layer.index);
                                //window.parent.location.reload();
                            });
                        }
                        else {
                            layer.alert(data.Message, { icon: 5 })
                        }
                    },
                    error: function (err) {
                        layer.alert(err, { icon: 5 })
                    }
                })
            }
            //有源单新增
            function set_AddNew() {
                //初始基本信息赋值
                $("#HDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));      //单据日期
                $("#HWorkReportDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"))  //报工日期
                $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));  //制单日期
                $("#HMaker").val(sessionStorage["HUserName"]);     //制单人
                //加源单类型区分(可以写不同的方法)
                $('#HProcName').attr("disabled", true);
                $('#HSourceName').attr("disabled", true);
                $('#ProductionResources-BT').addClass("layui-btn-disabled").attr("disabled", true);
                $('#HSourceBillNo').attr("disabled", true);
                $('#HICMOBillNo').attr("disabled", true);
                $('#HDeptName').attr("disabled", true);
                $('#btnHDept').addClass("layui-btn-disabled").attr("disabled", true);
                $('#HWorkBeginDate').attr("disabled", true);
                $('#HWorkReportDate').attr("disabled", true);
                $('#HPlanQty').attr("disabled", true);
                $.ajax(
                    {
                        type: "GET",
                        url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkFrom", //方法所在页面和方法名
                        async: false,
                        data: {
                            "HSourceInterID": HSourceInterID,
                            "HSourceEntryID": HSourceEntryID,
                            "HSourceBillNo": HSourceBillNo,
                            "HSourceBillType": HBillType
                        },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1)// è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            {
                                var LoadData = data.data.h_p_JIT_GetInfoByICMOStatusInterID;
                                $("#HProcID").val(LoadData[0].HProcID); //当前工序ID
                                $("#HProcName").val(LoadData[0].HProcName); //当前工序
                                $("#HMaterID").val(LoadData[0].HMaterID); //产品ID
                                $("#HMaterNumber").val(LoadData[0].HMaterNumber); //产品代码
                                $("#HMaterName").val(LoadData[0].HMaterName); //产品名称
                                $("#HSourceID").val(LoadData[0].HSourceID); //生产资源ID
                                $("#HSourceName").val(LoadData[0].HSourceName); //生产资源
                                $("#HSourceBillNo").val(LoadData[0].HICMOBillNo); //源单单号(暂时取值订单编号)
                                $("#HSourceInterID").val(LoadData[0].HSourceInterID); //源单主内码(取值HInterID)
                                $("#HSourceEntryID").val(LoadData[0].HSourceEntryID); //源单子内码(源单行号)
                                $("#HSourceBillType").val(HSourceBillType); //源单类型
                                $("#HDeptID").val(LoadData[0].HDeptID); //车间ID
                                $("#HDeptName").val(LoadData[0].HDeptName); //车间
                                $("#HICMOInterID").val(LoadData[0].HICMOInterID); //生产订单ID
                                $("#HICMOEntryID").val(LoadData[0].HICMOEntryID); //生产订单子ID
                                $("#HICMOBillNo").val(LoadData[0].HICMOBillNo); //生产订单
                                $("#HWorkBeginDate").val(LoadData[0].HBeginDate); //开工时间
                                $("#HPlanQty").val(LoadData[0].HDatePlanQty); //计划数量
                                //HCenterID = LoadData[0].HCenterID == null ? sessionStorage["HWorkCenterID"] : LoadData[0].HCenterID;//工作中心id
                            }
                            else {
                                layer.alert(data.Message, { icon: 5 });
                            }
                        },
                        error: function (err) {
                            layer.alert(err, { icon: 5 });
                        }
                    });
            }
            //验证汇报数量是否超过计划数量
            function OverStepQty() {
                var sWhere = "";
                var flag = true;
                sWhere = " where  HSourceID='" + $("#HSourceID").val() + "' and  HSourceInterID='" + HSourceInterID + "' and HSourceEntryID='" + HSourceEntryID + "' and HSourceBillNo='" + HSourceBillNo + "' and HSourceBillType='" + HSourceBillType + "' ";
                $.ajax({
                    url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESOverStepQty",
                    type: "GET",
                    data: { "sWhere": sWhere },
                    dataType: "json",//数据类型可以为 text xml json  script  jsonp
                    async: false,
                    success: function (datas) {
                        var LoadData = datas.data.Sc_ICMOBillWorkQtyStatus_Tmp;
                        var HQty = LoadData[0].HQty;
                        var HBadQty = LoadData[0].HBadQty;
                        var HWasterQty = LoadData[0].HWasterQty;
                        var yessqty = HQty + HBadQty + HWasterQty;
                        var sumqty = parseFloat($("#HQty").val()) + yessqty;
                        if (sumqty > parseFloat($("#HPlanQty").val())) {
                            layer.confirm("已汇报数量:【" + yessqty + "】,当前汇报数量:【" + parseFloat($("#HQty").val()) + "】不能大于计划数量:【" + parseFloat($("#HPlanQty").val()) + "】!", {
                                btn: ['确认', '取消']
                            }, function (index) {
                                //关闭当前frame
                                layer.close(index);
                                //Submit(data);
                            }, function () {
                            });
                            flag = false;
                        }
                    },
                    error: function (err) {
                        layer.alert(err, { icon: 5 })
                        flag = false;
                    }
                });
                return flag;
            }
            //以上为layui模块
        });
        //返回流水号
        function GetProcNoValue(obj) {
            $("#HProcNo").val(obj[0].流水号);
        }
        //返回生产班组
        function GetProductionTeamValue(obj) {
            $("#HGroupName").val(obj[0].班组);
            $("#HGroupID").val(obj[0].HItemID);
        }
        //返回生产资源
        function GetProductionResourcesValue(obj) {
            $("#HSourceName").val(obj[0].生产资源);
            $("#HSourceID").val(obj[0].HItemID);
        }
        //返回操作员
        function GetHWorkerValue(obj) {
            $("#HEmpName").val(obj[0].HName);
            $("#HEmpID").val(obj[0].HItemID);
        }
        //返回当前工序
        function GetHProcValue(obj) {  //返回当前工序
            $("#HProcName").val(obj[0].工序);
            $("#HProcID").val(obj[0].HItemID);
        }
    </script>
</body>
</html>
WebTM/views/Éú²ú¹ÜÀí/±¨¹¤Æ½Ì¨_PDA/²úÁ¿»ã±¨/Sc_ProductReportBillList_PDA.html
New file
@@ -0,0 +1,555 @@
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>产量汇报单列表</title>
    <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, maximum-scale=1">
    <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/Scripts/json2.js"></script>
    <script src="../../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <style type="text/css">
        input.layui-input.layui-unselect {
            padding-right: 0;
        }
    </style>
</head>
<body>
    <div class="layui-fluid">
        <div class="layui-col-md12">
            <div class="layui-card" style="padding: 1px">
                <div class="layui-card-body" style="padding: 1px;">
                    <form class="layui-form" action="" lay-filter="component-form-group">
                        <div class="layui-collapse">
                            <div>
                                <div class="layui-inline">
                                    <label class="layui-form-label" style="width: 30px;">日期</label>
                                    <input type="date" class="layui-input" id="HBeginDate" style="width:110px;" placeholder="yyyy-MM-dd">
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label" style="width:5px">-</label>
                                </div>
                                <div class="layui-inline">
                                    <input type="date" class="layui-input" id="HEndDate" style="width:110px;" placeholder="yyyy-MM-dd">
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label" style="width: 60px;">生产订单号</label>
                                    <div class="layui-input-block" style="margin-left: 90px;">
                                        <input type="text" class="layui-input" name="HICMOBillNo" id="HICMOBillNo" style="width:120px">
                                    </div>
                                </div>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                </button>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btnDel"><i class="layui-icon layui-icon-delete"></i>删除</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>退出</button>
                            </div>
                        </script>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <script>
        layui.config({
            base: '../../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
            //#region å…¬å…±å˜é‡
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , element = layui.element
                , laypage = layui.laypage
                , laydate = layui.laydate
                , util = layui.util
            //查询条件
            var sWhere = "";
            var option = [];
            var HModName = "Sc_ProductReportBillList_PDA";
            //#endregion
            //#region è¿›å…¥é¡µé¢æ—¢åŠ è½½
            //#region åˆå§‹åŒ–界面
            set_ClearBill();
            //#endregion
            //#region ç‚¹å‡»äº‹ä»¶åŒ…括on form事件等
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                switch (obj.event) {
                    //审核
                    case 'btnCheck': btnCheck(1);
                        break;
                    //反审核
                    case 'btnAdutCheck': btnCheck(2);
                        break;
                    //删除
                    case 'btnDel': btnDel();
                        break;
                    //退出
                    case 'btn-exit': parent.location.href = "../../../../views/index_Mobile.html";
                        break;
                };
            });
            //重置按钮
            form.on('submit(btnReSearch)', function (data) {
                set_ClearQuery();
            });
            //查询按钮
            form.on('submit(btnSearch)', function (data) {
                get_FastQuery();
            });
            //行监听事件-单击
            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
            //#region æ­¤é¡µé¢æ‰€æœ‰çš„æ–¹æ³•
            //初始化界面
            function set_ClearBill() {
                //初始化时间
                $("#HBeginDate").val(Format(new Date() - 1000 * 60 * 60 * 24 * 30, "yyyy-MM-dd"));
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                //初始化表格
                set_InitGrid();
                //加载数据到网格
                get_FastQuery();
            }
            //初始化表格
            function set_InitGrid() {
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , page: true
                    , totalRow: true
                    , cellMinWidth: 80
                    , limit: 50
                    , cols:[ [
                        //{
                        //    "type": "checkbox",
                        //    "fixed": "left"
                        //},
                        {
                            "field": "HInterID",
                            "title": "HInterID",
                            "align": "center",
                            "hide": true
                        },
                        {
                            "field": "单据号",
                            "title": "单据号",
                            "align": "center",
                            "hide": true
                        },
                        {
                            "field": "日期",
                            "title": "日期",
                            "align": "center",
                            "hide": true
                        },
                        {
                            "field": "HBillStatus",
                            "title": "HBillStatus",
                            "align": "center",
                            "hide": true
                        },
                        {
                            "field": "产品代码",
                            "title": "产品代码",
                            "align": "center",
                            "width":100
                        },
                        {
                            "field": "产品名称",
                            "title": "产品名称",
                            "align": "center",
                            "width": 100
                        },
                        {
                            "field": "汇报类型",
                            "title": "汇报类型",
                            "align": "center",
                            "hide": true
                        },
                        {
                            "field": "汇报数量",
                            "title": "汇报数量",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "不良数量",
                            "title": "不良数量",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "报废数量",
                            "title": "报废数量",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "产品规格",
                            "title": "产品规格",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "生产资源代码",
                            "title": "生产资源代码",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "生产资源",
                            "title": "生产资源",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "生产班组代码",
                            "title": "生产班组代码",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "生产班组",
                            "title": "生产班组",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "操作员",
                            "title": "操作员",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "开工时间",
                            "title": "开工时间",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "报工时间",
                            "title": "报工时间",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "制单人",
                            "title": "制单人",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "制单日期",
                            "title": "制单日期",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "审核人",
                            "title": "审核人",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "审核日期",
                            "title": "审核日期",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "修改人",
                            "title": "修改人",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "修改日期",
                            "title": "修改日期",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "关闭人",
                            "title": "关闭人",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "关闭日期",
                            "title": "关闭日期",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "作废人",
                            "title": "作废人",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "作废日期",
                            "title": "作废日期",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "生产订单号",
                            "title": "生产订单号",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "HICMOInterID",
                            "title": "HICMOInterID",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "HICMOEntryID",
                            "title": "HICMOEntryID",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "HSourceInterID",
                            "title": "HSourceInterID",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "HSourceEntryID",
                            "title": "HSourceEntryID",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "源单单号",
                            "title": "源单单号",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "源单类型",
                            "title": "源单类型",
                            "align": "center",
                            "sort": true
                        },
                        {
                            "field": "HRelationInterID",
                            "title": "HRelationInterID",
                            "align": "center",
                            "sort": true
                        }
                    ]]
                    //, limits: [50, 500, 5000, 20000]
                    , done: function (res, curr, count) {
                    }
                };
            }
            //加载网格
            function get_Display(sWhere) {
                //动态列-缓存列表
                $.ajax({
                    url: GetWEBURL() + "/Sc_MESProductReportStepBill/Get_Sc_MESProductReportBillList",
                    type: "GET",
                    async: false,
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.count == 1) {
                            //var data = [];
                            //var col = [];
                            ////给空的数组赋值
                            //for (var key in data1.list) {
                            //    data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                            //}
                            ////在列表左边添加勾选框
                            //col.push({ type: 'checkbox', fixed: 'left' });
                            //for (var i = 0; i < data.length; i++) {
                            //    if ($.inArray(data[i].name, "") > -1) {
                            //        col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                            //    }
                            //    else {
                            //        switch (data[i].Type) {
                            //            //int
                            //            case 'DateTime':
                            //                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true });
                            //                break;
                            //            default:
                            //                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true });
                            //        }
                            //    }
                            //}
                            //debugger
                            //option = {
                            //    elem: '#mainTable'
                            //    , toolbar: '#toolbarDemo'
                            //    , cellMinWidth: 120
                            //    , page: true
                            //    , limit: 50
                            //    , limits: [50, 500, 5000, 20000]
                            //    , height: 'full-70'
                            //    , totalRow: false //开启合计
                            //    , cols: [col]
                            //    , data: data1.data
                            //};
                            option.data = data1.data;
                            table.render(option);
                        }
                    },
                    error: function (err) {
                        layer.msg('错误' + err, {
                            icon: 5,
                            time: 20000
                        }, function () {
                            //do something
                        });
                    }
                })
            }
            //快速过滤
            function get_FastQuery() {
                var HBeginDate = $("#HBeginDate").val();//下达日期 å¼€å§‹æ—¥æœŸ
                var HEndDate = $("#HEndDate").val();//结束日期
                var HICMOBillNo = $("#HICMOBillNo").val();
                if (HBeginDate) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + HBeginDate + "'";
                }
                if (HEndDate) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) <= '" + HEndDate + "'";
                }
                if (HICMOBillNo != "") {
                    sWhere += "and ç”Ÿäº§è®¢å•号 like '" + HICMOBillNo + "'"
                }
                get_Display(sWhere);
                //调用接口后清空sWhere缓存
                sWhere = "";
            }
            //重置过滤条件
            function set_ClearQuery() {
                //初始化时间
                $("#HBeginDate").val(Format(new Date() - 1000 * 60 * 60 * 24 * 30, "yyyy-MM-dd"));
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                $("#HMaterNumber").val("");
                $("#HICMOBillNo").val("");
                sWhere = "";
            }
            //删除
            function btnDel() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].HInterID.toString();
                    var HICMOInID = data[0].HSourceInterID.toString();
                    var HICMOEnID = data[0].HSourceEntryID.toString();
                    var HBillStatus = data[0].HBillStatus.toString();
                    if (HBillStatus == 2) {
                        layer.msg('单据已报检审核无法删除!');
                        return false;
                    }
                    //逻辑删除方法
                    layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                        $.ajax({
                            type: "GET",
                            url: GetWEBURL() + "Sc_MESBeginStepWorkBill/DeltetMESProductReportBill", //方法所在页面和方法名
                            data: { "HInterID": InterID, "HICMOInterID": HICMOInID, "HICMOEntryID": HICMOEnID, "UserName": sessionStorage["HUserName"] },
                            success: function (result) {
                                if (result.count == 1) {
                                    layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                        // å¾—到frame索引
                                        var index = layer.getFrameIndex(window.name);
                                        //关闭当前frame
                                        layer.close(index);
                                        //修改为功后刷新界面
                                        window.location.reload();
                                    });
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                }
                            }, error: function () {
                                layer.alert("接口请求失败!", { icon: 5 });
                                return false;
                            }
                        });
                    })
                }
                else {
                    layer.msg('请选择一行数据删除!');
                }
            }
            //#endregion
        });
    </script>
</body>
</html>
WebTM/views/Éú²ú¹ÜÀí/±¨¹¤Æ½Ì¨_PDA/Í£¹¤/Sc_Add_MESStopWorkBillList_PDA.html
New file
@@ -0,0 +1,900 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title class="sckgd">生产停工单</title>
    <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, maximum-scale=1">
    <!--引用layui样式文件-->
    <link rel="stylesheet" href="../../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../../layuiadmin/style/admin.css" media="all">
    <!--引用layui js文件-->
    <script src="../../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <!--自定义样式-->
    <style>
        .layui-form-label {
            font-size: 14px;
            width: 85px;
            text-align: inherit;
        }
        /*全局设置输入框高度*/
        .layui-input {
            height: 30px;
        }
        /*设置表头输入框*/
        .t1_input {
            padding: 1%;
        }
        /*本站信息td*/
        .bz_td {
            display: -webkit-box; /*设置按钮不换行*/
            padding: 1%; /*设置输入框边距*/
        }
        /*设置本站信息按钮高度*/
        .bz_btu {
            height: 30px;
            width: 60px;
            line-height: 30px;
        }
        th {
            width: 70px;
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="layui-fluid" style="padding: 0;">
        <div class="layui-card">
            <div class="layui-card-body" style="padding: 1px;">
                <form class="layui-form" action="" lay-filter="formData" id="formData" style="background-color:white;">
                    <div style="background-color:#0085E8;">
                        <span style="color: white;" class="jzd"><i class="layui-icon layui-icon-form"></i>生产停工单</span>
                    </div>
                    <div class="layui-form-item" style="margin: 1% 2%;text-align: right;">
                        <button type="button" lay-submit="" lay-filter="Add" class="layui-btn layui-btn-radius">新增</button>
                        <button type="button" lay-submit="" lay-filter="Saver" id="Saver" class="layui-btn layui-btn-radius">保存</button>
                        <button type="button" lay-submit="" lay-filter="Cancel" class="layui-btn layui-btn-radius layui-btn-danger">退出</button>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-tab layui-tab-card" lay-filter="TabTest">
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <table style="width:80%;">
                                        <tbody>
                                            <tr>
                                                <th>条形码</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HBarCode" class="layui-input" id="HBarCode" placeholder="请输入条形码后回车" style="border-radius: 50px;" disabled>
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu layui-btn-radius" lay-filter="QueDin" style="line-height: 30px;">确定</button>
                                                </td>
                                            </tr>
                                            <!--<tr>
        <th>设备</th>
        <td class="bz_td">
            <input type="text" name="HEquipName" class="layui-input" id="HEquipName" placeholder="请扫描设备二维码" style="border-radius: 50px;">
            <input type="hidden" name="HEquipID" id="HEquipID" value="0" autocomplete="off" class="layui-input">
        </td>
    </tr>-->
                                            <tr>
                                                <th>源单单号</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMainSourceBillNo" id="HMainSourceBillNo" class="layui-input" value="" style="border-radius: 50px;">
                                                    <input type="hidden" name="HMainSourceInterID" id="HMainSourceInterID" class="layui-input" value="0" style="border-radius: 50px;">
                                                    <input type="hidden" name="HMainSourceEntryID" id="HMainSourceEntryID" class="layui-input" value="0" style="border-radius: 50px;">
                                                    <input type="hidden" name="HMainSourceBillType" id="HMainSourceBillType" class="layui-input" value="" style="border-radius: 50px;">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>生产订单</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HICMOBillNo" id="HICMOBillNo" class="layui-input" value="" style="border-radius: 50px;">
                                                    <input type="hidden" name="HICMOInterID" id="HICMOInterID" class="layui-input" value="0" style="border-radius: 50px;">
                                                    <input type="hidden" name="HICMOEntryID" id="HICMOEntryID" class="layui-input" value="0" style="border-radius: 50px;">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>生产资源</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HSourceName" class="layui-input" id="HSourceName" placeholder="选择生产资源" style="border-radius: 50px;">
                                                    <input type="hidden" name="HSourceID" id="HSourceID" value="0" autocomplete="off" class="layui-input">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="ProductionResources-BT" id="ProductionResources-BT" style="font-weight:bolder">...</button>
                                                </td>
                                            </tr>
                                            <!--<tr>
        <th>流水号</th>
        <td class="bz_td">
            <input type="text" name="HProcNo" class="layui-input" id="HProcNo" placeholder="选择流水号" style="background-color:#efefef4d;border-radius: 50px;">
            <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="SerialNum-BT" id="SerialNum-BT" style="font-weight:bolder">...</button>
        </td>
    </tr>
    <tr>
        <th>当前工序</th>
        <td class="bz_td">
            <input type="text" name="HProcName" class="layui-input" id="HProcName" placeholder="当前工序" style="border-radius: 50px;background-color:#efefef4d;" readonly>
            <input type="hidden" name="HProcID" id="HProcID" value="0" autocomplete="off" class="layui-input">
        </td>
    </tr>-->
                                            <tr>
                                                <th>产品代码</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMaterNumber" class="layui-input" id="HMaterNumber" placeholder="产品代码" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>产品名称</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMaterName" class="layui-input" id="HMaterName" placeholder="产品名称" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                    <input type="hidden" name="HMaterID" id="HMaterID" value="0" autocomplete="off" class="layui-input">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>开始时间</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HStopBeginWorkTime" class="layui-input" id="HStopBeginWorkTime" style="border-radius: 50px;" model="datetime" dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>结束时间</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HStopEndWorkTime" class="layui-input" id="HStopEndWorkTime" style="border-radius: 50px;" model="datetime" dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>停工类型</th>
                                                <td class="bz_td">
                                                    <select name="HStopType" id="HStopType" lay-verify="HStopType" style="border-radius: 50px;">
                                                        <option value="">请选择停工原因</option>
                                                        <option value="模具保养">模具保养</option>
                                                        <option value="断料">断料</option>
                                                        <option value="人员不足">人员不足</option>
                                                        <option value="停气">停气</option>
                                                        <option value="停水">停水</option>
                                                        <option value="停电">停电</option>
                                                        <option value="模具故障">模具故障</option>
                                                        <option value="监控报警">监控报警</option>
                                                        <option value="自动化故障">自动化故障</option>
                                                        <option value="注塑机故障">注塑机故障</option>
                                                        <option value="尺寸异常">尺寸异常</option>
                                                        <option value="计划停机">计划停机</option>
                                                        <option value="外观不良调机">外观不良调机</option>
                                                        <option value="模具清洁">模具清洁</option>
                                                        <option value="模温机故障">模温机故障</option>
                                                        <option value="烘料机故障">烘料机故障</option>
                                                    </select>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>停工原因</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HStopReason" class="layui-input" id="HStopReason" value="" placeholder="" style="border-radius: 50px;">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>生产班组</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HGroupName" class="layui-input" id="HGroupName" placeholder="选择生产班组" style="background-color:#efefef4d;border-radius: 50px;">
                                                    <input type="hidden" name="HGroupID" id="HGroupID" value="0" autocomplete="off" class="layui-input">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="ProductionTeam-BT" id="ProductionTeam-BT" style="font-weight:bolder">...</button>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>操作员</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HEmpName" class="layui-input" id="HEmpName" placeholder="选择接收人" style="background-color:#efefef4d;border-radius: 50px;" readonly>
                                                    <input type="hidden" name="HEmpID" id="HEmpID" value="0" autocomplete="off" class="layui-input">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="HEmployeeID-BT" id="HEmployeeID-BT" style="font-weight:bolder">...</button>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>车间</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HDeptName" class="layui-input set_height" id="HDeptName" placeholder="选择车间" style="border-radius: 50px; background-color: #efefef4d;" readonly>
                                                    <input type="hidden" name="HDeptID" id="HDeptID" value="0" autocomplete="off" class="layui-input set_height">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="btnHDept" id="btnHDept" style="font-weight:bolder;">...</button>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>生产班次</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HWorkShiftName" class="layui-input set_height" id="HWorkShiftName" placeholder="选择班次" style="border-radius: 50px; background-color: #efefef4d;" readonly>
                                                    <input type="hidden" name="HWorkShiftID" id="HWorkShiftID" value="0" autocomplete="off" class="layui-input set_height">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="btnHWorkShift" id="btnHWorkShift" style="font-weight:bolder;">...</button>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>备注</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HRemark" class="layui-input" id="HRemark" placeholder="备注" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>单据日期</th>
                                                <td class="t1_input">
                                                    <input type="text" name="HDate" class="layui-input" id="HDate" style="border-radius: 50px;" placeholder="请选择日期" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>单据号</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HBillNo" class="layui-input" id="HBillNo" placeholder="单据号" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                    <input type="hidden" name="HInterID" id="HInterID" value="0" autocomplete="off" class="layui-input">
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="layui-tab-item">
                                    <table style="width:80%;">
                                        <tbody>
                                            <tr>
                                                <th>制单人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMaker" class="layui-input" id="HMaker" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>制单日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMakeDate" class="layui-input" id="HMakeDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>修改人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HUpDater" class="layui-input" id="HUpDater" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>修改日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HUpDateDate" class="layui-input" id="HUpDateDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>审核人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HChecker" class="layui-input" id="HChecker" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>审核日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HCheckDate" class="layui-input" id="HCheckDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>关闭人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HCloseMan" class="layui-input" id="HCloseMan" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>关闭日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HCloseDate" class="layui-input" id="HCloseDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>作废人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HDeleteMan" class="layui-input" id="HDeleteMan" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>作废日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HDeleteDate" class="layui-input" id="HDeleteDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                            </div>
                            <ul class="layui-tab-title">
                                <li class="layui-this">单据信息</li>
                                <li>制单信息</li>
                            </ul>
                        </div>
                    </div>
                    <!--隐藏字段-->
                    <input type="hidden" name="lngProcInterID" id="lngProcInterID">
                    <input type="hidden" name="lngBillKey" id="lngBillKey" value="0">
                    <input type="hidden" name="lngBillSubKey" id="lngBillSubKey" value="0">
                    <!--<input type="hidden" name="HMaker" id="HMaker">--><!--制单人-->
                    <input type="hidden" name="eventType" id="eventType" value="Add">
                    <input type="hidden" name="HeqSouID" id="HeqSouID" value="0">
                </form>
            </div>
        </div>
    </div>
    <script>
        var HBillType = "";  //单据类型
        var HSourceInterID = ""; //源单主内码
        var HSourceEntryID = "";  //源单子内码
        var HSourceBillNo = "";   //源单单号
        var HSourceBillType = "";  //源单类型
        //获取页面跳转参数  //单据编辑状态: 1.无源单新增  Â 2.有源单新增  Â 3.编辑  4.浏览  5.变更
        var params = get_UrlVars();
        if (typeof (params[params[0]]) == "undefined") {
            var OperationType = 1;//操作类型
        } else {
            var OperationType = params[params[0]];//操作类型
            var linterid = params[params[1]];//源单id
            var HSBillType = params[params[2]];//源单类型
        }
        var edit = function (data) {
            HBillType = data[0].HBillType;
            HSourceInterID = data[0].HSourceInterID;
            HSourceEntryID = data[0].HSourceEntryID;
            HSourceBillNo = data[0].HSourceBillNo;
            HSourceBillType = data[0].HSourceBillType;
        }
        layui.config({
            base: '../../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element','upload'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , laydate = layui.laydate
                , element = layui.element;
            //流转卡是否扫描标记
            var HProcExchBillNoFlag = false;
            //加载时间控件
            laydate.render({
                elem: '#HStopBeginWorkTime'
                , type: 'datetime'
            });
            laydate.render({
                elem: '#HStopEndWorkTime'
                , type: 'datetime'
            });
            //判断是否新增
            if (OperationType == 1 || OperationType == 2 || OperationType == 5) {
                //获取最大单据号
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '3702' },
                    success: function (d) {
                        $("#HInterID").val(0);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        layer.close(ajaxLoad);
                    }
                    , error: function () {
                        layer.close(ajaxLoad);
                        layer.msg("获取单据号失败,请刷新重试!");
                    }
                });
                GetDefValByUser();
                set_AddNew();
            }
            //进入页面默认光标在条形码上
            $("#HBarCode").focus();
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //#region ç¡®å®šæŒ‰é’®
            form.on('submit(QueDin)', function (data) {//
                var HBarCode = $('#HBarCode').val();
                if (!HBarCode) {
                    layer.msg("条形码不能为空!")
                    return;
                }
                txtHBarCode_KeyDown(HBarCode);
            });
            //#endregion
            //#region æ–°å¢žæŒ‰é’®
            form.on('submit(Add)', function () {//提交
                layer.confirm('新增后页面数据将消失?', { icon: 3, title: '提示' }, function (index) {
                    location.replace('Sc_MESBeginWorkBillList_PDA.html?type=' + params[params[0]]);
                });
            })
            //#endregion
            //#region ä¿å­˜æŒ‰é’®
            form.on('submit(Saver)', function (data) {//提交
                var refSav = "";
                if (OperationType == 1 || OperationType == 2 || OperationType == 5) {
                    refSav = "Add";
                } else {
                    refSav = "Update";
                }
                if ($("#HStopEndWorkTime").val() == '' || $("#HStopBeginWorkTime").val() == null) {
                    layer.msg("预计结束时间不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HSourceID").val() == '' || $("#HSourceID").val() == null || $("#HSourceID").val() == 0) {
                    layer.msg("生产资源不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HMainSourceInterID").val() == '' || $("#HMainSourceInterID").val() == null || $("#HMainSourceInterID").val() == 0) {
                    layer.msg("源单单号不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HEmpID").val() == '' || $("#HEmpID").val() == null||$("#HEmpID").val() == '0') {
                    layer.msg("操作员不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HGroupID").val() == '' || $("#HGroupID").val() == null || $("#HGroupID").val() == '0') {
                    layer.msg("班组不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HDeptID").val() == '' || $("#HDeptID").val() == null || $("#HDeptID").val() == '0') {
                    layer.msg("车间不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HICMOInterID").val() == '' || $("#HICMOInterID").val() == null || $("#HICMOInterID").val() == '0') {
                    layer.msg("生产订单不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HStopType").val() == '' || $("#HStopType").val() == null) {
                    layer.msg("停工类型不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HStopReason").val() == '' || $("#HStopReason").val() == null) {
                    layer.msg("停工原因不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                var msg = JSON.stringify(data.field) + ";" + sessionStorage["HUserName"] + ";" + refSav;
                var index = layer.load();
                $.ajax({
                    type: "POST",
                    url: GetWEBURL() + "/Sc_MESStopWorkBill/SaveGetMESStopFrom",
                    async: true,
                    data: { "msg": msg },
                    dataType: "json",
                    success: function (result) {
                        if (result.count == 1) {
                            $('#Saver').addClass("layui-btn-disabled").attr("disabled", true);//禁用保存按钮
                            $("#HInterID").val(result.HInterID);//获取提交成功返回的单据主ID
                            layer.msg(result.Message, { time: 1 * 2000, icon: 1 }, function (index) {
                                if (result.Verify == "Y") //自动审核
                                {
                                    layer.close(index);
                                    SaveVerify(); //审核
                                }
                                else {
                                    layer.close(index);
                                }
                            });
                            layer.close(index);
                        }
                        else {
                            layer.close(index);
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            });
            //#endregion
            //条形码回车方法
            $('#HBarCode').on('keydown', function (event) {
                var HBarCode = $('#HBarCode').val();
                if (event.keyCode == 13) {
                    if (!HBarCode) {
                        layer.msg("空白码,条形码不能为空!")
                        return;
                    }
                    txtHBarCode_KeyDown(HBarCode);
                }
            });
            //流水号(工序号)回车方法
            $('#HProcNo').on('keydown', function (event) {
                var sProcNo = $('#HProcNo').val();
                var sBillNo = $('#HMainSourceBillNo').val();
                if (event.keyCode == 13) {
                    if (!HProcExchBillNoFlag) {
                        layer.msg("流转卡没有扫描,或者没有按回车键,请扫描流转卡或者在流转卡文本框中按回车键!");
                        return;
                    }
                    txtHProcNo_KeyDown(sBillNo, sProcNo);
                }
            });
            //选择生产班组弹窗
            form.on('submit(ProductionTeam-BT)', function () {//选择生产班组
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '本站工序'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../Baseset/基础资料/Gy_GetProductionTeamList.html', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            //选择生产资源弹窗
            form.on('submit(ProductionResources-BT)', function () {//生产资源
                console.log($('#HProcNo').val())
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '生产资源'
                    , shade: 0.6 //遮罩透明度
                    //, maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../Baseset/基础资料/Gy_GetProductionResourcesList.html', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            //选择操作人
            form.on('submit(HEmployeeID-BT)', function () {
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '职员列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            //选择流水号弹窗
            form.on('submit(SerialNum-BT)', function () {//生产资源
                var value = $("#lngProcInterID").val();
                // åˆ¤æ–­æ˜¯å¦å·²ç»è¾“入流水号,是则弹出模态框,否则给出提示
                if (value) {
                    layer.open({
                        type: 2
                        , area: ['80%', '80%']
                        , title: '流水号'
                        , shade: 0.6 //遮罩透明度
                        //, maxmin: true //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: [`../../../Baseset/基础资料/Gy_GetProcNoList.html?HInterID=${value}`, 'yes']
                        , resize: false
                        , cancel: function (index, layero) {
                        }
                        , end: function () {
                            var sProcNo = $('#HProcNo').val();
                            var sBillNo = $('#HMainSourceBillNo').val();
                            if (sProcNo != "") {
                                txtHProcNo_KeyDown(sBillNo, sProcNo);
                            }
                        }
                    })
                } else {
                    layer.alert('请您确认输入流转卡号后重试^_^', { icon: 7 });
                }
            });
            //选择部门弹窗
            form.on('submit(btnHDept)', function () {//部门
                layer.open({
                    type: 2 //类型
                    , skin: 'layui-layer-rim'//加上边框
                    , area: ['90%', '90%']//大小
                    , title: '部门列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../../Baseset/基础资料/Gy_DepartmentList.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        //获取数据
                        $("#HDeptID").val(checkStatus.data[0].HItemID);
                        $("#HDeptName").val(checkStatus.data[0].HName);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                })
            });
            //退出--全屏版
            form.on('submit(Cancel)', function () {
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    parent.location.href = "../../../../views/index_Mobile.html";
                });
            })
            //新增
            form.on('submit(Add)', function () {
                var index = parent.layer.getFrameIndex(window.name); // å…ˆå¾—到当前 iframe å±‚的索引
                parent.layer.close(index); // å†æ‰§è¡Œå…³é—­
            })
            //#endregion
            //#region æœ¬é¡µé¢æ‰€æœ‰è¢«è°ƒç”¨çš„æ–¹æ³•
            //#region é€šè¿‡ç™»å½•用户获取默认值
            function GetDefValByUser() {
                var index = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Cj_StationInBill/GetDefValByUser",
                    type: "GET",
                    async: false,
                    data: { "Czybm": sessionStorage["Czybm"], "Czymc": sessionStorage["HUserName"] },
                    success: function (result) {
                        var data = result.data[0];
                        form.val("formData", {
                            //"HSourceID": data.HSourceID,
                            //"HSourceName": data.生产资源名称,
                            "HGroupID": data.HGroupID,
                            "HGroupName": data.生产班组名称,
                            "HEmpID": data.HEmpID,
                            "HEmpName": data.操作员名称
                        });
                        layer.close(index);
                    }
                    , error: function () {
                        layer.close(index);
                        layer.msg("接口请求失败");
                    }
                })
            }
            //#endregion
            //条形码回车方法
            function txtHBarCode_KeyDown(HBarCode) {
                var ajaxLoad = layer.load();
                var sql = "select * from Sc_ICMOBillStatus_Tmp where HICMOBillNo =  '" + HBarCode + "'" ;
                $.ajax({
                    url: GetWEBURL() + '/Gy_SOPBillList/WindowPrintList',
                    type: "GET",
                    async: false,
                    data: { "sWhere": sql },
                    success: function (data1) {
                        if (data1.count == 1) {
                            HSourceInterID = data1.data[0].HInterID;
                            HSourceEntryID = data1.data[0].HICMOEntryID;
                            HSourceBillNo = HBarCode;
                            HSourceBillType = data1.data[0].HBillType;
                        } else {
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                            layer.close(ajaxLoad);
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                        layer.close(ajaxLoad);
                    }
                });
                $.ajax(
                    {
                        type: "GET",
                        url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkFrom", //方法所在页面和方法名
                        async: false,
                        data: {
                            "HSourceInterID": HSourceInterID,
                            "HSourceEntryID": HSourceEntryID,
                            "HSourceBillNo": HSourceBillNo,
                            "HSourceBillType": HSourceBillType
                        },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1)// è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            {
                                var LoadData = data.data.h_p_JIT_GetInfoByICMOStatusInterID;
                                $("#HProcID").val(LoadData[0].HProcID); //当前工序ID
                                $("#HProcName").val(LoadData[0].HProcName); //当前工序
                                $("#HMaterID").val(LoadData[0].HMaterID); //产品ID
                                $("#HMaterCode").val(LoadData[0].HMaterNumber); //产品代码
                                $("#HMaterName").val(LoadData[0].HMaterName); //产品名称
                                $("#HMaterSpec").val(LoadData[0].HModel); //产品规格
                                $("#HSourceID").val(LoadData[0].HSourceID); //生产资源ID
                                $("#HSourceName").val(LoadData[0].HSourceName); //生产资源
                                $("#HMainSourceBillNo").val(LoadData[0].HICMOBillNo); //源单单号(暂时取值订单编号)
                                $("#HMainSourceInterID").val(LoadData[0].HSourceInterID); //源单主内码(取值HInterID)
                                $("#HMainSourceEntryID").val(LoadData[0].HSourceEntryID); //源单子内码(源单行号)
                                $("#HMainSourceBillType").val(HSourceBillType); //源单类型
                                $("#HDeptID").val(LoadData[0].HDeptID); //车间ID
                                $("#HDeptName").val(LoadData[0].HDeptName); //车间
                                $("#HICMOInterID").val(LoadData[0].HICMOInterID); //生产订单ID
                                $("#HICMOEntryID").val(LoadData[0].HICMOEntryID); //生产订单子ID
                                $("#HICMOBillNo").val(LoadData[0].HICMOBillNo); //生产订单
                                //HCenterID = LoadData[0].HCenterID == null ? sessionStorage["HWorkCenterID"] : LoadData[0].HCenterID;//工作中心id
                                layer.close(ajaxLoad);
                            }
                            else {
                                layer.alert(data.Message, { icon: 5 });
                                layer.close(ajaxLoad);
                            }
                        },
                        error: function (err) {
                            layer.alert(err, { icon: 5 });
                            layer.close(ajaxLoad);
                        }
                    });
            }
            //流水号回车方法
            function txtHProcNo_KeyDown(sBillNo, sProcNo) {
                var index = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Cj_StationInBill/txtHProcNo_KeyDown",
                    type: "GET",
                    data: { "sBillNo": sBillNo, "sProcNo": sProcNo },
                    success: function (result) {
                        if (result.count == 1) {
                            var data = result.data[0];
                            form.val("formData", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                                "HProcName": data.工序,
                                "HProcID": data.HProcID,
                                "HSourceID": data.HSourceID,
                                "HSourceName": data.生产资源
                            });
                            $("#HProcNo").attr("readonly", "readonly");
                            $("#HProcNo").css("background-color", "#efefef4d");
                            layer.close(index);
                        }
                        else {
                            layer.close(index);
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.msg("接口请求失败!" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            }
            //审核提交
            function SaveVerify() {
                var InterID = $("#HInterID").val();
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/Sc_MESStopWorkBill/AuditProcessReportList", //方法所在页面和方法名
                    async: true,
                    data: { "HInterID": InterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            layer.msg(data.Message, { time: 1 * 2000, icon: 1 }, function (index) {
                                //layer.close(layer.index);
                                //window.parent.location.reload();
                            });
                        }
                        else {
                            layer.alert(data.Message, { icon: 5 })
                        }
                    },
                    error: function (err) {
                        layer.alert(err, { icon: 5 })
                    }
                })
            }
            //有源单新增
            function set_AddNew() {
                //初始基本信息赋值
                $("#HDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));      //单据日期
                $("#HStopBeginWorkTime").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"))  //开始时间
                $("#HStopEndWorkTime").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"))  //有预计结束时间
                $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));  //制单日期
                $("#HMaker").val(sessionStorage["HUserName"]);     //制单人
                //加源单类型区分(可以写不同的方法)
                $('#HProcName').attr("disabled", true);
                $('#HStopBeginWorkTime').attr("disabled", true);
                $('#HSourceName').attr("disabled", true);
                $('#ProductionResources-BT').addClass("layui-btn-disabled").attr("disabled", true);
                $('#HMainSourceBillNo').attr("disabled", true);
                $('#HICMOBillNo').attr("disabled", true);
                $('#HDeptName').attr("disabled", true);
                $('#btnHDept').addClass("layui-btn-disabled").attr("disabled", true);
                $.ajax(
                    {
                        type: "GET",
                        url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkFrom", //方法所在页面和方法名
                        async: false,
                        data: {
                            "HSourceInterID": HSourceInterID,
                            "HSourceEntryID": HSourceEntryID,
                            "HSourceBillNo": HSourceBillNo,
                            "HSourceBillType": HBillType
                        },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1)// è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            {
                                var LoadData = data.data.h_p_JIT_GetInfoByICMOStatusInterID;
                                $("#HProcID").val(LoadData[0].HProcID); //当前工序ID
                                $("#HProcName").val(LoadData[0].HProcName); //当前工序
                                $("#HMaterID").val(LoadData[0].HMaterID); //产品ID
                                $("#HMaterNumber").val(LoadData[0].HMaterNumber); //产品代码
                                $("#HMaterName").val(LoadData[0].HMaterName); //产品名称
                                $("#HSourceID").val(LoadData[0].HSourceID); //生产资源ID
                                $("#HSourceName").val(LoadData[0].HSourceName); //生产资源
                                $("#HMainSourceBillNo").val(LoadData[0].HICMOBillNo); //源单单号(暂时取值订单编号)
                                $("#HMainSourceInterID").val(LoadData[0].HSourceInterID); //源单主内码(取值HInterID)
                                $("#HMainSourceEntryID").val(LoadData[0].HSourceEntryID); //源单子内码(源单行号)
                                $("#HMainSourceBillType").val(HSourceBillType); //源单类型
                                $("#HDeptID").val(LoadData[0].HDeptID); //车间ID
                                $("#HDeptName").val(LoadData[0].HDeptName); //车间
                                $("#HICMOInterID").val(LoadData[0].HICMOInterID); //生产订单ID
                                $("#HICMOEntryID").val(LoadData[0].HICMOEntryID); //生产订单子ID
                                $("#HICMOBillNo").val(LoadData[0].HICMOBillNo); //生产订单
                                //HCenterID = LoadData[0].HCenterID == null ? sessionStorage["HWorkCenterID"] : LoadData[0].HCenterID;//工作中心id
                            }
                            else {
                                layer.alert(data.Message, { icon: 5 });
                            }
                        },
                        error: function (err) {
                            layer.alert(err, { icon: 5 });
                        }
                    });
            }
            //以上为layui模块
        });
        //返回流水号
        function GetProcNoValue(obj) {
            $("#HProcNo").val(obj[0].流水号);
        }
        //返回生产班组
        function GetProductionTeamValue(obj) {
            $("#HGroupName").val(obj[0].班组);
            $("#HGroupID").val(obj[0].HItemID);
        }
        //返回生产资源
        function GetProductionResourcesValue(obj) {
            $("#HSourceName").val(obj[0].生产资源);
            $("#HSourceID").val(obj[0].HItemID);
        }
        //返回操作员
        function GetHWorkerValue(obj) {
            $("#HEmpName").val(obj[0].HName);
            $("#HEmpID").val(obj[0].HItemID);
        }
        //返回当前工序
        function GetHProcValue(obj) {  //返回当前工序
            $("#HProcName").val(obj[0].工序);
            $("#HProcID").val(obj[0].HItemID);
        }
    </script>
</body>
</html>
WebTM/views/Éú²ú¹ÜÀí/±¨¹¤Æ½Ì¨_PDA/Í깤/Sc_Add_MESEndWorkBillList_PDA.html
New file
@@ -0,0 +1,840 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title class="sckgd">生产完工单</title>
    <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, maximum-scale=1">
    <!--引用layui样式文件-->
    <link rel="stylesheet" href="../../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../../layuiadmin/style/admin.css" media="all">
    <!--引用layui js文件-->
    <script src="../../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <!--自定义样式-->
    <style>
        .layui-form-label {
            font-size: 14px;
            width: 85px;
            text-align: inherit;
        }
        /*全局设置输入框高度*/
        .layui-input {
            height: 30px;
        }
        /*设置表头输入框*/
        .t1_input {
            padding: 1%;
        }
        /*本站信息td*/
        .bz_td {
            display: -webkit-box; /*设置按钮不换行*/
            padding: 1%; /*设置输入框边距*/
        }
        /*设置本站信息按钮高度*/
        .bz_btu {
            height: 30px;
            width: 60px;
            line-height: 30px;
        }
        th {
            width: 70px;
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="layui-fluid" style="padding: 0;">
        <div class="layui-card">
            <div class="layui-card-body" style="padding: 1px;">
                <form class="layui-form" action="" lay-filter="formData" id="formData" style="background-color:white;">
                    <div style="background-color:#0085E8;">
                        <span style="color: white;" class="jzd"><i class="layui-icon layui-icon-form"></i>生产完工单</span>
                    </div>
                    <div class="layui-form-item" style="margin: 1% 2%;text-align: right;">
                        <button type="button" lay-submit="" lay-filter="Add" class="layui-btn layui-btn-radius">新增</button>
                        <button type="button" lay-submit="" lay-filter="Saver" id="Saver" class="layui-btn layui-btn-radius">保存</button>
                        <button type="button" lay-submit="" lay-filter="Cancel" class="layui-btn layui-btn-radius layui-btn-danger">退出</button>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-tab layui-tab-card" lay-filter="TabTest">
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <table style="width:80%;">
                                        <tbody>
                                            <tr>
                                                <th>条形码</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HBarCode" class="layui-input" id="HBarCode" placeholder="请输入条形码后回车" style="border-radius: 50px;" disabled>
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu layui-btn-radius" lay-filter="QueDin" style="line-height: 30px;">确定</button>
                                                </td>
                                            </tr>
                                            <!--<tr>
        <th>设备</th>
        <td class="bz_td">
            <input type="text" name="HEquipName" class="layui-input" id="HEquipName" placeholder="请扫描设备二维码" style="border-radius: 50px;">
            <input type="hidden" name="HEquipID" id="HEquipID" value="0" autocomplete="off" class="layui-input">
        </td>
    </tr>-->
                                            <tr>
                                                <th>源单单号</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMainSourceBillNo" id="HMainSourceBillNo" class="layui-input" value="" style="border-radius: 50px;">
                                                    <input type="hidden" name="HMainSourceInterID" id="HMainSourceInterID" class="layui-input" value="0" style="border-radius: 50px;">
                                                    <input type="hidden" name="HMainSourceEntryID" id="HMainSourceEntryID" class="layui-input" value="0" style="border-radius: 50px;">
                                                    <input type="hidden" name="HMainSourceBillType" id="HMainSourceBillType" class="layui-input" value="" style="border-radius: 50px;">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>生产订单</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HICMOBillNo" id="HICMOBillNo" class="layui-input" value="" style="border-radius: 50px;">
                                                    <input type="hidden" name="HICMOInterID" id="HICMOInterID" class="layui-input" value="0" style="border-radius: 50px;">
                                                    <input type="hidden" name="HICMOEntryID" id="HICMOEntryID" class="layui-input" value="0" style="border-radius: 50px;">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>生产资源</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HSourceName" class="layui-input" id="HSourceName" placeholder="选择生产资源" style="border-radius: 50px;">
                                                    <input type="hidden" name="HSourceID" id="HSourceID" value="0" autocomplete="off" class="layui-input">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="ProductionResources-BT" id="ProductionResources-BT" style="font-weight:bolder">...</button>
                                                </td>
                                            </tr>
                                            <!--<tr>
        <th>流水号</th>
        <td class="bz_td">
            <input type="text" name="HProcNo" class="layui-input" id="HProcNo" placeholder="选择流水号" style="background-color:#efefef4d;border-radius: 50px;">
            <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="SerialNum-BT" id="SerialNum-BT" style="font-weight:bolder">...</button>
        </td>
    </tr>
    <tr>
        <th>当前工序</th>
        <td class="bz_td">
            <input type="text" name="HProcName" class="layui-input" id="HProcName" placeholder="当前工序" style="border-radius: 50px;background-color:#efefef4d;" readonly>
            <input type="hidden" name="HProcID" id="HProcID" value="0" autocomplete="off" class="layui-input">
        </td>
    </tr>-->
                                            <tr>
                                                <th>产品代码</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMaterNumber" class="layui-input" id="HMaterNumber" placeholder="产品代码" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>产品名称</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMaterName" class="layui-input" id="HMaterName" placeholder="产品名称" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                    <input type="hidden" name="HMaterID" id="HMaterID" value="0" autocomplete="off" class="layui-input">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>完工时间</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HEndWorkTime" class="layui-input" id="HEndWorkTime" style="border-radius: 50px;" model="datetime" dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>生产班组</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HGroupName" class="layui-input" id="HGroupName" placeholder="选择生产班组" style="background-color:#efefef4d;border-radius: 50px;">
                                                    <input type="hidden" name="HGroupID" id="HGroupID" value="0" autocomplete="off" class="layui-input">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="ProductionTeam-BT" id="ProductionTeam-BT" style="font-weight:bolder">...</button>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>操作员</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HEmpName" class="layui-input" id="HEmpName" placeholder="选择接收人" style="background-color:#efefef4d;border-radius: 50px;" readonly>
                                                    <input type="hidden" name="HEmpID" id="HEmpID" value="0" autocomplete="off" class="layui-input">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="HEmployeeID-BT" id="HEmployeeID-BT" style="font-weight:bolder">...</button>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>车间</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HDeptName" class="layui-input set_height" id="HDeptName" placeholder="选择车间" style="border-radius: 50px; background-color: #efefef4d;" readonly>
                                                    <input type="hidden" name="HDeptID" id="HDeptID" value="0" autocomplete="off" class="layui-input set_height">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="btnHDept" id="btnHDept" style="font-weight:bolder;">...</button>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>生产班次</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HWorkShiftName" class="layui-input set_height" id="HWorkShiftName" placeholder="选择班次" style="border-radius: 50px; background-color: #efefef4d;" readonly>
                                                    <input type="hidden" name="HWorkShiftID" id="HWorkShiftID" value="0" autocomplete="off" class="layui-input set_height">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="btnHWorkShift" id="btnHWorkShift" style="font-weight:bolder;">...</button>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>单据日期</th>
                                                <td class="t1_input">
                                                    <input type="text" name="HDate" class="layui-input" id="HDate" style="border-radius: 50px;" placeholder="请选择日期" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>单据号</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HBillNo" class="layui-input" id="HBillNo" placeholder="单据号" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                    <input type="hidden" name="HInterID" id="HInterID" value="0" autocomplete="off" class="layui-input">
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="layui-tab-item">
                                    <table style="width:80%;">
                                        <tbody>
                                            <tr>
                                                <th>制单人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMaker" class="layui-input" id="HMaker" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>制单日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMakeDate" class="layui-input" id="HMakeDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>修改人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HUpDater" class="layui-input" id="HUpDater" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>修改日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HUpDateDate" class="layui-input" id="HUpDateDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>审核人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HChecker" class="layui-input" id="HChecker" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>审核日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HCheckDate" class="layui-input" id="HCheckDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>关闭人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HCloseMan" class="layui-input" id="HCloseMan" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>关闭日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HCloseDate" class="layui-input" id="HCloseDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>作废人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HDeleteMan" class="layui-input" id="HDeleteMan" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>作废日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HDeleteDate" class="layui-input" id="HDeleteDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                            </div>
                            <ul class="layui-tab-title">
                                <li class="layui-this">单据信息</li>
                                <li>制单信息</li>
                            </ul>
                        </div>
                    </div>
                    <!--隐藏字段-->
                    <input type="hidden" name="lngProcInterID" id="lngProcInterID">
                    <input type="hidden" name="lngBillKey" id="lngBillKey" value="0">
                    <input type="hidden" name="lngBillSubKey" id="lngBillSubKey" value="0">
                    <!--<input type="hidden" name="HMaker" id="HMaker">--><!--制单人-->
                    <input type="hidden" name="eventType" id="eventType" value="Add">
                    <input type="hidden" name="HeqSouID" id="HeqSouID" value="0">
                </form>
            </div>
        </div>
    </div>
    <script>
        var HBillType = "";  //单据类型
        var HSourceInterID = ""; //源单主内码
        var HSourceEntryID = "";  //源单子内码
        var HSourceBillNo = "";   //源单单号
        var HSourceBillType = "";  //源单类型
        //获取页面跳转参数  //单据编辑状态: 1.无源单新增  Â 2.有源单新增  Â 3.编辑  4.浏览  5.变更
        var params = get_UrlVars();
        if (typeof (params[params[0]]) == "undefined") {
            var OperationType = 1;//操作类型
        } else {
            var OperationType = params[params[0]];//操作类型
            var linterid = params[params[1]];//源单id
            var HSBillType = params[params[2]];//源单类型
        }
        var edit = function (data) {
            HBillType = data[0].HBillType;
            HSourceInterID = data[0].HSourceInterID;
            HSourceEntryID = data[0].HSourceEntryID;
            HSourceBillNo = data[0].HSourceBillNo;
            HSourceBillType = data[0].HSourceBillType;
        }
        layui.config({
            base: '../../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element','upload'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , laydate = layui.laydate
                , element = layui.element;
            //流转卡是否扫描标记
            var HProcExchBillNoFlag = false;
            //加载时间控件
            laydate.render({
                elem: '#HEndWorkTime'
                , type: 'datetime'
            });
            //判断是否新增
            if (OperationType == 1 || OperationType == 2 || OperationType == 5) {
                //获取最大单据号
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '3788' },
                    success: function (d) {
                        $("#HInterID").val(0);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        layer.close(ajaxLoad);
                    }
                    , error: function () {
                        layer.close(ajaxLoad);
                        layer.msg("获取单据号失败,请刷新重试!");
                    }
                });
                GetDefValByUser();
                set_AddNew();
            }
            //进入页面默认光标在条形码上
            $("#HBarCode").focus();
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //#region ç¡®å®šæŒ‰é’®
            form.on('submit(QueDin)', function (data) {//
                var HBarCode = $('#HBarCode').val();
                if (!HBarCode) {
                    layer.msg("条形码不能为空!")
                    return;
                }
                txtHBarCode_KeyDown(HBarCode);
            });
            //#endregion
            //#region æ–°å¢žæŒ‰é’®
            form.on('submit(Add)', function () {//提交
                layer.confirm('新增后页面数据将消失?', { icon: 3, title: '提示' }, function (index) {
                    location.replace('Sc_MESBeginWorkBillList_PDA.html?type=' + params[params[0]]);
                });
            })
            //#endregion
            //#region ä¿å­˜æŒ‰é’®
            form.on('submit(Saver)', function (data) {//提交
                var refSav = "";
                if (OperationType == 1 || OperationType == 2 || OperationType == 5) {
                    refSav = "Add";
                } else {
                    refSav = "Update";
                }
                if ($("#HSourceID").val() == '' || $("#HSourceID").val() == null || $("#HSourceID").val() == 0) {
                    layer.msg("生产资源不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HMainSourceInterID").val() == '' || $("#HMainSourceInterID").val() == null || $("#HMainSourceInterID").val() == 0) {
                    layer.msg("源单单号不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HEmpID").val() == '' || $("#HEmpID").val() == null||$("#HEmpID").val() == '0') {
                    layer.msg("操作员不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HGroupID").val() == '' || $("#HGroupID").val() == null || $("#HGroupID").val() == '0') {
                    layer.msg("班组不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HDeptID").val() == '' || $("#HDeptID").val() == null || $("#HDeptID").val() == '0') {
                    layer.msg("车间不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HICMOInterID").val() == '' || $("#HICMOInterID").val() == null || $("#HICMOInterID").val() == '0') {
                    layer.msg("生产订单不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                var msg = JSON.stringify(data.field) + ";"  + sessionStorage["HUserName"] + ";" + refSav;
                var index = layer.load();
                $.ajax({
                    type: "POST",
                    url: GetWEBURL() + "/Sc_MESEndWorkBill/SaveGetMESEndFrom",
                    async: true,
                    data: { "msg": msg },
                    dataType: "json",
                    success: function (result) {
                        if (result.count == 1) {
                            $('#Saver').addClass("layui-btn-disabled").attr("disabled", true);//禁用保存按钮
                            $("#HInterID").val(result.HInterID);//获取提交成功返回的单据主ID
                            layer.msg(result.Message, { time: 1 * 2000, icon: 1 }, function (index) {
                                if (result.Verify == "Y") //自动审核
                                {
                                    layer.close(index);
                                    SaveVerify(); //审核
                                }
                                else {
                                    layer.close(index);
                                }
                            });
                            layer.close(index);
                        }
                        else {
                            layer.close(index);
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            });
            //#endregion
            //条形码回车方法
            $('#HBarCode').on('keydown', function (event) {
                var HBarCode = $('#HBarCode').val();
                if (event.keyCode == 13) {
                    if (!HBarCode) {
                        layer.msg("空白码,条形码不能为空!")
                        return;
                    }
                    txtHBarCode_KeyDown(HBarCode);
                }
            });
            //流水号(工序号)回车方法
            $('#HProcNo').on('keydown', function (event) {
                var sProcNo = $('#HProcNo').val();
                var sBillNo = $('#HMainSourceBillNo').val();
                if (event.keyCode == 13) {
                    if (!HProcExchBillNoFlag) {
                        layer.msg("流转卡没有扫描,或者没有按回车键,请扫描流转卡或者在流转卡文本框中按回车键!");
                        return;
                    }
                    txtHProcNo_KeyDown(sBillNo, sProcNo);
                }
            });
            //选择生产班组弹窗
            form.on('submit(ProductionTeam-BT)', function () {//选择生产班组
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '本站工序'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../Baseset/基础资料/Gy_GetProductionTeamList.html', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            //选择生产资源弹窗
            form.on('submit(ProductionResources-BT)', function () {//生产资源
                console.log($('#HProcNo').val())
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '生产资源'
                    , shade: 0.6 //遮罩透明度
                    //, maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../Baseset/基础资料/Gy_GetProductionResourcesList.html', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            //选择操作人
            form.on('submit(HEmployeeID-BT)', function () {
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '职员列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            //选择流水号弹窗
            form.on('submit(SerialNum-BT)', function () {//生产资源
                var value = $("#lngProcInterID").val();
                // åˆ¤æ–­æ˜¯å¦å·²ç»è¾“入流水号,是则弹出模态框,否则给出提示
                if (value) {
                    layer.open({
                        type: 2
                        , area: ['80%', '80%']
                        , title: '流水号'
                        , shade: 0.6 //遮罩透明度
                        //, maxmin: true //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: [`../../../Baseset/基础资料/Gy_GetProcNoList.html?HInterID=${value}`, 'yes']
                        , resize: false
                        , cancel: function (index, layero) {
                        }
                        , end: function () {
                            var sProcNo = $('#HProcNo').val();
                            var sBillNo = $('#HMainSourceBillNo').val();
                            if (sProcNo != "") {
                                txtHProcNo_KeyDown(sBillNo, sProcNo);
                            }
                        }
                    })
                } else {
                    layer.alert('请您确认输入流转卡号后重试^_^', { icon: 7 });
                }
            });
            //选择部门弹窗
            form.on('submit(btnHDept)', function () {//部门
                layer.open({
                    type: 2 //类型
                    , skin: 'layui-layer-rim'//加上边框
                    , area: ['90%', '90%']//大小
                    , title: '部门列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../../Baseset/基础资料/Gy_DepartmentList.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        //获取数据
                        $("#HDeptID").val(checkStatus.data[0].HItemID);
                        $("#HDeptName").val(checkStatus.data[0].HName);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                })
            });
            //退出--全屏版
            form.on('submit(Cancel)', function () {
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    parent.location.href = "../../../../views/index_Mobile.html";
                });
            })
            //新增
            form.on('submit(Add)', function () {
                var index = parent.layer.getFrameIndex(window.name); // å…ˆå¾—到当前 iframe å±‚的索引
                parent.layer.close(index); // å†æ‰§è¡Œå…³é—­
            })
            //#endregion
            //#region æœ¬é¡µé¢æ‰€æœ‰è¢«è°ƒç”¨çš„æ–¹æ³•
            //#region é€šè¿‡ç™»å½•用户获取默认值
            function GetDefValByUser() {
                var index = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Cj_StationInBill/GetDefValByUser",
                    type: "GET",
                    async: false,
                    data: { "Czybm": sessionStorage["Czybm"], "Czymc": sessionStorage["HUserName"] },
                    success: function (result) {
                        var data = result.data[0];
                        form.val("formData", {
                            //"HSourceID": data.HSourceID,
                            //"HSourceName": data.生产资源名称,
                            "HGroupID": data.HGroupID,
                            "HGroupName": data.生产班组名称,
                            "HEmpID": data.HEmpID,
                            "HEmpName": data.操作员名称
                        });
                        layer.close(index);
                    }
                    , error: function () {
                        layer.close(index);
                        layer.msg("接口请求失败");
                    }
                })
            }
            //#endregion
            //条形码回车方法
            function txtHBarCode_KeyDown(HBarCode) {
                var ajaxLoad = layer.load();
                var sql = "select * from Sc_ICMOBillStatus_Tmp where HICMOBillNo =  '" + HBarCode + "'" ;
                $.ajax({
                    url: GetWEBURL() + '/Gy_SOPBillList/WindowPrintList',
                    type: "GET",
                    async: false,
                    data: { "sWhere": sql },
                    success: function (data1) {
                        if (data1.count == 1) {
                            HSourceInterID = data1.data[0].HInterID;
                            HSourceEntryID = data1.data[0].HICMOEntryID;
                            HSourceBillNo = HBarCode;
                            HSourceBillType = data1.data[0].HBillType;
                        } else {
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                            layer.close(ajaxLoad);
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                        layer.close(ajaxLoad);
                    }
                });
                $.ajax(
                    {
                        type: "GET",
                        url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkFrom", //方法所在页面和方法名
                        async: false,
                        data: {
                            "HSourceInterID": HSourceInterID,
                            "HSourceEntryID": HSourceEntryID,
                            "HSourceBillNo": HSourceBillNo,
                            "HSourceBillType": HSourceBillType
                        },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1)// è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            {
                                var LoadData = data.data.h_p_JIT_GetInfoByICMOStatusInterID;
                                $("#HProcID").val(LoadData[0].HProcID); //当前工序ID
                                $("#HProcName").val(LoadData[0].HProcName); //当前工序
                                $("#HMaterID").val(LoadData[0].HMaterID); //产品ID
                                $("#HMaterCode").val(LoadData[0].HMaterNumber); //产品代码
                                $("#HMaterName").val(LoadData[0].HMaterName); //产品名称
                                $("#HMaterSpec").val(LoadData[0].HModel); //产品规格
                                $("#HSourceID").val(LoadData[0].HSourceID); //生产资源ID
                                $("#HSourceName").val(LoadData[0].HSourceName); //生产资源
                                $("#HMainSourceBillNo").val(LoadData[0].HICMOBillNo); //源单单号(暂时取值订单编号)
                                $("#HMainSourceInterID").val(LoadData[0].HSourceInterID); //源单主内码(取值HInterID)
                                $("#HMainSourceEntryID").val(LoadData[0].HSourceEntryID); //源单子内码(源单行号)
                                $("#HMainSourceBillType").val(HSourceBillType); //源单类型
                                $("#HDeptID").val(LoadData[0].HDeptID); //车间ID
                                $("#HDeptName").val(LoadData[0].HDeptName); //车间
                                $("#HICMOInterID").val(LoadData[0].HICMOInterID); //生产订单ID
                                $("#HICMOEntryID").val(LoadData[0].HICMOEntryID); //生产订单子ID
                                $("#HICMOBillNo").val(LoadData[0].HICMOBillNo); //生产订单
                                //HCenterID = LoadData[0].HCenterID == null ? sessionStorage["HWorkCenterID"] : LoadData[0].HCenterID;//工作中心id
                                layer.close(ajaxLoad);
                            }
                            else {
                                layer.alert(data.Message, { icon: 5 });
                                layer.close(ajaxLoad);
                            }
                        },
                        error: function (err) {
                            layer.alert(err, { icon: 5 });
                            layer.close(ajaxLoad);
                        }
                    });
            }
            //流水号回车方法
            function txtHProcNo_KeyDown(sBillNo, sProcNo) {
                var index = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Cj_StationInBill/txtHProcNo_KeyDown",
                    type: "GET",
                    data: { "sBillNo": sBillNo, "sProcNo": sProcNo },
                    success: function (result) {
                        if (result.count == 1) {
                            var data = result.data[0];
                            form.val("formData", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                                "HProcName": data.工序,
                                "HProcID": data.HProcID,
                                "HSourceID": data.HSourceID,
                                "HSourceName": data.生产资源
                            });
                            $("#HProcNo").attr("readonly", "readonly");
                            $("#HProcNo").css("background-color", "#efefef4d");
                            layer.close(index);
                        }
                        else {
                            layer.close(index);
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.msg("接口请求失败!" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            }
            //审核提交
            function SaveVerify() {
                var InterID = $("#HInterID").val();
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/Sc_MESEndWorkBill/AuditProcessReportList", //方法所在页面和方法名
                    async: true,
                    data: { "HInterID": InterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            layer.msg(data.Message, { time: 1 * 2000, icon: 1 }, function (index) {
                                //layer.close(layer.index);
                                //window.parent.location.reload();
                            });
                        }
                        else {
                            layer.alert(data.Message, { icon: 5 })
                        }
                    },
                    error: function (err) {
                        layer.alert(err, { icon: 5 })
                    }
                })
            }
            //有源单新增
            function set_AddNew() {
                //初始基本信息赋值
                $("#HDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));      //单据日期
                $("#HEndWorkTime").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"))  //开始时间
                $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));  //制单日期
                $("#HMaker").val(sessionStorage["HUserName"]);     //制单人
                //加源单类型区分(可以写不同的方法)
                $('#HProcName').attr("disabled", true);
                $('#HSourceName').attr("disabled", true);
                $('#ProductionResources-BT').addClass("layui-btn-disabled").attr("disabled", true);
                $('#HMainSourceBillNo').attr("disabled", true);
                $('#HICMOBillNo').attr("disabled", true);
                $('#HDeptName').attr("disabled", true);
                $('#btnHDept').addClass("layui-btn-disabled").attr("disabled", true);
                $.ajax(
                    {
                        type: "GET",
                        url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkFrom", //方法所在页面和方法名
                        async: false,
                        data: {
                            "HSourceInterID": HSourceInterID,
                            "HSourceEntryID": HSourceEntryID,
                            "HSourceBillNo": HSourceBillNo,
                            "HSourceBillType": HBillType
                        },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1)// è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            {
                                var LoadData = data.data.h_p_JIT_GetInfoByICMOStatusInterID;
                                $("#HProcID").val(LoadData[0].HProcID); //当前工序ID
                                $("#HProcName").val(LoadData[0].HProcName); //当前工序
                                $("#HMaterID").val(LoadData[0].HMaterID); //产品ID
                                $("#HMaterNumber").val(LoadData[0].HMaterNumber); //产品代码
                                $("#HMaterName").val(LoadData[0].HMaterName); //产品名称
                                $("#HSourceID").val(LoadData[0].HSourceID); //生产资源ID
                                $("#HSourceName").val(LoadData[0].HSourceName); //生产资源
                                $("#HMainSourceBillNo").val(LoadData[0].HICMOBillNo); //源单单号(暂时取值订单编号)
                                $("#HMainSourceInterID").val(LoadData[0].HSourceInterID); //源单主内码(取值HInterID)
                                $("#HMainSourceEntryID").val(LoadData[0].HSourceEntryID); //源单子内码(源单行号)
                                $("#HMainSourceBillType").val(HSourceBillType); //源单类型
                                $("#HDeptID").val(LoadData[0].HDeptID); //车间ID
                                $("#HDeptName").val(LoadData[0].HDeptName); //车间
                                $("#HICMOInterID").val(LoadData[0].HICMOInterID); //生产订单ID
                                $("#HICMOEntryID").val(LoadData[0].HICMOEntryID); //生产订单子ID
                                $("#HICMOBillNo").val(LoadData[0].HICMOBillNo); //生产订单
                                //HCenterID = LoadData[0].HCenterID == null ? sessionStorage["HWorkCenterID"] : LoadData[0].HCenterID;//工作中心id
                            }
                            else {
                                layer.alert(data.Message, { icon: 5 });
                            }
                        },
                        error: function (err) {
                            layer.alert(err, { icon: 5 });
                        }
                    });
            }
            //以上为layui模块
        });
        //返回流水号
        function GetProcNoValue(obj) {
            $("#HProcNo").val(obj[0].流水号);
        }
        //返回生产班组
        function GetProductionTeamValue(obj) {
            $("#HGroupName").val(obj[0].班组);
            $("#HGroupID").val(obj[0].HItemID);
        }
        //返回生产资源
        function GetProductionResourcesValue(obj) {
            $("#HSourceName").val(obj[0].生产资源);
            $("#HSourceID").val(obj[0].HItemID);
        }
        //返回操作员
        function GetHWorkerValue(obj) {
            $("#HEmpName").val(obj[0].HName);
            $("#HEmpID").val(obj[0].HItemID);
        }
        //返回当前工序
        function GetHProcValue(obj) {  //返回当前工序
            $("#HProcName").val(obj[0].工序);
            $("#HProcID").val(obj[0].HItemID);
        }
    </script>
</body>
</html>
WebTM/views/Éú²ú¹ÜÀí/±¨¹¤Æ½Ì¨_PDA/¿ª¹¤/Sc_Add_MESBeginWorkBillList_PDA.html
New file
@@ -0,0 +1,840 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title class="sckgd">生产开工单</title>
    <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, maximum-scale=1">
    <!--引用layui样式文件-->
    <link rel="stylesheet" href="../../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../../layuiadmin/style/admin.css" media="all">
    <!--引用layui js文件-->
    <script src="../../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <!--自定义样式-->
    <style>
        .layui-form-label {
            font-size: 14px;
            width: 85px;
            text-align: inherit;
        }
        /*全局设置输入框高度*/
        .layui-input {
            height: 30px;
        }
        /*设置表头输入框*/
        .t1_input {
            padding: 1%;
        }
        /*本站信息td*/
        .bz_td {
            display: -webkit-box; /*设置按钮不换行*/
            padding: 1%; /*设置输入框边距*/
        }
        /*设置本站信息按钮高度*/
        .bz_btu {
            height: 30px;
            width: 60px;
            line-height: 30px;
        }
        th {
            width: 70px;
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="layui-fluid" style="padding: 0;">
        <div class="layui-card">
            <div class="layui-card-body" style="padding: 1px;">
                <form class="layui-form" action="" lay-filter="formData" id="formData" style="background-color:white;">
                    <div style="background-color:#0085E8;">
                        <span style="color: white;" class="jzd"><i class="layui-icon layui-icon-form"></i>生产开工单</span>
                    </div>
                    <div class="layui-form-item" style="margin: 1% 2%;text-align: right;">
                        <button type="button" lay-submit="" lay-filter="Add" class="layui-btn layui-btn-radius">新增</button>
                        <button type="button" lay-submit="" lay-filter="Saver" id="Saver" class="layui-btn layui-btn-radius">保存</button>
                        <button type="button" lay-submit="" lay-filter="Cancel" class="layui-btn layui-btn-radius layui-btn-danger">退出</button>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-tab layui-tab-card" lay-filter="TabTest">
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <table style="width:80%;">
                                        <tbody>
                                            <tr>
                                                <th>条形码</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HBarCode" class="layui-input" id="HBarCode" placeholder="请输入条形码后回车" style="border-radius: 50px;" disabled>
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu layui-btn-radius" lay-filter="QueDin" style="line-height: 30px;">确定</button>
                                                </td>
                                            </tr>
                                            <!--<tr>
        <th>设备</th>
        <td class="bz_td">
            <input type="text" name="HEquipName" class="layui-input" id="HEquipName" placeholder="请扫描设备二维码" style="border-radius: 50px;">
            <input type="hidden" name="HEquipID" id="HEquipID" value="0" autocomplete="off" class="layui-input">
        </td>
    </tr>-->
                                            <tr>
                                                <th>源单单号</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMainSourceBillNo" id="HMainSourceBillNo" class="layui-input" value="" style="border-radius: 50px;">
                                                    <input type="hidden" name="HMainSourceInterID" id="HMainSourceInterID" class="layui-input" value="0" style="border-radius: 50px;">
                                                    <input type="hidden" name="HMainSourceEntryID" id="HMainSourceEntryID" class="layui-input" value="0" style="border-radius: 50px;">
                                                    <input type="hidden" name="HMainSourceBillType" id="HMainSourceBillType" class="layui-input" value="" style="border-radius: 50px;">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>生产订单</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HICMOBillNo" id="HICMOBillNo" class="layui-input" value="" style="border-radius: 50px;">
                                                    <input type="hidden" name="HICMOInterID" id="HICMOInterID" class="layui-input" value="0" style="border-radius: 50px;">
                                                    <input type="hidden" name="HICMOEntryID" id="HICMOEntryID" class="layui-input" value="0" style="border-radius: 50px;">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>生产资源</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HSourceName" class="layui-input" id="HSourceName" placeholder="选择生产资源" style="border-radius: 50px;">
                                                    <input type="hidden" name="HSourceID" id="HSourceID" value="0" autocomplete="off" class="layui-input">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="ProductionResources-BT" id="ProductionResources-BT" style="font-weight:bolder">...</button>
                                                </td>
                                            </tr>
                                            <!--<tr>
        <th>流水号</th>
        <td class="bz_td">
            <input type="text" name="HProcNo" class="layui-input" id="HProcNo" placeholder="选择流水号" style="background-color:#efefef4d;border-radius: 50px;">
            <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="SerialNum-BT" id="SerialNum-BT" style="font-weight:bolder">...</button>
        </td>
    </tr>
    <tr>
        <th>当前工序</th>
        <td class="bz_td">
            <input type="text" name="HProcName" class="layui-input" id="HProcName" placeholder="当前工序" style="border-radius: 50px;background-color:#efefef4d;" readonly>
            <input type="hidden" name="HProcID" id="HProcID" value="0" autocomplete="off" class="layui-input">
        </td>
    </tr>-->
                                            <tr>
                                                <th>产品代码</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMaterNumber" class="layui-input" id="HMaterNumber" placeholder="产品代码" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>产品名称</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMaterName" class="layui-input" id="HMaterName" placeholder="产品名称" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                    <input type="hidden" name="HMaterID" id="HMaterID" value="0" autocomplete="off" class="layui-input">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>开工时间</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HBeginWorkTime" class="layui-input" id="HBeginWorkTime" style="border-radius: 50px;" model="datetime" dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd">
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>生产班组</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HGroupName" class="layui-input" id="HGroupName" placeholder="选择生产班组" style="background-color:#efefef4d;border-radius: 50px;">
                                                    <input type="hidden" name="HGroupID" id="HGroupID" value="0" autocomplete="off" class="layui-input">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="ProductionTeam-BT" id="ProductionTeam-BT" style="font-weight:bolder">...</button>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>操作员</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HEmpName" class="layui-input" id="HEmpName" placeholder="选择接收人" style="background-color:#efefef4d;border-radius: 50px;" readonly>
                                                    <input type="hidden" name="HEmpID" id="HEmpID" value="0" autocomplete="off" class="layui-input">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="HEmployeeID-BT" id="HEmployeeID-BT" style="font-weight:bolder">...</button>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>车间</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HDeptName" class="layui-input set_height" id="HDeptName" placeholder="选择车间" style="border-radius: 50px; background-color: #efefef4d;" readonly>
                                                    <input type="hidden" name="HDeptID" id="HDeptID" value="0" autocomplete="off" class="layui-input set_height">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="btnHDept" id="btnHDept" style="font-weight:bolder;">...</button>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>生产班次</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HWorkShiftName" class="layui-input set_height" id="HWorkShiftName" placeholder="选择班次" style="border-radius: 50px; background-color: #efefef4d;" readonly>
                                                    <input type="hidden" name="HWorkShiftID" id="HWorkShiftID" value="0" autocomplete="off" class="layui-input set_height">
                                                    <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="btnHWorkShift" id="btnHWorkShift" style="font-weight:bolder;">...</button>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>单据日期</th>
                                                <td class="t1_input">
                                                    <input type="text" name="HDate" class="layui-input" id="HDate" style="border-radius: 50px;" placeholder="请选择日期" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>单据号</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HBillNo" class="layui-input" id="HBillNo" placeholder="单据号" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                    <input type="hidden" name="HInterID" id="HInterID" value="0" autocomplete="off" class="layui-input">
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="layui-tab-item">
                                    <table style="width:80%;">
                                        <tbody>
                                            <tr>
                                                <th>制单人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMaker" class="layui-input" id="HMaker" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>制单日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HMakeDate" class="layui-input" id="HMakeDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>修改人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HUpDater" class="layui-input" id="HUpDater" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>修改日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HUpDateDate" class="layui-input" id="HUpDateDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>审核人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HChecker" class="layui-input" id="HChecker" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>审核日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HCheckDate" class="layui-input" id="HCheckDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>关闭人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HCloseMan" class="layui-input" id="HCloseMan" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>关闭日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HCloseDate" class="layui-input" id="HCloseDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>作废人</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HDeleteMan" class="layui-input" id="HDeleteMan" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                            <tr>
                                                <th>作废日期</th>
                                                <td class="bz_td">
                                                    <input type="text" name="HDeleteDate" class="layui-input" id="HDeleteDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                            </div>
                            <ul class="layui-tab-title">
                                <li class="layui-this">单据信息</li>
                                <li>制单信息</li>
                            </ul>
                        </div>
                    </div>
                    <!--隐藏字段-->
                    <input type="hidden" name="lngProcInterID" id="lngProcInterID">
                    <input type="hidden" name="lngBillKey" id="lngBillKey" value="0">
                    <input type="hidden" name="lngBillSubKey" id="lngBillSubKey" value="0">
                    <!--<input type="hidden" name="HMaker" id="HMaker">--><!--制单人-->
                    <input type="hidden" name="eventType" id="eventType" value="Add">
                    <input type="hidden" name="HeqSouID" id="HeqSouID" value="0">
                </form>
            </div>
        </div>
    </div>
    <script>
        var HBillType = "";  //单据类型
        var HSourceInterID = ""; //源单主内码
        var HSourceEntryID = "";  //源单子内码
        var HSourceBillNo = "";   //源单单号
        var HSourceBillType = "";  //源单类型
        //获取页面跳转参数  //单据编辑状态: 1.无源单新增  Â 2.有源单新增  Â 3.编辑  4.浏览  5.变更
        var params = get_UrlVars();
        if (typeof (params[params[0]]) == "undefined") {
            var OperationType = 1;//操作类型
        } else {
            var OperationType = params[params[0]];//操作类型
            var linterid = params[params[1]];//源单id
            var HSBillType = params[params[2]];//源单类型
        }
        var edit = function (data) {
            HBillType = data[0].HBillType;
            HSourceInterID = data[0].HSourceInterID;
            HSourceEntryID = data[0].HSourceEntryID;
            HSourceBillNo = data[0].HSourceBillNo;
            HSourceBillType = data[0].HSourceBillType;
        }
        layui.config({
            base: '../../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element','upload'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , laydate = layui.laydate
                , element = layui.element;
            //流转卡是否扫描标记
            var HProcExchBillNoFlag = false;
            //加载时间控件
            laydate.render({
                elem: '#HBeginWorkTime'
                , type: 'datetime'
            });
            //判断是否新增
            if (OperationType == 1 || OperationType == 2 || OperationType == 5) {
                //获取最大单据号
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '3787' },
                    success: function (d) {
                        $("#HInterID").val(0);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        layer.close(ajaxLoad);
                    }
                    , error: function () {
                        layer.close(ajaxLoad);
                        layer.msg("获取单据号失败,请刷新重试!");
                    }
                });
                GetDefValByUser();
                set_AddNew();
            }
            //进入页面默认光标在条形码上
            $("#HBarCode").focus();
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //#region ç¡®å®šæŒ‰é’®
            form.on('submit(QueDin)', function (data) {//
                var HBarCode = $('#HBarCode').val();
                if (!HBarCode) {
                    layer.msg("条形码不能为空!")
                    return;
                }
                txtHBarCode_KeyDown(HBarCode);
            });
            //#endregion
            //#region æ–°å¢žæŒ‰é’®
            form.on('submit(Add)', function () {//提交
                layer.confirm('新增后页面数据将消失?', { icon: 3, title: '提示' }, function (index) {
                    location.replace('Sc_MESBeginWorkBillList_PDA.html?type=' + params[params[0]]);
                });
            })
            //#endregion
            //#region ä¿å­˜æŒ‰é’®
            form.on('submit(Saver)', function (data) {//提交
                var refSav = "";
                if (OperationType == 1 || OperationType == 2 || OperationType == 5) {
                    refSav = "Add";
                } else {
                    refSav = "Update";
                }
                if ($("#HSourceID").val() == '' || $("#HSourceID").val() == null || $("#HSourceID").val() == 0) {
                    layer.msg("生产资源不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HMainSourceInterID").val() == '' || $("#HMainSourceInterID").val() == null || $("#HMainSourceInterID").val() == 0) {
                    layer.msg("源单单号不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HEmpID").val() == '' || $("#HEmpID").val() == null||$("#HEmpID").val() == '0') {
                    layer.msg("操作员不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HGroupID").val() == '' || $("#HGroupID").val() == null || $("#HGroupID").val() == '0') {
                    layer.msg("班组不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HDeptID").val() == '' || $("#HDeptID").val() == null || $("#HDeptID").val() == '0') {
                    layer.msg("车间不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                if ($("#HICMOInterID").val() == '' || $("#HICMOInterID").val() == null || $("#HICMOInterID").val() == '0') {
                    layer.msg("生产订单不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return Result = false;
                }
                var msg = JSON.stringify(data.field) + ";" + "{};" + sessionStorage["HUserName"] + ";" + refSav;
                var index = layer.load();
                $.ajax({
                    type: "POST",
                    url: GetWEBURL() + "/Sc_MESBeginWorkBill/SaveGetMESBeginWorkFrom",
                    async: true,
                    data: { "msg": msg },
                    dataType: "json",
                    success: function (result) {
                        if (result.count == 1) {
                            $('#Saver').addClass("layui-btn-disabled").attr("disabled", true);//禁用保存按钮
                            $("#HInterID").val(result.HInterID);//获取提交成功返回的单据主ID
                            layer.msg(result.Message, { time: 1 * 2000, icon: 1 }, function (index) {
                                if (result.Verify == "Y") //自动审核
                                {
                                    layer.close(index);
                                    SaveVerify(); //审核
                                }
                                else {
                                    layer.close(index);
                                }
                            });
                            layer.close(index);
                        }
                        else {
                            layer.close(index);
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            });
            //#endregion
            //条形码回车方法
            $('#HBarCode').on('keydown', function (event) {
                var HBarCode = $('#HBarCode').val();
                if (event.keyCode == 13) {
                    if (!HBarCode) {
                        layer.msg("空白码,条形码不能为空!")
                        return;
                    }
                    txtHBarCode_KeyDown(HBarCode);
                }
            });
            //流水号(工序号)回车方法
            $('#HProcNo').on('keydown', function (event) {
                var sProcNo = $('#HProcNo').val();
                var sBillNo = $('#HMainSourceBillNo').val();
                if (event.keyCode == 13) {
                    if (!HProcExchBillNoFlag) {
                        layer.msg("流转卡没有扫描,或者没有按回车键,请扫描流转卡或者在流转卡文本框中按回车键!");
                        return;
                    }
                    txtHProcNo_KeyDown(sBillNo, sProcNo);
                }
            });
            //选择生产班组弹窗
            form.on('submit(ProductionTeam-BT)', function () {//选择生产班组
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '本站工序'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../Baseset/基础资料/Gy_GetProductionTeamList.html', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            //选择生产资源弹窗
            form.on('submit(ProductionResources-BT)', function () {//生产资源
                console.log($('#HProcNo').val())
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '生产资源'
                    , shade: 0.6 //遮罩透明度
                    //, maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../Baseset/基础资料/Gy_GetProductionResourcesList.html', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            //选择操作人
            form.on('submit(HEmployeeID-BT)', function () {
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '职员列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            //选择流水号弹窗
            form.on('submit(SerialNum-BT)', function () {//生产资源
                var value = $("#lngProcInterID").val();
                // åˆ¤æ–­æ˜¯å¦å·²ç»è¾“入流水号,是则弹出模态框,否则给出提示
                if (value) {
                    layer.open({
                        type: 2
                        , area: ['80%', '80%']
                        , title: '流水号'
                        , shade: 0.6 //遮罩透明度
                        //, maxmin: true //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: [`../../../Baseset/基础资料/Gy_GetProcNoList.html?HInterID=${value}`, 'yes']
                        , resize: false
                        , cancel: function (index, layero) {
                        }
                        , end: function () {
                            var sProcNo = $('#HProcNo').val();
                            var sBillNo = $('#HMainSourceBillNo').val();
                            if (sProcNo != "") {
                                txtHProcNo_KeyDown(sBillNo, sProcNo);
                            }
                        }
                    })
                } else {
                    layer.alert('请您确认输入流转卡号后重试^_^', { icon: 7 });
                }
            });
            //选择部门弹窗
            form.on('submit(btnHDept)', function () {//部门
                layer.open({
                    type: 2 //类型
                    , skin: 'layui-layer-rim'//加上边框
                    , area: ['90%', '90%']//大小
                    , title: '部门列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../../Baseset/基础资料/Gy_DepartmentList.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        //获取数据
                        $("#HDeptID").val(checkStatus.data[0].HItemID);
                        $("#HDeptName").val(checkStatus.data[0].HName);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                })
            });
            //退出--全屏版
            form.on('submit(Cancel)', function () {
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    parent.location.href = "../../../../views/index_Mobile.html";
                });
            })
            //新增
            form.on('submit(Add)', function () {
                var index = parent.layer.getFrameIndex(window.name); // å…ˆå¾—到当前 iframe å±‚的索引
                parent.layer.close(index); // å†æ‰§è¡Œå…³é—­
            })
            //#endregion
            //#region æœ¬é¡µé¢æ‰€æœ‰è¢«è°ƒç”¨çš„æ–¹æ³•
            //#region é€šè¿‡ç™»å½•用户获取默认值
            function GetDefValByUser() {
                var index = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Cj_StationInBill/GetDefValByUser",
                    type: "GET",
                    async: false,
                    data: { "Czybm": sessionStorage["Czybm"], "Czymc": sessionStorage["HUserName"] },
                    success: function (result) {
                        var data = result.data[0];
                        form.val("formData", {
                            //"HSourceID": data.HSourceID,
                            //"HSourceName": data.生产资源名称,
                            "HGroupID": data.HGroupID,
                            "HGroupName": data.生产班组名称,
                            "HEmpID": data.HEmpID,
                            "HEmpName": data.操作员名称
                        });
                        layer.close(index);
                    }
                    , error: function () {
                        layer.close(index);
                        layer.msg("接口请求失败");
                    }
                })
            }
            //#endregion
            //条形码回车方法
            function txtHBarCode_KeyDown(HBarCode) {
                var ajaxLoad = layer.load();
                var sql = "select * from Sc_ICMOBillStatus_Tmp where HICMOBillNo =  '" + HBarCode + "'" ;
                $.ajax({
                    url: GetWEBURL() + '/Gy_SOPBillList/WindowPrintList',
                    type: "GET",
                    async: false,
                    data: { "sWhere": sql },
                    success: function (data1) {
                        if (data1.count == 1) {
                            HSourceInterID = data1.data[0].HInterID;
                            HSourceEntryID = data1.data[0].HICMOEntryID;
                            HSourceBillNo = HBarCode;
                            HSourceBillType = data1.data[0].HBillType;
                        } else {
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                            layer.close(ajaxLoad);
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                        layer.close(ajaxLoad);
                    }
                });
                $.ajax(
                    {
                        type: "GET",
                        url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkFrom", //方法所在页面和方法名
                        async: false,
                        data: {
                            "HSourceInterID": HSourceInterID,
                            "HSourceEntryID": HSourceEntryID,
                            "HSourceBillNo": HSourceBillNo,
                            "HSourceBillType": HSourceBillType
                        },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1)// è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            {
                                var LoadData = data.data.h_p_JIT_GetInfoByICMOStatusInterID;
                                $("#HProcID").val(LoadData[0].HProcID); //当前工序ID
                                $("#HProcName").val(LoadData[0].HProcName); //当前工序
                                $("#HMaterID").val(LoadData[0].HMaterID); //产品ID
                                $("#HMaterCode").val(LoadData[0].HMaterNumber); //产品代码
                                $("#HMaterName").val(LoadData[0].HMaterName); //产品名称
                                $("#HMaterSpec").val(LoadData[0].HModel); //产品规格
                                $("#HSourceID").val(LoadData[0].HSourceID); //生产资源ID
                                $("#HSourceName").val(LoadData[0].HSourceName); //生产资源
                                $("#HMainSourceBillNo").val(LoadData[0].HICMOBillNo); //源单单号(暂时取值订单编号)
                                $("#HMainSourceInterID").val(LoadData[0].HSourceInterID); //源单主内码(取值HInterID)
                                $("#HMainSourceEntryID").val(LoadData[0].HSourceEntryID); //源单子内码(源单行号)
                                $("#HMainSourceBillType").val(HSourceBillType); //源单类型
                                $("#HDeptID").val(LoadData[0].HDeptID); //车间ID
                                $("#HDeptName").val(LoadData[0].HDeptName); //车间
                                $("#HICMOInterID").val(LoadData[0].HICMOInterID); //生产订单ID
                                $("#HICMOEntryID").val(LoadData[0].HICMOEntryID); //生产订单子ID
                                $("#HICMOBillNo").val(LoadData[0].HICMOBillNo); //生产订单
                                //HCenterID = LoadData[0].HCenterID == null ? sessionStorage["HWorkCenterID"] : LoadData[0].HCenterID;//工作中心id
                                layer.close(ajaxLoad);
                            }
                            else {
                                layer.alert(data.Message, { icon: 5 });
                                layer.close(ajaxLoad);
                            }
                        },
                        error: function (err) {
                            layer.alert(err, { icon: 5 });
                            layer.close(ajaxLoad);
                        }
                    });
            }
            //流水号回车方法
            function txtHProcNo_KeyDown(sBillNo, sProcNo) {
                var index = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Cj_StationInBill/txtHProcNo_KeyDown",
                    type: "GET",
                    data: { "sBillNo": sBillNo, "sProcNo": sProcNo },
                    success: function (result) {
                        if (result.count == 1) {
                            var data = result.data[0];
                            form.val("formData", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                                "HProcName": data.工序,
                                "HProcID": data.HProcID,
                                "HSourceID": data.HSourceID,
                                "HSourceName": data.生产资源
                            });
                            $("#HProcNo").attr("readonly", "readonly");
                            $("#HProcNo").css("background-color", "#efefef4d");
                            layer.close(index);
                        }
                        else {
                            layer.close(index);
                            layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.msg("接口请求失败!" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            }
            //审核提交
            function SaveVerify() {
                var InterID = $("#HInterID").val();
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/Sc_MESBeginWorkBill/AuditProcessReportList", //方法所在页面和方法名
                    async: true,
                    data: { "HInterID": InterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            layer.msg(data.Message, { time: 1 * 2000, icon: 1 }, function (index) {
                                //layer.close(layer.index);
                                //window.parent.location.reload();
                            });
                        }
                        else {
                            layer.alert(data.Message, { icon: 5 })
                        }
                    },
                    error: function (err) {
                        layer.alert(err, { icon: 5 })
                    }
                })
            }
            //有源单新增
            function set_AddNew() {
                //初始基本信息赋值
                $("#HDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));      //单据日期
                $("#HBeginWorkTime").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"))  //开始时间
                $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));  //制单日期
                $("#HMaker").val(sessionStorage["HUserName"]);     //制单人
                //加源单类型区分(可以写不同的方法)
                $('#HProcName').attr("disabled", true);
                $('#HSourceName').attr("disabled", true);
                $('#ProductionResources-BT').addClass("layui-btn-disabled").attr("disabled", true);
                $('#HMainSourceBillNo').attr("disabled", true);
                $('#HICMOBillNo').attr("disabled", true);
                $('#HDeptName').attr("disabled", true);
                $('#btnHDept').addClass("layui-btn-disabled").attr("disabled", true);
                $.ajax(
                    {
                        type: "GET",
                        url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkFrom", //方法所在页面和方法名
                        async: false,
                        data: {
                            "HSourceInterID": HSourceInterID,
                            "HSourceEntryID": HSourceEntryID,
                            "HSourceBillNo": HSourceBillNo,
                            "HSourceBillType": HBillType
                        },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1)// è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            {
                                var LoadData = data.data.h_p_JIT_GetInfoByICMOStatusInterID;
                                $("#HProcID").val(LoadData[0].HProcID); //当前工序ID
                                $("#HProcName").val(LoadData[0].HProcName); //当前工序
                                $("#HMaterID").val(LoadData[0].HMaterID); //产品ID
                                $("#HMaterNumber").val(LoadData[0].HMaterNumber); //产品代码
                                $("#HMaterName").val(LoadData[0].HMaterName); //产品名称
                                $("#HSourceID").val(LoadData[0].HSourceID); //生产资源ID
                                $("#HSourceName").val(LoadData[0].HSourceName); //生产资源
                                $("#HMainSourceBillNo").val(LoadData[0].HICMOBillNo); //源单单号(暂时取值订单编号)
                                $("#HMainSourceInterID").val(LoadData[0].HSourceInterID); //源单主内码(取值HInterID)
                                $("#HMainSourceEntryID").val(LoadData[0].HSourceEntryID); //源单子内码(源单行号)
                                $("#HMainSourceBillType").val(HSourceBillType); //源单类型
                                $("#HDeptID").val(LoadData[0].HDeptID); //车间ID
                                $("#HDeptName").val(LoadData[0].HDeptName); //车间
                                $("#HICMOInterID").val(LoadData[0].HICMOInterID); //生产订单ID
                                $("#HICMOEntryID").val(LoadData[0].HICMOEntryID); //生产订单子ID
                                $("#HICMOBillNo").val(LoadData[0].HICMOBillNo); //生产订单
                                //HCenterID = LoadData[0].HCenterID == null ? sessionStorage["HWorkCenterID"] : LoadData[0].HCenterID;//工作中心id
                            }
                            else {
                                layer.alert(data.Message, { icon: 5 });
                            }
                        },
                        error: function (err) {
                            layer.alert(err, { icon: 5 });
                        }
                    });
            }
            //以上为layui模块
        });
        //返回流水号
        function GetProcNoValue(obj) {
            $("#HProcNo").val(obj[0].流水号);
        }
        //返回生产班组
        function GetProductionTeamValue(obj) {
            $("#HGroupName").val(obj[0].班组);
            $("#HGroupID").val(obj[0].HItemID);
        }
        //返回生产资源
        function GetProductionResourcesValue(obj) {
            $("#HSourceName").val(obj[0].生产资源);
            $("#HSourceID").val(obj[0].HItemID);
        }
        //返回操作员
        function GetHWorkerValue(obj) {
            $("#HEmpName").val(obj[0].HName);
            $("#HEmpID").val(obj[0].HItemID);
        }
        //返回当前工序
        function GetHProcValue(obj) {  //返回当前工序
            $("#HProcName").val(obj[0].工序);
            $("#HProcID").val(obj[0].HItemID);
        }
    </script>
</body>
</html>
WebTM/views/Éú²ú¹ÜÀí/±¨¹¤Æ½Ì¨¹¦ÄÜÒ³/Gy_ButtonList.html
@@ -19,8 +19,8 @@
<body>
    <div class="layui-fluid">
        <div class="layui-col-md12">
            <div class="layui-card" style="padding: 1px">
                <div class="layui-card-body" style="padding: 1px;">
            <div class="layui-card" style="padding: 0px">
                <div class="layui-card-body" style="padding: 0px;">
                    <form class="layui-form" action="" lay-filter="component-form-group">
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
                        <script type="text/html" id="toolbarDemo">
@@ -130,7 +130,9 @@
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                                }
                                else if ($.inArray(data[i].name, totalArray) > -1) { //计算列  
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, totalRow: true, width: 120 });
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, totalRow: true, width: 80 });
                                } else if (data[i].name == "按钮id") {
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, totalRow: true, width: 80, hide:true });
                                } else {
                                    switch (data[i].Type) {
                                        //int
@@ -142,10 +144,10 @@
                                        case 'Int64':
                                        case 'double':
                                        case 'Decimal':
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 120, totalRow: true });
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 100, totalRow: true });
                                            break;
                                        default:
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 200 });
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 100 });
                                    }
                                }
                            }
@@ -157,7 +159,7 @@
                                , cols: [col]
                                , data: data1.data
                                , height: 'full-80'
                                , page: true
                                , page: false
                                , limits: [50, 500, 5000, 20000]
                                , limit: 50
                                , cellMinWidth: 90
WebTM/views/Éú²ú¹ÜÀí/Ç·ÁÏÔËËã/JIT_MaterialLevelShorAnalysisDetailReport.html
@@ -365,7 +365,7 @@
                                col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                            }
                            else if ($.inArray(data[i].name, totalArray) > -1) { //计算列  
                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 });
                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120, filter: true });
                            } else if (data[i].name == '是否匹配到订单') {
                                col.push({ field: '是否匹配到订单', title: '是否匹配到订单', sort: true, filter: true, templet: function (d) { return d.是否匹配到订单 ? '否' : '是'; } });
                            }
@@ -378,10 +378,10 @@
                                switch (data[i].Type) {
                                    //int
                                    case 'DateTime':
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + (data[i].name == "行关闭日期" ? "行关闭人" : data[i].name) + " ==''?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 200 });
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, filter: true, templet: "<div>{{d." + (data[i].name == "行关闭日期" ? "行关闭人" : data[i].name) + " ==''?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 200 });
                                        break;
                                    default:
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, filter: true });
                                }
                            }
                        }
@@ -391,7 +391,6 @@
                        HExportData = data1.data;
                        var firstdata = data1.data;
                        let itemMap = new Map();//
                        let maxLevel = firstdata[0].层级;
                        // ä½¿ç”¨ Map å­˜å‚¨å¯¹è±¡å¼•用,以处理可能的 Hitemid é‡å¤
                        //把相同的HICMOEntryID放到同一个对象数组里
                        firstdata.forEach(item => {
@@ -408,7 +407,7 @@
                        });
                        // ç¬¬äºŒæ¬¡éåŽ†ï¼Œæž„å»ºå±‚æ¬¡ç»“æž„å¹¶è®¾ç½® isParent
                        firstdata.forEach(item => {
                            if (item.层级 === maxLevel) {
                            if (item.物料ID == HMaterID) {
                                root.push(item);
                            } else {
                                const parentList = itemMap.get(item.HMainICMOEntryID);
@@ -449,10 +448,46 @@
                data: { "sWhere": sql },
                success: function (data1) {
                    if (data1.count == 1) {
                        var data = [];//列字段数据
                        var col = [];
                        var totalArray = [];
                        var titleData = [];
                        //给空的数组赋值
                        for (var key in data1.list) {//循序遍历数组
                            data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });//从每个对象中提取数据
                        }
                        //在列表左边添加勾选框
                        col.push({ type: 'checkbox', fixed: 'left', totalRowText: '合计' });
                        for (var i = 0; i < data.length; i++) {//遍历data数组重的数据
                            // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                            if ($.inArray(data[i].name, titleData) > -1) {//检查data【i】.name是否在数组中  //计算列
                                col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                            }
                            else if ($.inArray(data[i].name, totalArray) > -1) { //计算列
                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120, filter: true });
                            } else if (data[i].name == '是否匹配到订单') {
                                col.push({ field: '是否匹配到订单', title: '是否匹配到订单', sort: true, filter: true, templet: function (d) { return d.是否匹配到订单 ? '否' : '是'; } });
                            }
                            else if (data[i].name == '是否匹配到要料计划信息') {
                                col.push({ field: '是否匹配到要料计划信息', title: '是否匹配到要料计划信息', sort: true, filter: true, templet: function (d) { return d.是否匹配到要料计划信息 ? '否' : '是'; } });
                            } else if (isValidDate(data[i].name)) {
                                col.push({ field: data[i].name, title: Format(data[i].name, 'MM.dd'), width: 70, totalRow: true, filter: true })
                            }
                            else {
                                switch (data[i].Type) {
                                    //int
                                    case 'DateTime':
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, filter: true, templet: "<div>{{d." + (data[i].name == "行关闭日期" ? "行关闭人" : data[i].name) + " ==''?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 200 });
                                        break;
                                    default:
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, filter: true });
                                }
                            }
                        }
                        option2.cols = [col];
                        HExportData2 = data1.data;
                        var firstdata = data1.data;
                        let itemMap = new Map();//
                        let maxLevel = firstdata[firstdata.length-1].层级;
                        // ä½¿ç”¨ Map å­˜å‚¨å¯¹è±¡å¼•用,以处理可能的 Hitemid é‡å¤
                        //把相同的HICMOEntryID放到同一个对象数组里
                        firstdata.forEach(item => {
@@ -469,7 +504,7 @@
                        });
                        // ç¬¬äºŒæ¬¡éåŽ†ï¼Œæž„å»ºå±‚æ¬¡ç»“æž„å¹¶è®¾ç½® isParent
                        firstdata.forEach(item => {
                            if (item.层级 === maxLevel) {
                            if (item.物料ID == HMaterID) {
                                root.push(item);
                            } else {
                                const parentList = itemMap.get(item.HICMOEntryID);
@@ -487,7 +522,6 @@
                                }
                            }
                        });
                        option2.cols = option.cols;
                        option2.data = root;
                        //列设置
WebTM/views/Éú²ú¹ÜÀí/Ç·ÁÏÔËËã/JIT_MaterialLevelShorAnalysisReport.html
@@ -427,7 +427,7 @@
                                col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                            }
                            else if ($.inArray(data[i].name, totalArray) > -1) { //计算列  
                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 });
                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120, filter: true });
                            } else if (data[i].name == '是否匹配到订单') {
                                col.push({ field: '是否匹配到订单', title: '是否匹配到订单', sort: true, filter: true, templet: function (d) { return d.是否匹配到订单 ? '否' : '是'; } });
                            }
@@ -443,7 +443,7 @@
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + (data[i].name == "行关闭日期" ? "行关闭人" : data[i].name) + " ==''?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 200 });
                                        break;
                                    default:
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, filter: true, width: 200 });
                                }
                            }
                        }