zrg
2024-04-17 3cd0c73d31f332a9a32a94bb0d2a75d1e99a6b42
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-LayUI
2个文件已修改
3个文件已添加
219 ■■■■ 已修改文件
WebTM/Files/213/铅笔.jpg 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/Files/213/铅笔2.jpg 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/Files/Material/ZY004/R-C.jpg 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/基础资料/公用基础资料/Add_Edit_Gy_Material.html 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/基础资料/公用基础资料/Gy_Material.html 135 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/Files/213/Ǧ±Ê.jpg
WebTM/Files/213/Ǧ±Ê2.jpg
WebTM/Files/Material/ZY004/R-C.jpg
WebTM/views/»ù´¡×ÊÁÏ/¹«Óûù´¡×ÊÁÏ/Add_Edit_Gy_Material.html
@@ -1584,19 +1584,19 @@
                    , uploadListIns = upload.render({
                        elem: '#testList'
                        , url: GetWEBURL() + "/Cj_StationOutBill/UploadFile1"
                        , url: GetWEBURL() + "/Gy_Mater/UploadFile"
                        , accept: 'file'
                        , multiple: true
                        , auto: false
                        //, bindAction: '#testListAction' //按扭绑定
                        , data: { "HBillNo": $("#HNumber").val(), "HRemark": $("#HRemark").val(), "HUserName": sessionStorage["HUserName"] }
                        , data: { "HNumber": $("#HNumber").val(), "HRemark": $("#HRemark").val(), "HUserName": sessionStorage["HUserName"] }
                        , choose: function (obj) {
                            var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
                            //读取本地文件
                            obj.preview(function (index, file, result) {
                                var tr = $(['<tr id="upload-' + index + '">'
                                    , '<td>' + file.name + '</td>'
                                    , '<td>' + '<img id="showImg" class="ImgClass" style="width: 150px; margin:10px;cursor:pointer;"src="' + result + '" alt="' + file.name + '">' + '</td>'
                                    , '<td>' + '<img onclick=\"previewImg(this)\" id="showImg" class="ImgClass" style="width: 150px; margin:10px;cursor:pointer;"src="' + result + '" alt="' + file.name + '">' + '</td>'
                                    , '<td>' + (file.size / 1014).toFixed(1) + 'kb</td>'
                                    , '<td>等待上传</td>'
                                    , '<td>'
@@ -1621,30 +1621,6 @@
                                ProImgByList.append(tr);
                                //某图片放大预览
                                $(".ImgClass").click(function () {
                                    var idx = $(".ImgClass").index(this);//获取点击行下标显示对应的图片
                                    var width = $("#showImg").width();
                                    var height = $("#showImg").height();
                                    var scaleWH = width / height;
                                    var bigH = 600;
                                    var bigW = scaleWH * bigH;
                                    if (bigW > 900) {
                                        bigW = 900;
                                        bigH = bigW / scaleWH;
                                    }
                                    // æ”¾å¤§é¢„览图片
                                    layer.open({
                                        type: 1,
                                        title: false,
                                        closeBtn: 1,
                                        shadeClose: true,
                                        area: [bigW + 'px', bigH + 'px'], //宽高
                                        content: "<img width='" + bigW + "' height='" + bigH + "' src=" + result + " />"
                                    });
                                });
                            });
                        }
                        , done: function (res, index, upload) {
@@ -1672,9 +1648,9 @@
            function getFile() {
                var ProImgByList = $('#ProImgByList')
                $.ajax({
                    url: GetWEBURL() + '/Cj_StationOutBill/Filelist',
                    url: GetWEBURL() + '/Gy_Mater/Filelist',
                    type: "GET",
                    data: { "HBillNo": $("#HNumber").val() },
                    data: { "HNumber": $("#HNumber").val() },
                    success: function (data1) {
                        if (data1.count == 1) {
                            var index = 0;
@@ -1683,7 +1659,7 @@
                                    , '<td style="display:none">' + data1.data[i].HItemID + '</td>'
                                    , '<td style="display:none">' + data1.data[i].HSourceBillNo + '</td>'
                                    , '<td>' + data1.data[i].HFileName + '</td>'
                                    , '<td>' + '<img id="showImg' + i + '" class="ImgClass" style="width: 150px; margin:10px;cursor:pointer;"src="' + data1.data[i].HFilePath + '" alt="' + data1.data[i].HFileName + '">' + '</td>'
                                    , '<td>' + '<img onclick=\"previewImg(this)\" id="showImg' + i + '" class="ImgClass" style="width: 150px; margin:10px;cursor:pointer;"src="' + data1.data[i].HFilePath + '" alt="' + data1.data[i].HFileName + '">' + '</td>'
                                    , '<td>' + (data1.data[i].HFileSize / 1014).toFixed(1) + 'kb</td>'
                                    , '<td style="color: #5FB878;">上传成功</td>'
                                    , '<td style="display:none">' + data1.data[i].url + '</td>'
@@ -1695,29 +1671,6 @@
                                $('#ProImgByList').append(tr);
                            }
                            //某图片放大预览
                            $(".ImgClass").click(function () {
                                var idx = $(".ImgClass").index(this);//获取点击行下标显示对应的图片
                                var width = $("#showImg" + idx).width();
                                var height = $("#showImg" + idx).height();
                                var scaleWH = width / height;
                                var bigH = 600;
                                var bigW = scaleWH * bigH;
                                if (bigW > 900) {
                                    bigW = 900;
                                    bigH = bigW / scaleWH;
                                }
                                // æ”¾å¤§é¢„览图片
                                layer.open({
                                    type: 1,
                                    title: false,
                                    closeBtn: 1,
                                    shadeClose: true,
                                    area: [bigW + 'px', bigH + 'px'], //宽高
                                    content: "<img width='" + bigW + "' height='" + bigH + "' src=" + data1.data[idx].HFilePath + " />"
                                });
                            });
                        } else {
                            layer.alert(data1.code + data1.Message, { icon: 5 });
@@ -1760,7 +1713,7 @@
                //删除已上传文件
                $.ajax({
                    url: GetWEBURL() + '/Cj_StationOutBill/DeleteFilelist',
                    url: GetWEBURL() + '/Gy_Mater/DeleteFilelist',
                    type: "GET",
                    data: { "HItemID": HItemID, "HSourceBillNo": HSourceBillNo, "HFileName": HFileName },
                    success: function (data1) {
@@ -1801,6 +1754,29 @@
                $("#HSecUnitID").val(obj[0].HItemID);
            }
        }
        function previewImg(obj) {
            var img = new Image();
            img.src = obj.src;
            var height = img.height + 500; //获取图片高度
            var width = img.width + 500; //获取图片宽度
            var imgHtml = "<img src='" + obj.src + "' width='100%' height='100%'/>";
            //弹出层
            layer.open({
                type: 1,
                shade: 0.8,
                offset: 'auto',
                area: ['80%', '80%'],
                shadeClose: true,
                scrollbar: false,
                title: "图片预览", //不显示标题
                content: imgHtml, //捕获的元素,注意:最好该指定的元素要存放在body最外层,否则可能被其它的相对元素所影响
                cancel: function () {
                    //layer.msg('捕获就是从页面已经存在的元素上,包裹layer的结构', { time: 5000, icon: 6 });
                }
            });
        }
    </script>
</body>
WebTM/views/»ù´¡×ÊÁÏ/¹«Óûù´¡×ÊÁÏ/Gy_Material.html
@@ -103,16 +103,26 @@
                                </div>
                            </div>
                        </div>
                        <div class="layui-row" style="padding:10px 0">
                        <!--放在form标签当中会影响轮播图箭头的使用,所以移到form标签外面-->
                        <!--<div class="layui-row" style="padding:10px 0">
                            <div class="layui-col-xs3 layui-inline" style="border: solid 1.5px #e0d6d64d;">
                                <div id="TreeTable" class="demo-tree demo-tree-box"></div>
                                <div id="TreeTable" class="demo-tree demo-tree-box" style="width:99.5%;height:calc(50vh);"></div>
                                <div style="width:99.5%;height:calc(35vh);position: relative;">-->
                                    <!--//轮播图-->
                                    <!--<div class="layui-carousel" id="test1" style="position:absolute;">-->
                                        <!--透明度 opacity: 0.2-->
                                        <!--<div carousel-item id="file">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-col-xs8 layui-inline" style="padding-left: 10px; width: 73%">
                                <div>
                                    <table class="" id="mainTable" lay-filter="mainTable"></table>
                                </div>
                            </div>
                        </div>
                        </div>-->
                        <!--<table class="" id="mainTable" lay-filter="mainTable"></table>-->
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
@@ -134,6 +144,25 @@
                            </div>
                        </script>
                    </form>
                    <div class="layui-row" style="padding:10px 0">
                        <div class="layui-col-xs3 layui-inline" style="border: solid 1.5px #e0d6d64d;">
                            <div id="TreeTable" class="demo-tree demo-tree-box" style="width:99.5%;height:calc(50vh);"></div>
                            <div style="width:99.5%;height:calc(35vh);position: relative;">
                                <!--//轮播图-->
                                <div class="layui-carousel" id="test1" style="position:absolute;">
                                    <!--透明度 opacity: 0.2-->
                                    <div carousel-item id="file">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-col-xs8 layui-inline" style="padding-left: 10px; width: 73%">
                            <div>
                                <table class="" id="mainTable" lay-filter="mainTable"></table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
@@ -145,7 +174,7 @@
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate','tree'], function () {
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate', 'tree', 'carousel'], function () {
            //#region å…¬ç”¨å˜é‡
            var $ = layui.$
                , admin = layui.admin
@@ -156,6 +185,7 @@
                , laypage = layui.laypage
                , laydate = layui.laydate
                , tree = layui.tree
                , carousel = layui.carousel
            var sWhere = "";
            var option = [];
            var Organization = sessionStorage["Organization"];
@@ -167,6 +197,16 @@
            //#endregion
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
            // è½®æ’­å›¾
            var Carousel = carousel.render({
                elem: '#test1'
                , width: '100%' //设置容器宽度
                , height: '100%' //设置容器高度
                , arrow: 'always' //始终显示箭头
                , indicator: 'inside' //指示器不显示
                , autoplay: false //手动播放
                , interval: 3000 //播放速度
            });
            //初始化界面
            set_ClearBill();
@@ -184,7 +224,7 @@
                        set_AddNew();
                        break;
                    case 'btn-Edit':
                        set_ShowBill();
                        set_ShowBill();
                        break;
                    case 'btn-copy':
                        set_copy();
@@ -316,6 +356,8 @@
                        l.LAY_CHECKED = flag;
                    }
                });
                getFileList_loaded(obj.data.物料代码);
            })
            //#endregion
@@ -343,7 +385,10 @@
                addSWhereByOpenType();
                get_Display_Tree();
                //物料图片位置默认为空
                var html2 = '<h1 style="text-align:center;line-height:290px;color:red;font-weight:bolder;"></h1>';
                $("#file").append(html2);
                Carousel.reload({ autoplay: false })
                //if (openType == 2) {
                //    addSWhereByOpenType();
                //    //get_Display(sWhere);
@@ -420,7 +465,7 @@
            //#region æŸ¥è¯¢
            function get_Display(sWhere) {
                var wait = layer.load();//遮罩
                var ajaxLoad = layer.load();
                var ajaxLoad = layer.load();
                $.ajax({
                    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                    url: GetWEBURL() + '/Gy_Material/list',
@@ -488,7 +533,7 @@
            //#endregion
            //#region å¿«é€Ÿè¿‡æ»¤
            function get_FastQuery() {
@@ -892,6 +937,58 @@
                return subStr;
            }
            //#region ç‚¹å‡»ç‰©æ–™æ—¶,获取已上传的文件列表
            function getFileList_loaded(HMaterNumber) {
                $("#file").html("");
                $(".layui-carousel-ind").html("");
                var HBillNo = HMaterNumber;
                if (HBillNo != null && HBillNo != undefined) {
                    var wait = layer.load();//遮罩
                    $.ajax({
                        url: GetWEBURL() + '/Cj_StationOutBill/Filelist',
                        async: false,
                        type: "GET",
                        data: { "HBillNo": HBillNo },
                        success: function (data1) {
                            if (data1.count == 1) {
                                if (data1.data[0]) {
                                    HInterID = data1.data[0].HInterID
                                }
                                option.data = data1.data;
                                //table.render(option);
                                for (let i = 0; i < data1.data.length; i++) {
                                    var html = '';
                                    if (data1.data[i].HFileType == '.jpeg' || data1.data[i].HFileType == '.jpg') {
                                        html += '<div><img onclick=\"previewImg(this)\"  src=../../..' + data1.data[i].HFilePath + ' alt="" style="width:100%;height:100%"></div>'
                                        $("#file").append(html);
                                    }
                                    if (data1.data[i].HFileType == '.pdf') {
                                        html += '<div><embed src="../../..' + data1.data[i].HFilePath + '"' + ' 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;line-height:290px;color:red;font-weight:bolder;">暂未上传文件</h1>';
                                    $("#file").append(html2);
                                }
                                Carousel.reload({ autoplay: false })
                                layer.close(wait);
                            } else {
                                layer.close(wait);
                                layer.alert(data1.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.close(wait);
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
            }
            //#endregion
            //#region éšè—åˆ—设置
            function get_HideColumn() {
                var colName = "";
@@ -1135,6 +1232,28 @@
        function GetDataCol(data) {
            GetDataCols = data;
        }
        function previewImg(obj) {
            var img = new Image();
            img.src = obj.src;
            var height = img.height + 500; //获取图片高度
            var width = img.width + 500; //获取图片宽度
            var imgHtml = "<img src='" + obj.src + "' width='100%' height='100%'/>";
            //弹出层
            layer.open({
                type: 1,
                shade: 0.8,
                offset: 'auto',
                area: ['100%', '100%'],
                shadeClose: true,
                scrollbar: false,
                title: "图片预览", //不显示标题
                content: imgHtml, //捕获的元素,注意:最好该指定的元素要存放在body最外层,否则可能被其它的相对元素所影响
                cancel: function () {
                    //layer.msg('捕获就是从页面已经存在的元素上,包裹layer的结构', { time: 5000, icon: 6 });
                }
            });
        }
    </script>
</body>