1
zgq
2021-08-05 3943ce50e377c37852c9d783da3b96b71cc61118
WebTM/views/Éú²ú¹ÜÀí/Éú²ú»ã±¨µ¥/Sc_Add_ICMOReportBillList.html
@@ -308,7 +308,7 @@
            }
            else if (OperationType == 3) {//编辑
                set_EditFromGrid();
                get_file();
                //get_file();
            }
            else {
                layer.alert("未知操作类型!", { icon: 5 });
@@ -904,6 +904,7 @@
                            $("#HExplanation").val("");
                            $("#HRemark").val(data.表头备注);
                            PicUpload();
                            get_file();
                        } else {
                            layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                        }
@@ -1171,6 +1172,7 @@
            //获取编辑时,已上传的文件列表
            function get_file() {
                var HBillNo = $("#HBillNo").val()
                if (HBillNo != null || HBillNo != undefined) {
                    var ProImgByList = $('#ProImgByList')
                    $.ajax({
@@ -1193,7 +1195,6 @@
                                        , '<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete" type="button" id="deltefile" onclick="javascript:toManager(this)"><i class="layui-icon layui-icon-delete layuiadmin-button-btn"></i>删除</button>'
                                        , '</td>'
                                        , '</tr>'].join(''));
                                    $('#ProImgByList').append(tr);
                                }
                            } else {
@@ -1207,54 +1208,56 @@
            }
            //删除文件
            function toManager(r) {
                //得到当前所在行
                var rows = r.parentNode.parentNode.rowIndex;
                //得到所在行的第一列的内容:主键ID
                var HItemID = $("#ProImgByList tr:eq(" + (rows - 1) + ") td:eq(0)").html();
                //得到所在行的第二列的内容:单据号
                var HSourceBillNo = $("#ProImgByList tr:eq(" + (rows - 1) + ") td:eq(1)").html();
                //得到所在行的第三列的内容:文件名称
                var HFileName = $("#ProImgByList tr:eq(" + (rows - 1) + ") td:eq(2)").html();
                layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                    //删除已上传文件
                    $.ajax({
                        url: GetWEBURL() + '/Cj_StationOutBill/DeleteFilelist',
                        type: "GET",
                        data: { "HItemID": HItemID, "HSourceBillNo": HSourceBillNo, "HFileName": HFileName },
                        success: function (data1) {
                            if (data1.count == 1) {
                                layer.alert(data1.Message, { icon: 1 });
                                $("#ProImgByList tr").eq((rows - 1)).remove();
                            }
                            else {
                                layer.alert(data1.code + data1.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                })
            }
            //下载文件
            function dowload(r) {
                //得到当前所在行
                var rows = r.parentNode.parentNode.rowIndex;
                //得到所在行的第五列的内容:文件地址
                var url = $("#ProImgByList tr:eq(" + (rows - 1) + ") td:eq(5)").html();
                /*window.location.href = url;*/
                window.open(url)
            }
        //#endregion
        });
        //删除文件
        function toManager(r) {
            //得到当前所在行
            var rows = r.parentNode.parentNode.rowIndex;
            //得到所在行的第一列的内容:主键ID
            var HItemID = $("#ProImgByList tr:eq(" + (rows - 1) + ") td:eq(0)").html();
            //得到所在行的第二列的内容:单据号
            var HSourceBillNo = $("#ProImgByList tr:eq(" + (rows - 1) + ") td:eq(1)").html();
            //得到所在行的第三列的内容:文件名称
            var HFileName = $("#ProImgByList tr:eq(" + (rows - 1) + ") td:eq(2)").html();
            layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                //删除已上传文件
                $.ajax({
                    url: GetWEBURL() + '/Cj_StationOutBill/DeleteFilelist',
                    type: "GET",
                    data: { "HItemID": HItemID, "HSourceBillNo": HSourceBillNo, "HFileName": HFileName },
                    success: function (data1) {
                        if (data1.count == 1) {
                            layer.alert(data1.Message, { icon: 1 });
                            $("#ProImgByList tr").eq((rows - 1)).remove();
                        }
                        else {
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            })
        }
        //下载文件
        function dowload(r) {
            //得到当前所在行
            var rows = r.parentNode.parentNode.rowIndex;
            //得到所在行的第五列的内容:文件地址
            var url = $("#ProImgByList tr:eq(" + (rows - 1) + ") td:eq(5)").html();
            /*window.location.href = url;*/
            window.open(url)
        }
    </script>
</body>
</html>