yusijie
2022-11-21 21bfbd76f317f2904b674a0456811e3554b488b0
作业指导书
2个文件已修改
229 ■■■■■ 已修改文件
WebTM/WebTM.csproj 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/基础资料/生产基础资料/Gy_SOPBill.html 219 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/WebTM.csproj
@@ -63,13 +63,6 @@
    <Reference Include="System.EnterpriseServices" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Files\20189141702680356.jpg" />
    <Content Include="Files\20200922022838-5f6961562471f.jpg" />
    <Content Include="Files\OIP-C %283%29.jpg" />
    <Content Include="Files\OIP-C.jpg" />
    <Content Include="Files\R-C.jpg" />
    <Content Include="Files\v2-91ca7874809d6ff91a49e5ad6a89f7f3_r.jpg" />
    <Content Include="Files\测试.jpeg" />
    <Content Include="HtmlPage1.html" />
    <Content Include="layuiadmin\echarts.min.js" />
    <Content Include="layuiadmin\layui\css\global.css" />
@@ -82,8 +75,6 @@
    <Content Include="layuiadmin\layui\font\iconfont.woff" />
    <Content Include="layuiadmin\layui\font\iconfont.woff2" />
    <Content Include="layuiadmin\json\Test.json" />
    <Content Include="Files\Test PDF.pdf" />
    <Content Include="Files\Test.pdf" />
    <None Include="Properties\PublishProfiles\JFTM.pubxml" />
    <Content Include="layuiadmin\layui\images\device.png" />
    <Content Include="layuiadmin\layui\images\erro.png" />
@@ -726,7 +717,6 @@
    <Content Include="views\基础资料\数据字典\Xt_DataDictionary_ViewList.html" />
    <Content Include="views\基础资料\数据字典\Xt_DataDictionary_TableList.html" />
    <Content Include="views\基础资料\生产基础资料\Add_Edit_Gy_Process.html" />
    <Content Include="views\基础资料\生产基础资料\作业指导书.png" />
    <Content Include="views\基础资料\生产基础资料\Gy_SOPBill.html" />
    <Content Include="views\基础资料\生产基础资料\Gy_SOPBillEdit.html" />
    <Content Include="views\基础资料\生产基础资料\Gy_SOPBillList.html" />
WebTM/views/»ù´¡×ÊÁÏ/Éú²ú»ù´¡×ÊÁÏ/Gy_SOPBill.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>作业指导书</title>
@@ -34,7 +34,7 @@
        }
        .layui-table-cell{
            height:20px;
            height:23px;
        }
    </style>
@@ -51,7 +51,7 @@
                                    <button type="button" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="Exit" style="background-color:#959393">退出</button>
                                </div>
                                <div class="layui-inline">
                                    <button type="button" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="IsAuto" style="background-color:#959393;margin-left:15px" id="auto">自动播放</button>
                                    <button type="button" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="Autoplay" style="background-color:#959393;margin-left:15px" id="auto">自动播放</button>
                                </div>
                                <div class="layui-inline">
                                    <h1 style="text-align: center;margin-left:300px"><b>工位作业指导书</b></h1>
@@ -90,19 +90,13 @@
                            <!--<table class="" id="mainTable" lay-filter="mainTable"></table>-->
                            <div style="margin-top:10px; width:100%;height:100%">
                                <div style="width:77%;height:670px;float:left;line-height:500px">
                                    <!--<button type="button" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="" style="background-color:#959393;width:10px;height:80px;vertical-align:middle;float:left;margin:200px 0 0 1.5px;font-size:25px"><</button>-->
                                    <div class="layui-carousel" id="test1">
                                        <div carousel-item>
                                            <div><img src="作业指导书.png" style="width:100%;height:100%"></div>
                                            <div><img id="img" src="" style="width:100%;height:100%"></div>
                                            <div><img src="../../../Files/R-C.jpg" style="width:100%;height:100%"></div>
                                            <!--<div><embed src="Test PDF.pdf" type="application/pdf" style="width:100%;height:100%" internalinstanceid="81" /></div>-->
                                        <div carousel-item id="file">
                                        </div>
                                    </div>
                                    <!--<button type="button" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="" style="background-color:#959393;width:10px;height:80px;vertical-align:middle;float:left;margin-top:200px;font-size:25px">></button>-->
                                </div>
                                <div style="width:22%;height:670px;float:left;margin-left:1%">
                                    <div style="width:100%;height:49%;margin-bottom:2%">
