From 049a110bfbcb42fdf6f05beecefa3ef0f66f0de6 Mon Sep 17 00:00:00 2001
From: Ray <raylin@aten.com>
Date: Wed, 19 Oct 2022 11:23:58 +0800
Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=94=B9=E5=B7=A5=E5=96=AE?=
 =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E8=B3=87=E8=A8=8A=20=E5=82=99=E8=A8=BB?=
 =?UTF-8?q?=E5=88=87=E5=88=86=E4=B8=89=E5=80=8B=20=E7=B5=84=E8=A3=9D?=
 =?UTF-8?q?=E3=80=81=E6=B8=AC=E8=A9=A6=E3=80=81=E5=8C=85=E8=A3=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../Controllers/PCSController.cs              |  14 +-
 AMESCoreStudio.Web/Views/PCS/PCS001.cshtml    | 597 +++++++++---------
 AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml   |  66 +-
 AMESCoreStudio.Web/Views/PCS/PCS003.cshtml    |  18 +-
 .../Models/AMES/WipSystem.cs                  |  26 +-
 5 files changed, 399 insertions(+), 322 deletions(-)

diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs
index 6ccd552c..d5f4102a 100644
--- a/AMESCoreStudio.Web/Controllers/PCSController.cs
+++ b/AMESCoreStudio.Web/Controllers/PCSController.cs
@@ -177,7 +177,9 @@ namespace AMESCoreStudio.Web.Controllers
                 !string.IsNullOrWhiteSpace(model.Ec) ||
                 !string.IsNullOrWhiteSpace(model.OsVer) ||
                 !string.IsNullOrWhiteSpace(model.Jumper) ||
