|
|
@ -21,7 +21,7 @@ |
|
|
|
<th lay-data="{field:'username', width:100}">檔案名稱</th> |
|
|
|
<th lay-data="{field:'experience', width:80, sort:true}">檔案路徑</th> |
|
|
|
<th lay-data="{field:'right', width:80, sort:true}">預覽</th> |
|
|
|
<th lay-data="{field:'right', width:80, sort:true}">下載</th> |
|
|
|
<th lay-data="{field:'right', width:200, sort:true}">功能</th> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
<tbody> |
|
|
@ -39,6 +39,7 @@ |
|
|
|
</td> |
|
|
|
<td> |
|
|
|
<a class="layui-btn layui-btn-normal layui-btn-xs" onclick="filedownload(this)">下載</a> |
|
|
|
<a id="deleteFile" style="display:none" class="layui-btn layui-btn-normal layui-btn-xs layui-btn-danger" onclick="deleteFile(this)">刪除</a> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
} |
|
|
@ -73,7 +74,7 @@ |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
//通过行tool编辑,lay-event="show" |
|
|
|
//通过行tool編輯,lay-event="show" |
|
|
|
function show(obj) { |
|
|
|
var Path = $(obj).closest("TR").find('span[id*=Filepath]').text();; |
|
|
|
var FileName = $(obj).closest("TR").find('span[id*=FileName]').text();; |
|
|
@ -104,7 +105,41 @@ |
|
|
|
if ($(error).text() != '') { |
|
|
|
parent.hg.msg(error); |
|
|
|
} |
|
|
|
|
|
|
|
if ('@Model.StatusName' == "A"){ |
|
|
|
$("#deleteFile").show(); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
// 檔案刪除 |
|
|
|
function deleteFile(obj) { |
|
|
|
var FileName = $(obj).closest("TR").find('span[id*=FileName]').text(); |
|
|
|
layer.confirm(`確定是否要刪除【${FileName}】檔案?`, { |
|
|
|
btn: ['確定', '取消'] |
|
|
|
}, function () { |
|
|
|
layer.closeAll('dialog'); |
|
|
|
$.ajax({ |
|
|
|
url: '@Url.Action("DeleteFqcResultMasterBlob", "FQC")', |
|
|
|
dataType: 'json', |
|
|
|
data: { "fqcId": '@Model.FqcID', "fileName": FileName }, |
|
|
|
cache: false, |
|
|
|
type: "POST", |
|
|
|
success: function (result) { |
|
|
|
// 錯誤訊息 |
|
|
|
if (!result.success) { |
|
|
|
parent.hg.msg(result.msg); |
|
|
|
} |
|
|
|
else { |
|
|
|
var row = $(obj).closest("TR"); |
|
|
|
row.hide(); |
|
|
|
} |
|
|
|
}, |
|
|
|
error: function (jqXHR, textStatus, errorThrown) { |
|
|
|
alert("檔案刪除失敗,請洽系統管理員!!"); |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|