@@ -124,7 +118,7 @@
        </div>
    </div>
    <script type="text/html" id="barDemo">
        <!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
        <!--<a class="layui-btn layui-btn-xs" lay-event="view">查看</a>-->
        <!--<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>-->
    </script>
    <script type="text/javascript">
@@ -140,28 +134,6 @@
            var HSouceBillType = params[params[2]];//源单类型
            var closeType = params[params[3]];  //关闭类型
        }
        // æŠ¥å·¥å¹³å°;工序流转卡维护;生产资源列表
        //1.进入模块,从本地配置文件获取所属生产资源和工位,初始化模块。界面清空,右边上网格显示该生产资源生产状态表里的当日计划工单,默认为当前开工的工单,下网格显示这个工单及该工位的文件清单(获取作业指导书的数据)。
        //2.左边显示工位作业指导书的第一张文件(图片或PDF) ã€‚
        //3.点击上一张,下一张,可以在作业指导书的本工位的文件列表里切换PDF文件或图片;
        //4.工单列表里,双击或者点查看按钮,可以切换工单,左边 ä½œä¸šæŒ‡å¯¼ä¹¦ä¹Ÿç›¸åº”改变,下网格的文件列表也应改
        //变;
        //5.自动播放按钮,点击自动播放按钮,进行自动播放模式,按钮名字改为“手动播, ç‚¹å‡» æ‰‹åŠ¨æ’­æ”¾ æŒ‰é’®ï¼Œâ€è¿›è¡Œæ‰‹åŠ¨æ’­æ”¾æ¨¡å¼
        //6.手动播放模式下,不手动切换,当前工单,作业指导书均不做变更。
        //7.自动播放模式下,每2分钟做一次查询,获取当前开工的工单,如果目前开工的工单和界面上显示的工单不符合时,自动切换到开工的工单,作业指导书也相关更新
        //8.退出按钮。退出本模块。
        //产品根据工单来;自动播放:当前工序完成后自动切换指导书等,手动播放:约等于什么都不做;工单列表里显示当日需要进行得任务;页面调整为全屏显示,
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
@@ -184,9 +156,9 @@
            var option = [];
            var option2 = [];
            var arr = [];
            var HInterID;
            //#endregion
            //#region è¿›å…¥é¡µé¢æ—¢åŠ è½½
            $("#img").attr("src", "http://localhost:8082/LuBaoUi/Files/OIP-C.jpg")
            //初始化表格
            set_InitGrid();
            set_InitGrid2();
@@ -196,9 +168,9 @@
                , width: '100%' //设置容器宽度
                , height: '100%' //设置容器高度
                , arrow: 'always' //始终显示箭头
                , indicator: 'none' //指示器不显示
                , indicator: 'inside' //指示器不显示
                , autoplay: false //手动播放
                , interval: 2000 //播放速度
                , interval: 3000 //播放速度
            });
            //#region  èŽ·å–æ—¶é—´æ—¥æœŸ
            $(document).ready(function () {
@@ -224,13 +196,27 @@
            });
            //#endregion
            //加载数据到网格
            get_Display(sWhere);
            get_Display(sWhere);
            get_Display2(sWhere);
            get_Display2(sWhere);
            //#region åŠ è½½æ•°æ®åˆ°ç½‘æ ¼
            //get_Display(sWhere);
            //判断操作类型
            //采用延时的方式等待数据
            get_Display(sWhere);
            setTimeout(function () { get_Display2(sWhere); }, 1000);
            setTimeout(function () { get_Display2(sWhere); }, 1000);
            setTimeout(function () { get_Display3(sWhere); }, 1000);
            setTimeout(function () { ins.reload({ autoplay: false }) }, 1500);
            //#endregion
            //#region è‡ªåŠ¨æ’­æ”¾æ¨¡å¼ä¸‹èŽ·å–é¡µé¢ä¿¡æ¯çš„æ–¹æ³•
            function set_LoadAgain() {
                get_Display(sWhere);
                get_Display2(sWhere);
                get_Display3(sWhere);
                setTimeout(function () { ins.reload({ autoplay: false }) }, 500);
            }
            //#endregion
            //#region åˆ¤æ–­æ“ä½œç±»åž‹(这里没用到)
            if (OperationType == 1 || OperationType == 2) {//无源新增
                //初始基本信息赋值                
            }
