Browse Source

1. 巡檢結果維護 稽核結果下拉選單加入顏色判定

master
Sai 8 months ago
parent
commit
96aab6c8e0
  1. 31
      AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml
  2. 35
      AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml
  3. 38
      AMESCoreStudio.Web/Views/SPC/SPC005V.cshtml

31
AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml

@ -138,7 +138,7 @@
@*回復*@ @*回復*@
<script type="text/html" id="selectResult"> <script type="text/html" id="selectResult">
<select name='result' lay-verify='' lay-search='' class="layui-form" lay-filter="result"> <select name='selectResult' id='selectResult' lay-verify='' lay-search='' class="layui-form selectResult" lay-filter="selectResult">
<option value="NA">N/A</option> <option value="NA">N/A</option>
<option value="P">PASS</option> <option value="P">PASS</option>
<option value="F">FAIL </option> <option value="F">FAIL </option>
@ -584,9 +584,24 @@
elem.val(elem.data('value')).parents('div.layui-table-cell').css('overflow', 'visible'); elem.val(elem.data('value')).parents('div.layui-table-cell').css('overflow', 'visible');
}); });
form.render(); form.render();
handleSelectResult();
} }
}); });
} }
// Table SelectResult 選項字體換色
function handleSelectResult() {
$('.selectResult').each(function () {
console.log($(this).val());
if ($(this).val() === 'P') {
$(this).next().find('input').css('color', 'green');
}
else if ($(this).val() === 'F') {
$(this).next().find('input').css('color', 'red');
}
});
}
/*表格列表操作*/ /*表格列表操作*/
table.on('tool(test)', function (obj) { table.on('tool(test)', function (obj) {
var data = obj.data, layEvent = obj.event; var data = obj.data, layEvent = obj.event;
@ -686,6 +701,20 @@
$('table.layui-table thead tr th:nth-child(6)').addClass('layui-hide'); $('table.layui-table thead tr th:nth-child(6)').addClass('layui-hide');
} }
}); });
// 選單選擇後換色 SelectResult 選項字體換色
form.on('select(selectResult)', function (data) {
var id = data.elem.id;
if (data.value === "P") {
$(data.elem).next().find('input').css('color', 'green');
}
else if (data.value === "F") {
$(data.elem).next().find('input').css('color', 'red');
}
else {
$(data.elem).next().find('input').css('color', 'black');
}
});
}); });
function CheckBarcodeNo(BarcodeNo, WipNo) { function CheckBarcodeNo(BarcodeNo, WipNo) {

35
AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml

@ -143,7 +143,7 @@
@*回復*@ @*回復*@
<script type="text/html" id="selectResult"> <script type="text/html" id="selectResult">
<select name="selectResult" lay-filter="selectResult" id="selectResult" data-value={{d.result}} class="layui-form"> <select name="selectResult" lay-filter="selectResult" id="selectResult" data-value={{d.result}} class="layui-form selectResult">
<option value="NA">N/A</option> <option value="NA">N/A</option>
<option value="P">PASS</option> <option value="P">PASS</option>
<option value="F">FAIL </option> <option value="F">FAIL </option>
@ -355,6 +355,8 @@
laytpl = layui.laytpl, laytpl = layui.laytpl,
laydate = layui.laydate; laydate = layui.laydate;
itemslist(); itemslist();
function itemslist() { function itemslist() {
var formID = $("#InspectionID").val(); var formID = $("#InspectionID").val();
@ -430,9 +432,24 @@
elem.val(elem.data('value')).parents('div.layui-table-cell').css('overflow', 'visible'); elem.val(elem.data('value')).parents('div.layui-table-cell').css('overflow', 'visible');
}); });
form.render(); form.render();
handleSelectResult();
}
});
}
// Table SelectResult 選項字體換色
function handleSelectResult() {
$('.selectResult').each(function () {
console.log($(this).val());
if ($(this).val() === 'P') {
$(this).next().find('input').css('color', 'green');
}
else if ($(this).val() === 'F') {
$(this).next().find('input').css('color', 'red');
} }
}); });
} }
/*表格列表操作*/ /*表格列表操作*/
table.on('tool(test)', function (obj) { table.on('tool(test)', function (obj) {
var data = obj.data, layEvent = obj.event; var data = obj.data, layEvent = obj.event;
@ -539,6 +556,20 @@
$('table.layui-table thead tr th:nth-child(6)').addClass('layui-hide'); $('table.layui-table thead tr th:nth-child(6)').addClass('layui-hide');
} }
}); });
// 選單選擇後換色 SelectResult 選項字體換色
form.on('select(selectResult)', function (data) {
var id = data.elem.id;
if (data.value === "P") {
$(data.elem).next().find('input').css('color', 'green');
}
else if (data.value === "F") {
$(data.elem).next().find('input').css('color', 'red');
}
else{
$(data.elem).next().find('input').css('color', 'black');
}
});
}); });
function GetPLM_ECN() { function GetPLM_ECN() {
@ -629,7 +660,5 @@
}; };
}); });
</script> </script>
} }

