diff --git a/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml index 225c9ea3..da89c8f1 100644 --- a/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml +++ b/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml @@ -31,7 +31,7 @@
-
+
@@ -78,6 +78,27 @@
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
@@ -113,12 +134,12 @@ @*線別*@ @*站別*@ @*插件位置*@ @@ -494,8 +515,8 @@ { field: 'inspectionItemName', title: '項目', align: 'left' }, { field: 'inspectionItemValue', title: '標準值', align: 'left' }, { field: 'inspectionResult', title: '稽核結果', width: 100, align: "left", templet: '#selectResult' }, - { field: 'line', title: '線別', width: 100, align: "left", templet: '#selectLine' }, - { field: 'station', title: '站別', width: 100, align: "left", templet: '#selectStation' }, + { field: 'line', title: '線別', width: 100, align: "left", templet: '#selectLine', style: 'display:none' }, + { field: 'station', title: '站別', width: 100, align: "left", templet: '#selectStation', style: 'display:none' }, { field: 'Location', title: '插件位置', width: 100, align: "left", templet: '#inputLocation' }, { field: 'missingUnitNo', title: '缺失單位', width: 100, align: "left", templet: '#selectDept' }, { field: 'MissingUserID', title: '缺失人員', width: 100, align: "left", templet: '#selectUser' }, @@ -562,6 +583,10 @@ } } }); + + $('table.layui-table thead tr th:nth-child(5)').addClass('layui-hide'); + $('table.layui-table thead tr th:nth-child(6)').addClass('layui-hide'); + form.on('select(line)', function (data) { //获取下拉框选中的值 var score = data.value; @@ -581,7 +606,42 @@ console.log(data); }); + form.on('select(theLine)', function (data) { + //'#line'只更改第一行 + //'#line '更改全部 + var select = 'dd[lay-value=' + data.value + ']'; + $('#line ').each(function () { + $(this).siblings("div.layui-form-select").find('dl').find(select).click(); + }); + }); + + form.on('select(theStation)', function (data) { + //'#station'只更改第一行 + //'#station '更改全部 + var select = 'dd[lay-value=' + data.value + ']'; + var changeselect = $('#station ').siblings("div.layui-form-select").find('dl').find(select).click(); + }); + + form.on('checkbox(show)', function (data) { + console.log(data.elem.checked); //是否被选中,true 或者 false + if (data.elem.checked) + { + $("[data-field='line']").css('display', 'inline-block'); + $("[data-field='station']").css('display', 'inline-block'); + $('table.layui-table thead tr th:nth-child(5)').removeClass('layui-hide'); + $('table.layui-table thead tr th:nth-child(6)').removeClass('layui-hide'); + } + else + { + + $("[data-field='line']").css('display', 'none'); + $("[data-field='station']").css('display', 'none'); + + $('table.layui-table thead tr th:nth-child(5)').addClass('layui-hide'); + $('table.layui-table thead tr th:nth-child(6)').addClass('layui-hide'); + } + }); }); function CheckBarcodeNo(BarcodeNo, WipNo) { diff --git a/AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml index a89ff2bf..08c6ebff 100644 --- a/AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml +++ b/AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml @@ -21,7 +21,7 @@
- +
@@ -66,6 +66,27 @@
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
@@ -334,8 +355,8 @@ } }, { field: 'result', title: '稽核結果', width: 100, align: "left", templet: '#selectResult' }, - { field: 'lineID', title: '線別', width: 100, align: "left", templet: '#selectLine' }, - { field: 'ruleStationID', title: '站別', width: 100, align: "left", templet: '#selectStation' }, + { field: 'lineID', title: '線別', width: 100, align: "left", templet: '#selectLine', style: 'display:none' }, + { field: 'ruleStationID', title: '站別', width: 100, align: "left", templet: '#selectStation', style: 'display:none' }, { field: 'location', title: '零件位置', width: 100, align: "left", templet: '#inputLocation' }, { field: 'missingUnitNo', title: '缺失單位', width: 100, align: "left", templet: '#selectDept' }, { field: 'missingUserID', title: '缺失人員', width: 100, align: "left", templet: '#selectUser' }, @@ -426,6 +447,10 @@ } } }); + + $('table.layui-table thead tr th:nth-child(5)').addClass('layui-hide'); + $('table.layui-table thead tr th:nth-child(6)').addClass('layui-hide'); + form.on('select(line)', function (data) { //获取下拉框选中的值 var score = data.value; @@ -445,7 +470,40 @@ console.log(data); }); + form.on('select(theLine)', function (data) { + //'#line'只更改第一行 + //'#line '更改全部 + var select = 'dd[lay-value=' + data.value + ']'; + $('#selectLine ').each(function () { + $(this).siblings("div.layui-form-select").find('dl').find(select).click(); + }); + }); + + form.on('select(theStation)', function (data) { + //'#station'只更改第一行 + //'#station '更改全部 + var select = 'dd[lay-value=' + data.value + ']'; + var changeselect = $('#selectStation ').siblings("div.layui-form-select").find('dl').find(select).click(); + }); + + form.on('checkbox(show)', function (data) { + console.log(data.elem.checked); //是否被选中,true 或者 false + if (data.elem.checked) { + $("[data-field='lineID']").css('display', 'inline-block'); + $("[data-field='ruleStationID']").css('display', 'inline-block'); + $('table.layui-table thead tr th:nth-child(5)').removeClass('layui-hide'); + $('table.layui-table thead tr th:nth-child(6)').removeClass('layui-hide'); + } + else { + + $("[data-field='lineID']").css('display', 'none'); + $("[data-field='ruleStationID']").css('display', 'none'); + + $('table.layui-table thead tr th:nth-child(5)').addClass('layui-hide'); + $('table.layui-table thead tr th:nth-child(6)').addClass('layui-hide'); + } + }); }); // PLM_ECN