@@ -240,10 +226,10 @@
            else {
                layer.alert("未知操作类型!", { icon: 5 });
            }
            //#endregion
            //退出
            //#region é€€å‡º
            form.on('submit(Exit)', function (data) {
                if (linterid == undefined) {
                    //关闭页签
@@ -254,63 +240,78 @@
                    Pub_Close(1);
                }
            });
            //是否自动播放
            form.on('submit(IsAuto)', function (data) {
                var num = 0;
                if (ins.config.autoplay == false) {
                    ins.reload({ autoplay: true }) //播放方式改为自动播放
             //#endregion
            //#region æ˜¯å¦è‡ªåŠ¨æ’­æ”¾
            form.on('submit(Autoplay)', function (data) {
                var num = 0;
                if (document.getElementById("auto").innerHTML == "自动播放") {
                    //ins.reload({ autoplay: true }) //轮播图播放方式改为自动播放
                    document.getElementById("auto").innerHTML = "手动播放";
                    var timer = setInterval(function () {
                        set_LoadAgain();
                        if (document.getElementById("auto").innerHTML === "自动播放") {
                            clearInterval(timer); //暂停周期函数
                        }}, 120000) //每隔两分钟执行一次
                    num = 1;
                } else if (ins.config.autoplay == true && num == 0) {
                    ins.reload({ autoplay: false }) //播放方式改为手动播放
                } else if (document.getElementById("auto").innerHTML = "手动播放" && num == 0) {
                    //ins.reload({ autoplay: false }) //轮播图播放方式改为手动播放
                    document.getElementById("auto").innerHTML = "自动播放";
                }
            });
             //#endregion
            //#region ç‚¹å‡»äº‹ä»¶åŒ…括on form事件等
            //#region ç‚¹å‡»äº‹ä»¶åŒ…括on form事件等 ï¼ˆè¿™é‡Œæ²¡ç”¨åˆ°ï¼‰
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                switch (obj.event) {
                    //新增一行
                    case 'btn-AddLine': btnAddLine(NewRow);
                        break;
                    //复制一行
                    case 'btn-CopyLine': btnCopyLine(data);
                        break;
                    //列设置
                    case 'set_HideColumn': get_HideColumn();
                        break;
                }
            });
            //行内事件
            table.on('tool(mainTable)', function (obj) {
                set_GridDelete(obj);   //行内删除
                //set_GridCellCheck(obj); //行内快捷键筛选
            });
            //监听单元格编辑  å•元格编辑后 å˜æ›´
            //table.on('edit(mainTable)', function (obj) {
            //    var value = obj.value //得到修改后的值
            //        , data = obj.data //得到所在行所有键值
            //        , field = obj.field; //得到字段
            //    arr.push(data);
            //});
            //#endregion
            //点击主表带出从表数据
            table.on('row(mainTable)', function (obj) { //注:tool æ˜¯å·¥å…·æ¡äº‹ä»¶åï¼Œtest æ˜¯ table åŽŸå§‹å®¹å™¨çš„å±žæ€§ lay-filter="对应的值"
                console.log(obj);
            //#region ç‚¹å‡»ä¸»è¡¨å¸¦å‡ºä»Žè¡¨æ•°æ®
            table.on('rowDouble(mainTable)', function (obj) { //注:tool æ˜¯å·¥å…·æ¡äº‹ä»¶åï¼Œtest æ˜¯ table åŽŸå§‹å®¹å™¨çš„å±žæ€§ lay-filter="对应的值"
                //var datas = obj.data; //获得当前行数据
                //HBillNo = datas["单据号"].toString();
                //var HMainID = datas.hmainid;
                var wait = layer.load();
                HInterID = obj.data.HInterID
                if (HInterID == "" || HInterID == null) {
                    HInterID = 0;
                }
                $("#file").html("");
                $(".layui-carousel-ind").html("");
                $.ajax({
                    url: GetWEBURL() + '/Sc_ICMOBillStatus_Tmp/Filelist',
                    type: "GET",
                    //data: { "sWhere": HMainID },
                    data: { "sWhere": HInterID },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option2.data = data1.data;
                            table.render(option2);
                            for (let i = 0; i < data1.data.length; i++) {
                                var html = '';
                                if (data1.data[i].文件类型 == '.jpeg' || data1.data[i].文件类型 == '.jpg') {
                                    var FileName = data1.data[i].文件名称;
                                    //html += '<img src=`../../../Files/${FileName}` style="width:100%;height:100%">'
                                    html += '<div><img src=../../../Files/' + FileName + ' alt="" style="width:100%;height:100%"></div>'
                                    $("#file").append(html);
                                }
                                if (data1.data[i].文件类型 == '.pdf') {
                                    var FileName2 = data1.data[i].文件名称;
                                    //<embed src="Test PDF.pdf" type="application/pdf" style="width:100%;height:100%" internalinstanceid="81" />
                                    html += '<div><embed src="../../../Files/' + FileName2 + '"' + ' type="application/pdf" style="width:100%;height:100%" internalinstanceid="81" /></div>'
                                    $("#file").append(html);
                                }
                            }
                            if (data1.data.length == 0) {
                                var html2 = '<h1 style="text-align:center;color:red;font-weight:bolder;">暂未上传文件</h1>';
                                $("#file").append(html2);
                            }
                            ins.reload({ autoplay: false })
                            layer.close(wait);
                        } else {
                            layer.alert(data1.code + data1.Message, { icon: 5 });
@@ -321,12 +322,10 @@
                        layer.alert("接口失效!", { icon: 5 });
                    }
                });
                //DisPlay_HideColumn_Sec();
                //set_ClearBillHMainID(HMainID);    //器具清单
            });
            //#endregion
            //初始化表格
            //#region åˆå§‹åŒ–表格
            function set_InitGrid() {
                option = {
                    id: 'mainTable'
@@ -345,7 +344,7 @@
                        , { field: '物料名称', title: '物料名称', width: 100 }
                        , { field: '规格型号', title: '规格型号', width: 100 }
                        , { field: '工序', title: '工序', width: 100 }
                        //, { fixed: 'right', title: '操作', toolbar: '#barDemo', width: 60 }
                        //, { fixed: 'right', title: '操作', toolbar: '#barDemo', width: 66 }
                    ]]
                    , limits: [50, 500, 5000, 20000]
                    , done: function (res, curr, count) {
@@ -375,8 +374,9 @@
                    }
                };
            }
            //加载网格
           //#endregion
            //#region åŠ è½½ç½‘æ ¼
            function get_Display(sWhere) {
                var wait = layer.load();//遮罩
                $.ajax({
@@ -385,6 +385,9 @@
                    data: { "sWhere": sessionStorage["HSourceID"], "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.count == 1) {
                            if (data1.data[0]) {
                                HInterID = data1.data[0].HInterID
                            }
                            option.data = data1.data;
                            table.render(option);
                            layer.close(wait);
@@ -401,11 +404,14 @@
            //加载右下方网格
            function get_Display2(sWhere) {
                if (HInterID == "" || HInterID == null) {
                    HInterID = 0;
                }
                var wait = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/Sc_ICMOBillStatus_Tmp/Filelist',
                    type: "GET",
                    //data: { "sWhere": HMainID },
                    data: { "sWhere": HInterID },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option2.data = data1.data;
@@ -421,7 +427,52 @@
                    }
                });
            }
            //加载左侧文件
            function get_Display3(sWhere) {
                if (HInterID == "" || HInterID == null) {
                    HInterID = 0;
                }
                $("#file").html("");
                $(".layui-carousel-ind").html("");
                $.ajax({
                    url: GetWEBURL() + '/Sc_ICMOBillStatus_Tmp/Filelist',
                    type: "GET",
                    data: { "sWhere": HInterID },
                    success: function (data1) {
                        if (data1.count == 1) {
                            for (let i = 0; i < data1.data.length; i++) {
                                var html = '';
                                if (data1.data[i].文件类型 == '.jpeg' || data1.data[i].文件类型 == '.jpg') {
                                    var FileName = data1.data[i].文件名称;
                                    //html += '<img src=`../../../Files/${FileName}` style="width:100%;height:100%">'
                                    html += '<div><img src=../../../Files/' + FileName + ' alt="" style="width:100%;height:100%"></div>'
                                    $("#file").append(html);
                                }
                                if (data1.data[i].文件类型 == '.pdf') {
                                    var FileName2 = data1.data[i].文件名称;
                                    //<embed src="Test PDF.pdf" type="application/pdf" style="width:100%;height:100%" internalinstanceid="81" />
                                    html += '<div><embed src="../../../Files/' + FileName2 + '"' + ' type="application/pdf" style="width:100%;height:100%"  internalinstanceid="81" /></div>'
                                    $("#file").append(html);
                                }
                            }
                            if (data1.data.length == 0) {
                                var html2 = '<h1 style="text-align:center;color:red;font-weight:bolder;">暂未上传文件</h1>';
                                $("#file").append(html2);
                            }
                            ins.reload({ autoplay: false })
                            //layer.close(wait);
                        } else {
                            //layer.close(wait);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        //layer.close(wait);
                        layer.alert("接口失效!", { icon: 5 });
                    }
                });
            }
            //#endregion
            //以上是layui模块
        });
    </script>