@{
    ViewData["Title"] = "IPQC查詢報表 - IPQC明細資料";
    Layout = "~/Views/Shared/_AMESLayout.cshtml";
}

<div class="layui-card">
    <div class="layui-card-body">
        <input id="wip_no" name="wip_no" value="@ViewBag.WIP_NO" type="hidden" />
        <input id="item_no" name="item_no" value="@ViewBag.ITEM_NO" type="hidden" />
        <input id="model_no" name="model_no" value="@ViewBag.MODEL_NO" type="hidden" />
        <input id="start_date" name="start_date" value="@ViewBag.START_DATE" type="hidden" />
        <input id="end_date" name="end_date" value="@ViewBag.END_DATE" type="hidden" />
        <input id="week" name="week" value="@ViewBag.WEEK" type="hidden" />
        <table class="layui-hide" id="test" lay-filter="test"></table>
    </div>
</div>

@section Scripts{
<script type="text/javascript">
        //监听表单提交事件
        hg.form.onsubmit('querysubmit', function (data) {
            table && table.reload(data);
        });
    var tableCols = [[
        {
            field: 'inspectionID',
            width: 160,
            title: 'IPQC單號',
            sort: true
        },
        {
            field: 'wipNo',
            width: 100,
            title: '工單'
        },
        {
            field: 'barcodeNo',
            title: '檢驗序號'
        },
        {
            field: 'itemNo',
            width: 150,
            title: '料號'
        },
        {
            field: 'createDate',
            width: 150,
            title: '建立日期'
        },
        {
            field: 'result',
            width: 60,
            title: '結果',
            templet: function (d) {
                if (d.result == 'P')
                    return '允收'
                if (d.result == 'F')
                    return '批退'
                if (d.result == 'A')
                    return '初始'
            }
        }]
    ];

    //基本数据表格
    var table = hg.table.datatable('test', 'IPQC明細資料', '/QRS/GetIPQCDetailData/' + wip_no.value + '_' + item_no.value + '_' + model_no.value + '_' + start_date.value + '_' + end_date.value + '_' + week.value, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']);
</script>
}