From 6a2257136cd72993a918f849459918445689817d Mon Sep 17 00:00:00 2001 From: Marvin Date: Fri, 9 Dec 2022 21:50:36 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E5=B7=A1=E6=A3=80=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E7=BB=B4=E6=8A=A4SPC005C,SPC005U=201.1.=E8=A1=A8?= =?UTF-8?q?=E5=A4=B4=E5=A2=9E=E5=8A=A0=E7=BA=BF=E5=88=AB=EF=BC=8C=E7=AB=99?= =?UTF-8?q?=E5=88=AB=E9=80=89=E6=8B=A9=EF=BC=8C=E5=B9=B6=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=B5=8B=E5=80=BC=E5=88=97=E8=A1=A8=E4=B8=AD=E7=9A=84=E7=BA=BF?= =?UTF-8?q?=E5=88=AB=EF=BC=8C=E7=AB=99=E5=88=AB=201.2.=E8=A1=A8=E5=A4=B4?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=8D=E9=80=89=E6=A1=86=EF=BC=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BA/=E9=9A=90=E8=97=8F=20=E7=BA=BF=E5=88=AB&=E7=AB=99?= =?UTF-8?q?=E5=88=AB=E6=A0=8F=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml | 70 +++++++++++++++++++-- AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml | 64 ++++++++++++++++++- 2 files changed, 126 insertions(+), 8 deletions(-) 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