-                !string.IsNullOrWhiteSpace(model.Memo))
+                !string.IsNullOrWhiteSpace(model.BabMemo)||
+                !string.IsNullOrWhiteSpace(model.TestMemo)||
+                !string.IsNullOrWhiteSpace(model.PackingMemo))
             {
 
                 // 判斷預設值是否更改過,如果有就判斷必填欄位
@@ -1129,7 +1131,8 @@ namespace AMESCoreStudio.Web.Controllers
             var result = await _basApi.GetFactoryUnits();
             var result_wipNo = await _pcsApi.GetWipInfoByWipNO(wipNo);
 
-            result = result.Where(w => result_wipNo.Select(s => s.UnitNO).Contains(w.UnitNo)).ToList();
+            // 暫時不判斷工單開立哪些生產製程
+            // result = result.Where(w => result_wipNo.Select(s => s.UnitNO).Contains(w.UnitNo)).ToList();
             var Item = new List<SelectListItem>();
             for (int i = 0; i < result.Count; i++)
             {
@@ -5286,8 +5289,9 @@ namespace AMESCoreStudio.Web.Controllers
                 // 工程工單備註
                 var wipsystem = await _pcsApi.GetWipSystem(model.WipNO);
                 if (wipsystem != null)
-                    model.SystemMemo = wipsystem.Memo;
-
+                { 
+                    model.SystemMemo = wipsystem.BabMemo;
+                }
 
                 // KPSeq順序清除
                 model.KpItemName = string.Empty;
@@ -5422,7 +5426,7 @@ namespace AMESCoreStudio.Web.Controllers
                     // 判斷指定KeyParts代碼是否有刷足夠數
                     if (KeyPartsNo.Count() > model.Inputs.Where(w => !w.Input.StartsWith("$")).Count())
                     {
-                        Msg = "有指定KeyParts代號 刷入數量不足或超過,請在確認!";
+                        Msg = "有指定KeyParts代號 刷入數量不足,請在確認!";
                         return Json(new Result() { success = false, msg = Msg, data = Data });
                     }
 
diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml
index f25f7c7a..fec65023 100644
--- a/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml
+++ b/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml
@@ -1,7 +1,8 @@
 @model AMESCoreStudio.Web.ViewModels.PCS.WipDataViewModel
 @using Microsoft.AspNetCore.Mvc.Localization
 
-@{ ViewData["Title"] = "PCS001C";
+@{
+    ViewData["Title"] = "PCS001C";
     Layout = "~/Views/Shared/_AMESLayout.cshtml";
 }
 
@@ -80,7 +81,7 @@
                     <label class="layui-form-label">客戶類別</label>
                     <div class="layui-input-inline">
                         @*<input @if (Model.wipInfo != null) { @(Model.wipInfo.CustomerMedical == "Y" ? "checked" : "") } type="checkbox" title="醫療" name="wipInfo.CustomerMedical" />
-                            <input @if (Model.wipInfo != null) { @(Model.wipInfo.CustomerVIP == "Y" ? "checked" : "") } type="checkbox" title="VIP" name="wipInfo.CustomerVIP" />*@
+                        <input @if (Model.wipInfo != null) { @(Model.wipInfo.CustomerVIP == "Y" ? "checked" : "") } type="checkbox" title="VIP" name="wipInfo.CustomerVIP" />*@
                         <input asp-for="wipInfo.CustomerMedical" type="checkbox" title="醫療" />
                         <input asp-for="wipInfo.CustomerVIP" type="checkbox" title="VIP" />
                     </div>
@@ -145,8 +146,8 @@
 
             <div class="layui-form-item" style="padding-left:30px">
                 @*<input @if (Model.wipInfo != null) { @(Model.wipInfo.ModelCheck == "Y" ? "checked" : "") } type="checkbox" title="混線投入機種檢查" name="wipInfo.ModelCheck" />
-                    <input @if (Model.wipInfo != null) { @(Model.wipInfo.ECNCheck == "Y" ? "checked" : "") } type="checkbox" title="混線投入ECN相同檢查" name="wipInfo.ECNCheck" />
-                    <input @if (Model.wipInfo != null) { @(Model.wipInfo.Priority == "Y" ? "checked" : "") } type="checkbox" title="線上強制工單" name="wipInfo.Priority" />*@
+                <input @if (Model.wipInfo != null) { @(Model.wipInfo.ECNCheck == "Y" ? "checked" : "") } type="checkbox" title="混線投入ECN相同檢查" name="wipInfo.ECNCheck" />
+                <input @if (Model.wipInfo != null) { @(Model.wipInfo.Priority == "Y" ? "checked" : "") } type="checkbox" title="線上強制工單" name="wipInfo.Priority" />*@
                 <input asp-for="wipInfo.ModelCheck" type="checkbox" title="混線投入機種檢查" />
                 <input asp-for="wipInfo.ECNCheck" type="checkbox" title="混線投入ECN相同檢查" />
                 <input asp-for="wipInfo.Priority" type="checkbox" title="線上強制工單" />
@@ -360,8 +361,8 @@
                                 <div class="layui-input-block">
                                     <cl-checkbox asp-items="@ViewBag.GetCheckboxDIP" asp-for="wipBoard.DipSides" asp-skin="defult"></cl-checkbox>
                                     @*<input @if (Model.wipBoard != null) { @(Model.wipBoard.DipCarrier == "Y" ? "checked" : "") } type="checkbox" title="CARRIER" name="wipBoard.DipCarrier" />
-                                        <input @if (Model.wipBoard != null) { @(Model.wipBoard.DipTape == "Y" ? "checked" : "") } type="checkbox" title="貼付膠帶" name="wipBoard.DipTape" />
-                                        <input @if (Model.wipBoard != null) { @(Model.wipBoard. == "Y" ? "checked" : "") } type="checkbox" title="點防焊膠" name="wipBoard.SmdSolderMask" />*@
+                                    <input @if (Model.wipBoard != null) { @(Model.wipBoard.DipTape == "Y" ? "checked" : "") } type="checkbox" title="貼付膠帶" name="wipBoard.DipTape" />
+                                    <input @if (Model.wipBoard != null) { @(Model.wipBoard. == "Y" ? "checked" : "") } type="checkbox" title="點防焊膠" name="wipBoard.SmdSolderMask" />*@
                                     <input asp-for="wipBoard.DipCarrier" type="checkbox" title="CARRIER" />
                                     <input asp-for="wipBoard.DipTape" type="checkbox" title="貼付膠帶" />
                                     <input asp-for="wipBoard.DipSolderMask" type="checkbox" title="點防焊膠" />
@@ -742,9 +743,23 @@
                         </div>
 
                         <div class="layui-form-item">
-                            <label class="layui-form-label">備註</label>
+                            <label class="layui-form-label">組裝備註</label>
+                            <div class="layui-input-block">
+                                <textarea class="layui-textarea" asp-for="wipSystem.BabMemo"></textarea>
+                            </div>
+                        </div>
+
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">測試備註</label>
+                            <div class="layui-input-block">
+                                <textarea class="layui-textarea" asp-for="wipSystem.TestMemo"></textarea>
+                            </div>
+                        </div>
+
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">包裝備註</label>
                             <div class="layui-input-block">
-                                <input class="layui-input" asp-for="wipSystem.Memo" />
+                                <textarea class="layui-textarea" asp-for="wipSystem.PackingMemo"></textarea>
                             </div>
                         </div>
                     </div>
@@ -752,22 +767,22 @@
                     @* 治具組合sheet *@
                     <div class="layui-tab-item">
                         @*<table id="OutfitTable" class="layui-table">
-                                <thead>
-                                    <tr>
-                                        <th>
-                                            治具NO
-                                        </th>
-                                        <th>
-                                            治具名稱
-                                        </th>
-                                        <th>
-                                            流程名稱ID
-                                        </th>
-                                    </tr>
-                                </thead>
-                                <tbody id="tblbody">
-                                </tbody>
-                            </table>*@
+                        <thead>
+                        <tr>
+                        <th>
+                        治具NO
+                        </th>
+                        <th>
+                        治具名稱
+                        </th>
+                        <th>
+                        流程名稱ID
+                        </th>
+                        </tr>
+                        </thead>
+                        <tbody id="tblbody">
+                        </tbody>
+                        </table>*@
                         <a class="layui-btn layui-btn-normal layui-btn-xs layui-icon layui-icon-read" lay-submit lay-filter="queryOutfit">刷新</a>
                         <table class="layui-hide" id="Outfit" lay-filter="Outfit"></table>
                     </div>
@@ -834,8 +849,10 @@
     </div>
 </div>
 @section Scripts {
-    @{ await Html.RenderPartialAsync("_ValidationScriptsPartial");
-        await Html.RenderPartialAsync("_FileinputScriptsPartial"); }
+    @{
+        await Html.RenderPartialAsync("_ValidationScriptsPartial");
+        await Html.RenderPartialAsync("_FileinputScriptsPartial");
+    }
 
     <script type="text/javascript">
         $(document).ready(function () {
@@ -854,62 +871,56 @@
                 $("#GetMAC").hide();
             }
 
-              var error = '@Html.ValidationMessage("error")';
+            var error = '@Html.ValidationMessage("error")';
             if ($(error).text() != '') {
                 parent.hg.msg(error);
-        };
+            };
 
-           function getFlowRuleList(data)
-        {
-            $.ajax(
-                {
-                    url: "@Url.Action("GetFlowRuleJson", "BAS")",
-                    dataType: 'json',
-                    data: { "unit_no": $("#unit").val()},
-                    type: 'post',
-                    success: function (result)
-                    {
-                        console.info(result.data);
-                        $("#wipInfo_FlowRuleID").empty();//清空下拉框的值
-                        $.each(result.data, function (index, item) {
-                            $("#wipInfo_FlowRuleID").append($("<option>").text(item.text).val(item.value))
-                        });
-
-                        layui.form.render("select");//重新渲染 固定写法
-                        // 刷新 生產流程
-                        RuleStation($("#wipInfo_FlowRuleID").val());
-                    },
-                    error: function (result)
+            function getFlowRuleList(data) {
+                $.ajax(
                     {
-                        alert(result);
-                    }
-                });
-        };
+                        url: "@Url.Action("GetFlowRuleJson", "BAS")",
+                        dataType: 'json',
+                        data: { "unit_no": $("#unit").val() },
+                        type: 'post',
+                        success: function (result) {
+                            console.info(result.data);
+                            $("#wipInfo_FlowRuleID").empty();//清空下拉框的值
+                            $.each(result.data, function (index, item) {
+                                $("#wipInfo_FlowRuleID").append($("<option>").text(item.text).val(item.value))
+                            });
+
+                            layui.form.render("select");//重新渲染 固定写法
+                            // 刷新 生產流程
+                            RuleStation($("#wipInfo_FlowRuleID").val());
+                        },
+                        error: function (result) {
+                            alert(result);
+                        }
+                    });
+            };
 
-    function getLineInfoList(data)
-        {
-            $.ajax(
-                {
-                    url: "@Url.Action("GetUnitLineJson", "BAS")",
-                    dataType: 'json',
-                    data: { "unit_no": $("#unit").val()},
-                    type: 'post',
-                    success: function (result)
-                    {
-                        console.info(result.data);
-                        $("#wipInfo_LineID").empty();//清空下拉框的值
-                        $.each(result.data, function (index, item) {
-                            $("#wipInfo_LineID").append($("<option>").text(item.text).val(item.value))
-                        });
-                        $("#wipInfo_LineID option:eq(1)").attr("selected", 'selected'); //默认选择第一个选项
-                        layui.form.render("select");//重新渲染 固定写法
-                    },
-                    error: function (result)
+            function getLineInfoList(data) {
+                $.ajax(
                     {
-                        alert(result);
-                    }
-                });
-        };
+                        url: "@Url.Action("GetUnitLineJson", "BAS")",
+                        dataType: 'json',
+                        data: { "unit_no": $("#unit").val() },
+                        type: 'post',
+                        success: function (result) {
+                            console.info(result.data);
+                            $("#wipInfo_LineID").empty();//清空下拉框的值
+                            $.each(result.data, function (index, item) {
+                                $("#wipInfo_LineID").append($("<option>").text(item.text).val(item.value))
+                            });
+                            $("#wipInfo_LineID option:eq(1)").attr("selected", 'selected'); //默认选择第一个选项
+                            layui.form.render("select");//重新渲染 固定写法
+                        },
+                        error: function (result) {
+                            alert(result);
+                        }
+                    });
+            };
 
             layui.config({
                 base: '/js/' //假设这是test.js所在的目录
@@ -918,22 +929,22 @@
             });
 
             layui.use(['form', 'laydate', 'autocomplete'], function () {
-            var form = layui.form,
-                laydate = layui.laydate;
-
-            laydate.render({
-                elem: '#wipInfo_WipScheduleDate'
-                , trigger: 'click'
-                , format: 'yyyy/MM/dd'
-                , theme: 'grid'
-            });
+                var form = layui.form,
+                    laydate = layui.laydate;
+
+                laydate.render({
+                    elem: '#wipInfo_WipScheduleDate'
+                    , trigger: 'click'
+                    , format: 'yyyy/MM/dd'
+                    , theme: 'grid'
+                });
 
-            laydate.render({
-                elem: '#wipInfo_WipDueDate'
-                , trigger: 'click'
-                , format: 'yyyy/MM/dd'
-                , theme: 'grid'
-            });
+                laydate.render({
+                    elem: '#wipInfo_WipDueDate'
+                    , trigger: 'click'
+                    , format: 'yyyy/MM/dd'
+                    , theme: 'grid'
+                });
 
                 // PLM料號關鍵字
                 $(".autocomplete").each(function () {
@@ -966,7 +977,7 @@
                     }
                 });
 
-            form.on('select(unit)', function (data) {
+                form.on('select(unit)', function (data) {
                     $("#unitNo").val(data.value);
                     getFlowRuleList(data.value);
                     getLineInfoList(data.value);
@@ -990,75 +1001,75 @@
 
             });
 
-         $('#GetBarCode').click(function () {
-             var wipNO = $('#wipInfo_WipNO').val().toUpperCase();
-            var planQTY = $('#wipInfo_PlanQTY').val();
-            if (wipNO == '' || !wipNO) {
-                parent.hg.msg("請輸入工單號碼");
-                return;
-            }
-            if (planQTY == '' || !planQTY || planQTY == 0) {
-                parent.hg.msg("請確認計畫數量");
-                return;
-            }
+            $('#GetBarCode').click(function () {
+                var wipNO = $('#wipInfo_WipNO').val().toUpperCase();
+                var planQTY = $('#wipInfo_PlanQTY').val();
+                if (wipNO == '' || !wipNO) {
+                    parent.hg.msg("請輸入工單號碼");
+                    return;
+                }
+                if (planQTY == '' || !planQTY || planQTY == 0) {
+                    parent.hg.msg("請確認計畫數量");
+                    return;
+                }
 
-            $("#wipBarcode_StartNO").val(wipNO + PrefixInteger(1, 4));
-            $("#wipBarcode_EndNO").val(wipNO + PrefixInteger(planQTY, 4));
+                $("#wipBarcode_StartNO").val(wipNO + PrefixInteger(1, 4));
+                $("#wipBarcode_EndNO").val(wipNO + PrefixInteger(planQTY, 4));
 
-        });
+            });
 
-         $('#GetMAC1').click(function () {
-                    var wipNO = $('#wipAtt_ItemNO').val();
-                    var planQTY = $('#wipInfo_PlanQTY').val();
-                    if (wipNO == '' || !wipNO) {
-                        parent.hg.msg("請輸入料號");
-                        return;
-                    }
-                    if (planQTY == '' || !planQTY || planQTY == 0) {
-                        parent.hg.msg("請確認計畫數量");
-                        return;
-                    }
+            $('#GetMAC1').click(function () {
+                var wipNO = $('#wipAtt_ItemNO').val();
+                var planQTY = $('#wipInfo_PlanQTY').val();
+                if (wipNO == '' || !wipNO) {
+                    parent.hg.msg("請輸入料號");
+                    return;
+                }
+                if (planQTY == '' || !planQTY || planQTY == 0) {
+                    parent.hg.msg("請確認計畫數量");
+                    return;
+                }
 
-                    $("#wipBarcode_StartNO").val(wipNO + PrefixInteger(1, 4));
-                    $("#wipBarcode_EndNO").val(wipNO + PrefixInteger(planQTY, 4));
+                $("#wipBarcode_StartNO").val(wipNO + PrefixInteger(1, 4));
+                $("#wipBarcode_EndNO").val(wipNO + PrefixInteger(planQTY, 4));
 
-                });
+            });
 
             function PrefixInteger(num, length) {
                 return (Array(length).join('0') + num).slice(-length);
             };
 
-         $("#GetMAC").click(function (event) {
-                    var wipNO = $('#wipAtt_ItemNO').val();
-                    var planQTY = $('#wipInfo_PlanQTY').val();
-                    if (wipNO == '' || !wipNO) {
-                        parent.hg.msg("請輸入料號");
-                        return;
-                    }
-                    if (planQTY == '' || !planQTY || planQTY == 0) {
-                        parent.hg.msg("請確認計畫數量");
-                        return;
-                    }
-                        $.ajax({
-                        url: '@Url.Action("GetMAC", "PCS")',
-                        dataType:'json',
-                            data: { "itemno": $("#wipAtt_ItemNO").val(), "planQTY": $('#wipInfo_PlanQTY').val()},
-                        cache: false,
-                        type: "POST",
-                            success: function (data, textStatus, jqXHR) {
-                                if (data._msg != undefined) {
-                                    parent.hg.msg(data._msg);
-                                }
-                            $("#wipMAC_StartNO").val(data.mix);
-                            $("#wipMAC_EndNO").val(data.max);
-                        },
-                        error: function (jqXHR, textStatus, errorThrown) {
-                            alert("Found error when using Ajax!!");
+            $("#GetMAC").click(function (event) {
+                var wipNO = $('#wipAtt_ItemNO').val();
+                var planQTY = $('#wipInfo_PlanQTY').val();
+                if (wipNO == '' || !wipNO) {
+                    parent.hg.msg("請輸入料號");
+                    return;
+                }
+                if (planQTY == '' || !planQTY || planQTY == 0) {
+                    parent.hg.msg("請確認計畫數量");
+                    return;
+                }
+                $.ajax({
+                    url: '@Url.Action("GetMAC", "PCS")',
+                    dataType: 'json',
+                    data: { "itemno": $("#wipAtt_ItemNO").val(), "planQTY": $('#wipInfo_PlanQTY').val() },
+                    cache: false,
+                    type: "POST",
+                    success: function (data, textStatus, jqXHR) {
+                        if (data._msg != undefined) {
+                            parent.hg.msg(data._msg);
                         }
-                        });
-                        });
+                        $("#wipMAC_StartNO").val(data.mix);
+                        $("#wipMAC_EndNO").val(data.max);
+                    },
+                    error: function (jqXHR, textStatus, errorThrown) {
+                        alert("Found error when using Ajax!!");
+                    }
+                });
+            });
 
-                        });
+        });
 
         //通过行tool编辑,lay-event="show"
         function show(obj) {
@@ -1074,141 +1085,141 @@
             });
         };
         @* KeyParts文件 sheet *@
-        hg.form.onsubmit('queryKeyParts', function (data) {
-            var item = $("#wipAtt_ItemNO").val();
-            if ($.trim(item) == '' || item == undefined) {
-                parent.hg.msg("請輸入料號");
-                return;
-            }
-            var tableCols_keyParts = [[
-                {
-                    field: 'itemName',
-                    width: 150,
-                    title: '料號',
-                    sort: true
-                },
-                {
-                    field: 'kpName',
-                    title: 'KP料號名稱',
-                    width: 200,
-                    sort: true
-                },
-                {
-                    field: 'kpNo',
-                    title: 'KP料號NO',
-                    sort: true
-                },
-                {
-                    field: 'kpSeq',
-                    title: '順序',
-                    width: 100,
-                    sort: true
-                },
-                {
-                    field: 'title',
-                    title: '前置碼',
-                    width: 150
-                },
-                {
-                    field: 'length',
-                    title: '長度',
-                    width: 150
-                },
-                {
-                    field: 'station',
-                    title: '站(前段)',
-                    width: 150
-                }]
-            ];
-            var tableKeyParts = hg.table.datatable('keyparts', 'KeyParts查詢', '/PCS/MaterialKpQuery?itemNo=' + item, {}, tableCols_keyParts,'', false, 'full-100');
-            hg.msghide("重新載入資料..");
-            tableKeyParts ;
-        });
+            hg.form.onsubmit('queryKeyParts', function (data) {
+                var item = $("#wipAtt_ItemNO").val();
+                if ($.trim(item) == '' || item == undefined) {
+                    parent.hg.msg("請輸入料號");
+                    return;
+                }
+                var tableCols_keyParts = [[
+                    {
+                        field: 'itemName',
+                        width: 150,
+                        title: '料號',
+                        sort: true
+                    },
+                    {
+                        field: 'kpName',
+                        title: 'KP料號名稱',
+                        width: 200,
+                        sort: true
+                    },
+                    {
+                        field: 'kpNo',
+                        title: 'KP料號NO',
+                        sort: true
+                    },
+                    {
+                        field: 'kpSeq',
+                        title: '順序',
+                        width: 100,
+                        sort: true
+                    },
+                    {
+                        field: 'title',
+                        title: '前置碼',
+                        width: 150
+                    },
+                    {
+                        field: 'length',
+                        title: '長度',
+                        width: 150
+                    },
+                    {
+                        field: 'station',
+                        title: '站(前段)',
+                        width: 150
+                    }]
+                ];
+                var tableKeyParts = hg.table.datatable('keyparts', 'KeyParts查詢', '/PCS/MaterialKpQuery?itemNo=' + item, {}, tableCols_keyParts, '', false, 'full-100');
+                hg.msghide("重新載入資料..");
+                tableKeyParts;
+            });
         @* Outfit sheet *@
