26 changed files with 420 additions and 23 deletions
@ -0,0 +1,148 @@ |
|||
|
|||
@{ ViewData["Title"] = "組件料號序號上傳"; |
|||
Layout = "~/Views/Shared/_AMESLayout.cshtml"; } |
|||
|
|||
<style> |
|||
.control-label { |
|||
justify-content: flex-end !important; |
|||
} |
|||
|
|||
.text-error { |
|||
color: #dc3545 !important; |
|||
} |
|||
|
|||
.my-read-only-class { |
|||
cursor: not-allowed; |
|||
} |
|||
</style> |
|||
|
|||
<div class="layui-card"> |
|||
<div class="layui-card-body"> |
|||
<form enctype="multipart/form-data" class="layui-form" method="post" asp-action="KCS005Save"> |
|||
<div asp-validation-summary="ModelOnly" class="text-danger"></div> |
|||
<div class="layui-form-item" style="text-align:center"> |
|||
<div class="layui-inline"> |
|||
<label class="layui-btn"> |
|||
<input type="file" name="formFile"> |
|||
</label> |
|||
<input type="submit" id="asubmit" value="上傳" class="layui-btn layui-icon " /> |
|||
</div> |
|||
</div> |
|||
<div style="text-align:center"> |
|||
<div class="layui-inline"> |
|||
<pre style="color: firebrick;word-break: break-all;" class="text-danger offset-sm-3">@Html.ValidationMessage("error")</pre> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
<table class="layui-hide" id="sop" lay-filter="sop"></table> |
|||
|
|||
</div> |
|||
</div> |
|||
|
|||
@section Scripts { |
|||
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); |
|||
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } |
|||
|
|||
<script type="text/javascript"> |
|||
//layui.use(['form', 'layer', 'laydate'], function () { |
|||
// form = layui.form; |
|||
// |
|||
// form.on('select(Type)', function (data) { |
|||
// var data = $("#Type").val(); |
|||
// getInspectionForms(data); |
|||
// }); |
|||
// |
|||
//}); |
|||
hg.form.onsubmit('asubmit', function (data) { |
|||
tt(); |
|||
//table && table.reload(data); |
|||
}); |
|||
//通过行tool编辑,lay-event="show" |
|||
function show(obj) { |
|||
layui.use('layer', function () { |
|||
var layer = layui.layer; |
|||
layer.open({ |
|||
type: 2, |
|||
title: '預覽文件', |
|||
shadeClose: true,//点击遮罩关闭层 |
|||
shade: 0.8, |
|||
area: ['90%', '90%'], |
|||
content: obj.data.filePath + obj.data.newName, //iframe的url |
|||
zIndex: 19891014, |
|||
//iframe: { |
|||
// src:obj.data.filePath + obj.data.newName |
|||
// |
|||
//} |
|||
}); |
|||
}); |
|||
|
|||
}; |
|||
//通过行tool删除,lay-event="del" |
|||
function del(obj) { |
|||
if (obj.data.imageName) { |
|||
hg.confirm("圖片資料:" + obj.data.imageName + ",确定要删除吗?", function () { |
|||
$.ajax({ |
|||
url: '/REP/REP001D', |
|||
data: { id: obj.data.imageName }, |
|||
type: 'POST', |
|||
success: function (data) { |
|||
if (data.success) { |
|||
obj.del(); //只删本地数据 |
|||
hg.msghide("删除成功!"); |
|||
} |
|||
else { |
|||
hg.msg(data.msg); |
|||
} |
|||
}, |
|||
error: function () { |
|||
hg.msg("网络请求失败!"); |
|||
} |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
@* SOP文件 sheet *@ |
|||
var tableCols = [[ |
|||
{ |
|||
field: 'imageName', |
|||
title: '檔案名稱', |
|||
sort: true |
|||
}, |
|||
{ |
|||
field: 'createDate', |
|||
templet: '<div>{{ layui.util.toDateString(d.createDate, "yyyy/MM/dd") }}</div>' |
|||
}, |
|||
{ |
|||
field: 'right', |
|||
width: 80, |
|||
title: '操作', |
|||
align: 'center', |
|||
fixed: 'right', |
|||
templet: function (d) { |
|||
return '<a class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-read" lay-event="show">預覽</a>' |
|||
} |
|||
}] |
|||
]; |
|||
//基本数据表格 |
|||
var table; |
|||
$(function () { |
|||
// tt(); |
|||
}); |
|||
function tt() { |
|||
//基本数据表格 |
|||
table = hg.table.datatable('sop', '巡檢上傳文件', '/SPC/GetInspectionResultBlobsByQuery?id=' + @ViewBag.MasterID +'&itemID=' + @ViewBag.ItemID, {}, tableCols, false, 'full-100'); |
|||
}; |
|||
|
|||
$(document).ready(function () { |
|||
var error = '@Html.ValidationMessage("error")'; |
|||
if ($(error).text() != '') { |
|||
parent.hg.msg(error); |
|||
} |
|||
}); |
|||
|
|||
</script> |
|||
|
|||
|
|||
} |
|||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue