yusijie
2024-04-17 ed6540aece2d099230ea88768010f61aacc7c19c
物料上传图片
2个文件已修改
1个文件已添加
91 ■■■■■ 已修改文件
WebTM/Files/Material/ZY004/R-C.jpg 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/基础资料/公用基础资料/Add_Edit_Gy_Material.html 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/基础资料/公用基础资料/Gy_Material.html 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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
@@ -385,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);
@@ -934,7 +937,7 @@
                return subStr;
            }
            //#region ç¼–辑时,获取已上传的文件列表
            //#region ç‚¹å‡»ç‰©æ–™æ—¶,获取已上传的文件列表
            function getFileList_loaded(HMaterNumber) {
                $("#file").html("");
                $(".layui-carousel-ind").html("");