-        hg.form.onsubmit('queryOutfit', function (data) {
-            var item = $("#wipAtt_ItemNO").val();
-            if ($.trim(item) == '' || item == undefined) {
-                parent.hg.msg("請輸入料號");
-                return;
-            }
-            var tableCols = [[
-                {
-                    field: 'outfitNo',
-                    width: 150,
-                    title: '設備編碼',
-                    sort: true
-                },
-                {
-                    field: 'stationType',
-                    title: '設備名稱',
-                    width: 200,
-                    sort: true
-                },
-                {
-                    field: 'unit.unitName',
-                    title: '生產單位',
-                    sort: true,
-                    templet: function (fileIng) {
-                        return fileIng.unit.unitName;
-                    }
+            hg.form.onsubmit('queryOutfit', function (data) {
+                var item = $("#wipAtt_ItemNO").val();
+                if ($.trim(item) == '' || item == undefined) {
+                    parent.hg.msg("請輸入料號");
+                    return;
                 }
+                var tableCols = [[
+                    {
+                        field: 'outfitNo',
+                        width: 150,
+                        title: '設備編碼',
+                        sort: true
+                    },
+                    {
+                        field: 'stationType',
+                        title: '設備名稱',
+                        width: 200,
+                        sort: true
+                    },
+                    {
+                        field: 'unit.unitName',
+                        title: '生產單位',
+                        sort: true,
+                        templet: function (fileIng) {
+                            return fileIng.unit.unitName;
+                        }
+                    }
                 ]
-            ];
-            var tableOutfit = hg.table.datatable('Outfit', '治具維護', '/PCS/MaterialOutfitByItemNo?itemNo=' + item, {}, tableCols, '', false, 'full-100');
-            hg.msghide("重新載入資料..");
-            tableOutfit;
-        });
+                ];
+                var tableOutfit = hg.table.datatable('Outfit', '治具維護', '/PCS/MaterialOutfitByItemNo?itemNo=' + item, {}, tableCols, '', false, 'full-100');
+                hg.msghide("重新載入資料..");
+                tableOutfit;
+            });
         @* SOP文件 sheet *@
-        hg.form.onsubmit('querysop', function (data) {
-            var item = $("#wipAtt_ItemNO").val();
-            if ($.trim(item) == '' || item == undefined) {
-                parent.hg.msg("請輸入料號");
-                return;
-            }
-            var tableCols = [[
-                {
-                    field: 'itemNo',
-                    width: 150,
-                    title: '料號',
-                    sort: true
-                },
-                {
-                    field: 'unitName',
-                    title: '生產單位',
-                    width: 200,
-                    sort: true
-                },
-                {
-                    field: 'sopName',
-                    title: 'SOP文件敘述',
-                    sort: true
-                },
-                {
-                    field: 'sopPath',
-                    title: '檔案路徑',
-                    sort: true
-                },
-                {
-                    field: 'sopTypeName',
-                    title: 'SOP類型',
-                    width: 100,
-                    sort: true
-                },
-                {
-                    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 tablesop = hg.table.datatable('wipsop', 'SOP文件查詢維護', '/PCS/PCS030Query?itemNo=' + item, {}, tableCols, '',false, 'full-100');
-            hg.msghide("重新載入資料..");
-            tablesop;
-        });
+            hg.form.onsubmit('querysop', function (data) {
+                var item = $("#wipAtt_ItemNO").val();
+                if ($.trim(item) == '' || item == undefined) {
+                    parent.hg.msg("請輸入料號");
+                    return;
+                }
+                var tableCols = [[
+                    {
+                        field: 'itemNo',
+                        width: 150,
+                        title: '料號',
+                        sort: true
+                    },
+                    {
+                        field: 'unitName',
+                        title: '生產單位',
+                        width: 200,
+                        sort: true
+                    },
+                    {
+                        field: 'sopName',
+                        title: 'SOP文件敘述',
+                        sort: true
+                    },
+                    {
+                        field: 'sopPath',
+                        title: '檔案路徑',
+                        sort: true
+                    },
+                    {
+                        field: 'sopTypeName',
+                        title: 'SOP類型',
+                        width: 100,
+                        sort: true
+                    },
+                    {
+                        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 tablesop = hg.table.datatable('wipsop', 'SOP文件查詢維護', '/PCS/PCS030Query?itemNo=' + item, {}, tableCols, '', false, 'full-100');
+                hg.msghide("重新載入資料..");
+                tablesop;
+            });
 
         function RuleStation(id) {
             if (id == null) {
@@ -1234,24 +1245,22 @@
                     sort: true
                 }]
             ];
-            var tableruleStation = hg.table.datatable('ruleStation', '', '/BAS/GetRuleStationsByFlow?flowId='+id, {}, tableCols_rule,'', false, 'full-100');
+            var tableruleStation = hg.table.datatable('ruleStation', '', '/BAS/GetRuleStationsByFlow?flowId=' + id, {}, tableCols_rule, '', false, 'full-100');
             tableruleStation;
         };
 
         function getPLMMeterial(val) {
-        var data = $("#PCS001").serialize();
-        console.info(data);
-               $.ajax(
+            var data = $("#PCS001").serialize();
+            console.info(data);
+            $.ajax(
                 {
                     url: "@Url.Action("PCS001CreateWipNo", "PCS")",
                     dataType: 'json',
                     data: data,
                     type: 'POST',
-                    success: function (result)
-                    {
+                    success: function (result) {
                     },
-                    error: function (result)
-                    {
+                    error: function (result) {
                         alert(result);
                     }
                 });
@@ -1274,22 +1283,20 @@
                     '</tr>';
                 $('#OutfitTable').append(contactdiv);
             });
-    }
+        }
 
         //UserName
         function getUserName(val) {
-               $.ajax(
+            $.ajax(
                 {
                     url: "@Url.Action("getUserName", "SYS")",
                     dataType: 'json',
-                       data: { "userNo": val.value},
+                    data: { "userNo": val.value },
                     type: 'post',
-                    success: function (result)
-                    {
+                    success: function (result) {
                         $(val).closest('div.layui-inline').find('input[id*=' + val.id + '_Name]').val(result.data);
                     },
-                    error: function (result)
-                    {
+                    error: function (result) {
                         alert(result);
                     }
                 });
diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml
index 19cf183a..ae25f095 100644
--- a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml
+++ b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml
@@ -1,8 +1,10 @@
 @model AMESCoreStudio.Web.ViewModels.PCS.WipDataViewModel
 
 
-@{ ViewData["Title"] = "PCS001C";
-    Layout = "~/Views/Shared/_AMESLayout.cshtml"; }
+@{
+    ViewData["Title"] = "PCS001C";
+    Layout = "~/Views/Shared/_AMESLayout.cshtml";
+}
 
 <style>
     .control-label {
@@ -291,7 +293,9 @@
                     @* Keypart組合sheet *@
                     <div class="layui-tab-item">
                         <table id="MydataTable" class="layui-table">
-                            @{ int i = 0;}
+                            @{
+                                int i = 0;
+                            }
                             <thead>
                                 <tr>
                                     <th>
@@ -467,12 +471,18 @@
                                 <label class="layui-form-label">DIP</label>
                                 <div class="layui-input-block">
                                     <cl-checkbox asp-items="@ViewBag.GetCheckboxDIP" asp-for="wipBoard.DipSides" asp-skin="defult"></cl-checkbox>
-                                    <input @if (Model.wipBoard != null) { @(Model.wipBoard.DipCarrier == "Y" ? "checked" : "") } type="checkbox" title="CARRIER" name="wipBoard.DipCarrier" />
-                                    <input @if (Model.wipBoard != null) { @(Model.wipBoard.DipTape == "Y" ? "checked" : "") } type="checkbox" title="貼付膠帶" name="wipBoard.DipTape" />
-                                    <input @if (Model.wipBoard != null) { @(Model.wipBoard.DipSolderMask == "Y" ? "checked" : "") } type="checkbox" title="點防焊膠" name="wipBoard.SmdSolderMask" />
+                                    <input @if (Model.wipBoard != null) {
+                                    @(Model.wipBoard.DipCarrier == "Y" ? "checked" : "")
+ } type="checkbox" title="CARRIER" name="wipBoard.DipCarrier" />
+                                    <input @if (Model.wipBoard != null) {
+                                    @(Model.wipBoard.DipTape == "Y" ? "checked" : "")
+ } type="checkbox" title="貼付膠帶" name="wipBoard.DipTape" />
+                                    <input @if (Model.wipBoard != null) {
+                                    @(Model.wipBoard.DipSolderMask == "Y" ? "checked" : "")
+ } type="checkbox" title="點防焊膠" name="wipBoard.SmdSolderMask" />
                                     @*<input asp-for="wipBoard.DipCarrier" type="checkbox" title="CARRIER" />
-                                        <input asp-for="wipBoard.DipTape" type="checkbox" title="貼付膠帶" />
-                                        <input asp-for="wipBoard.SmdSolderMask" type="checkbox" title="點防焊膠" />*@
+                                    <input asp-for="wipBoard.DipTape" type="checkbox" title="貼付膠帶" />
+                                    <input asp-for="wipBoard.SmdSolderMask" type="checkbox" title="點防焊膠" />*@
                                 </div>
                             </div>
                         </div>
@@ -488,7 +498,9 @@
                             <div class="layui-inline">
                                 <label class="layui-form-label">燒錄</label>
                                 <div class="layui-input-inline">
-                                    <input @if (Model.wipBoard != null) { @(Model.wipBoard.Burn == "Y" ? "checked" : "") } type="checkbox" title="是否燒入" name="wipBoard.Burn" />
+                                    <input @if (Model.wipBoard != null) {
+                                    @(Model.wipBoard.Burn == "Y" ? "checked" : "")
+ } type="checkbox" title="是否燒入" name="wipBoard.Burn" />
                                     @*<input asp-for="wipBoard.Burn" type="checkbox" title="是否燒入" />*@
                                 </div>
                                 <div class="layui-input-inline">
@@ -510,7 +522,9 @@
 
                         <div class="layui-form-item">
                             <div class="layui-inline">
-                                <input @if (Model.wipBoard != null) { @(Model.wipBoard.ISPartsBake == "Y" ? "checked" : "") } type="checkbox" title="零件是否需要烘烤" name="wipBoard.ISPartsBake" />
+                                <input @if (Model.wipBoard != null) {
+                                @(Model.wipBoard.ISPartsBake == "Y" ? "checked" : "")
+ } type="checkbox" title="零件是否需要烘烤" name="wipBoard.ISPartsBake" />
                             </div>
                             <div class="layui-inline">
                                 <label class="layui-form-label">零件烘烤溫度</label>
@@ -840,7 +854,9 @@
                             <div class="layui-inline">
                                 <label class="layui-form-label">FINE_PACKAGE</label>
                                 <div class="layui-input-inline">
-                                    <input type="checkbox" title="是否為精裝" @if (Model.wipSystem != null) { @(Model.wipSystem.FinePackage == "Y" ? "checked" : "") } />
+                                    <input type="checkbox" title="是否為精裝" @if (Model.wipSystem != null) {
+                                    @(Model.wipSystem.FinePackage == "Y" ? "checked" : "")
+ } />
 
                                 </div>
                             </div>
@@ -863,9 +879,23 @@
                         </div>
 
                         <div class="layui-form-item">
-                            <label class="layui-form-label">備註</label>
+                            <label class="layui-form-label">組裝備註</label>
+                            <div class="layui-input-block">
+                                <textarea class="layui-textarea" asp-for="wipSystem.BabMemo"></textarea>
+                            </div>
+                        </div>
+
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">測試備註</label>
+                            <div class="layui-input-block">
+                                <textarea class="layui-textarea" asp-for="wipSystem.TestMemo"></textarea>
+                            </div>
+                        </div>
+
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">包裝備註</label>
                             <div class="layui-input-block">
-                                <textarea class="layui-textarea" asp-for="wipSystem.Memo"></textarea>
+                                <textarea class="layui-textarea" asp-for="wipSystem.PackingMemo"></textarea>
                             </div>
                         </div>
                     </div>
@@ -873,7 +903,9 @@
                     @* 治具組合sheet *@
                     <div class="layui-tab-item">
                         <table id="MydataTable" class="layui-table">
-                            @{ int j = 0;}
+                            @{
+                                int j = 0;
+                            }
                             <thead>
                                 <tr>
                                     <th>
@@ -911,7 +943,9 @@
                     <div class="layui-tab-item" lay-filter="test2">
                         <table class="layui-hide" id="query" lay-filter="query"></table>
                         <table lay-filter="demo" class="layui-table">
-                            @{ int l = 0;}
+                            @{
+                                int l = 0;
+                            }
                             <thead>
                                 <tr>
                                     <th lay-data="{field:'username', width:100}">SOP文件敘述</th>
@@ -1027,7 +1061,7 @@
     <script type="text/javascript">
 
         $(document).ready(function () {
-             // 安勤統一只Show工程資訊
+            // 安勤統一只Show工程資訊
             $("#system").show();
             $("#board").hide();
 
diff --git a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml
index 5a80dae1..0b650144 100644
--- a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml
+++ b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml
@@ -895,10 +895,24 @@
                             </div>
                         </div>
 
+                           <div class="layui-form-item">
+                            <label class="layui-form-label">組裝備註</label>
+                            <div class="layui-input-block">
+                                <textarea class="layui-textarea" asp-for="wipSystem.BabMemo"></textarea>
+                            </div>
+                        </div>
+
                         <div class="layui-form-item">
-                            <label class="layui-form-label">備註</label>
+                            <label class="layui-form-label">測試備註</label>
+                            <div class="layui-input-block">
+                                <textarea class="layui-textarea" asp-for="wipSystem.TestMemo"></textarea>
+                            </div>
+                        </div>
+
+                        <div class="layui-form-item">
+                            <label class="layui-form-label">包裝備註</label>
                             <div class="layui-input-block">
-                                <textarea class="layui-textarea" asp-for="wipSystem.Memo"></textarea>
+                                <textarea class="layui-textarea" asp-for="wipSystem.PackingMemo"></textarea>
                             </div>
                         </div>
                     </div>
diff --git a/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs b/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs
index 93d3a40e..b65c603f 100644
--- a/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs
+++ b/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs
@@ -262,13 +262,31 @@ namespace AMESCoreStudio.WebApi.Models.AMES
         public string Jumper { get; set; }
 
         /// <summary>
-        /// 備註
+        /// 組裝備註
         /// </summary>
-        [Column("MEMO")]
+        [Column("BAB_MEMO")]
         [StringLength(300)]
         [DataMember]
-        [Display(Name = "備註")]
-        public string Memo { get; set; }
+        [Display(Name = "組裝備註")]
+        public string BabMemo { get; set; }
+
+        /// <summary>
+        /// 測試備註
+        /// </summary>
+        [Column("TEST_MEMO")]
+        [StringLength(300)]
+        [DataMember]
+        [Display(Name = "測試備註")]
+        public string TestMemo { get; set; }
+
+        /// <summary>
+        /// 包裝備註
+        /// </summary>
+        [Column("PACKING_MEMO")]
+        [StringLength(300)]
+        [DataMember]
+        [Display(Name = "包裝備註")]
+        public string PackingMemo { get; set; }
 
         /// <summary>
         /// 創建者ID