38
AMESCoreStudio.Web/Views/SPC/SPC005V.cshtml

@ -1,7 +1,8 @@
@model AMESCoreStudio.WebApi.Models.AMES.InspectionResultMaster @model AMESCoreStudio.WebApi.Models.AMES.InspectionResultMaster
@{ ViewData["Title"] = "SPC005U"; @{
ViewData["Title"] = "SPC005U";
Layout = "~/Views/Shared/_AMESLayout.cshtml"; Layout = "~/Views/Shared/_AMESLayout.cshtml";
//Layout = "~/Views/Shared/_FormLayout.cshtml"; //Layout = "~/Views/Shared/_FormLayout.cshtml";
} }
@ -15,12 +16,24 @@
margin-left: -10px; margin-left: -10px;
margin-right: -10px; margin-right: -10px;
} }
.layui-table-cell { .layui-table-cell {
height: auto; height: auto;
overflow: visible; overflow: visible;
text-overflow: inherit; text-overflow: inherit;
white-space: normal white-space: normal
} }
.layui-disabled-red {
color: red !important;
cursor: not-allowed !important
}
.layui-disabled-green {
color: green !important;
cursor: not-allowed !important
}
green
</style> </style>
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-body"> <div class="layui-card-body">
@ -67,12 +80,14 @@
</div> </div>
@section Scripts { @section Scripts {
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); @{
await Html.RenderPartialAsync("_FileinputScriptsPartial"); } await Html.RenderPartialAsync("_ValidationScriptsPartial");
await Html.RenderPartialAsync("_FileinputScriptsPartial");
}
@*回復*@ @*回復*@
<script type="text/html" id="selectResult"> <script type="text/html" id="selectResult">
<select name="selectResult" lay-filter="selectResult" id="selectResult" data-value={{d.result}} class="layui-form" disabled> <select name="selectResult" lay-filter="selectResult" id="selectResult" data-value={{d.result}} class="layui-form selectResult" disabled>
<option value="NA">N/A</option> <option value="NA">N/A</option>
<option value="P">PASS</option> <option value="P">PASS</option>
<option value="F">FAIL </option> <option value="F">FAIL </option>
@ -168,9 +183,24 @@
elem.val(elem.data('value')).parents('div.layui-table-cell').css('overflow', 'visible'); elem.val(elem.data('value')).parents('div.layui-table-cell').css('overflow', 'visible');
}); });
form.render(); form.render();
handleSelectResult();
} }
}); });
} }
// Table SelectResult 選項字體換色
function handleSelectResult() {
$('.selectResult').each(function () {
console.log($(this));
if ($(this).val() === 'P') {
$(this).next().find('input').addClass('layui-disabled-green');
}
else if ($(this).val() === 'F') {
$(this).next().find('input').addClass('layui-disabled-red');
}
});
}
/*表格列表操作*/ /*表格列表操作*/
table.on('tool(test)', function (obj) { table.on('tool(test)', function (obj) {
var data = obj.data, layEvent = obj.event; var data = obj.data, layEvent = obj.event;

Loading…
Cancel
Save