<%@ Page Language="C#" %>

<%@ Register TagPrefix="aspxform" Namespace="XFormDesigner.Framework.Web.UI" Assembly="XFormDesigner.Framework" %>
<script runat="server">

    // Insert page code here
    //
    protected void Page_Load(object sender, EventArgs e)
    {
        string acc = Request.QueryString["acc"];

        //this.XLabel7.Text = acc;

    }

</script>
<html xmlns:xform="xmlns:xform">
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
    <link href="/Oimec/Styles/css/StyleSheet.css" rel="stylesheet" type="text/css" />
    <script src="/Oimec/Script/My97DatePicker/WdatePicker.js"></script>
    <script src="../../../../Oimec/Script/jquery-3.2.1.js"></script>
    <script src="../../../../Oimec/Script/jquery-3.2.1.min.js"></script>
    <title>BPM Form</title>
    <style>
        BODY {
            FONT-SIZE: 12px;
            FONT-FAMILY: verdana;
        }

        TABLE {
            border-collapse: collapse;
            FONT-SIZE: 12px;
            FONT-FAMILY: verdana;
        }

        P {
            PADDING-RIGHT: 0px;
            PADDING-LEFT: 0px;
            PADDING-BOTTOM: 0px;
            MARGIN: 0px;
            PADDING-TOP: 0px;
            FONT-SIZE: 12px;
            FONT-FAMILY: verdana;
        }

        TD {
            PADDING-RIGHT: 0px;
            PADDING-LEFT: 2px;
            PADDING-BOTTOM: 0px;
        }

            TD.NoPadding {
                PADDING-RIGHT: 0px;
                PADDING-LEFT: 0px;
                PADDING-BOTTOM: 0px;
                PADDING-TOP: 0px;
            }

        INPUT {
            HEIGHT: 20px;
        }

            INPUT.UL {
                BORDER-RIGHT: medium none;
                BORDER-TOP: medium none;
                BORDER-LEFT: medium none;
                BORDER-BOTTOM: #33ff33 1px solid;
            }

        TEXTAREA {
            FONT-SIZE: 12px;
        }
    </style>
    <script type="text/javascript">

        function getXValue(id) {
            return agent.Eles[document.getElementById(id).getAttribute("xform_xele_index")].getValue();
        }

        function setXValue(id, value) {
            agent.Eles[document.getElementById(id).getAttribute("xform_xele_index")].setValue(value);
        }

        function submit_print() {
            var url = "物流-出入库单.aspx";
            var name = "_blank";

            var data = {};
            data.suppliername = getXValue("SupplierName");
            data.supplierid = getXValue("SupplierID");
            data.text = getXValue("remark");
            data.voucher = getXValue("voucher");

            //序列号信息
            var rv1 = new Array();
            var _table = document.getElementById("tableSerial");

            var rv = new Array();
            //产品信息
            var table = document.getElementById("tableItems");
            for (var i = 2; i < table.rows.length; i++) {
                var confirm = getCellXValue(table, i, 9, 0)
                if (confirm == 1) {
                    //工厂 库存地 物料号-名称|型号 数量 记账符号 批次 特殊库存 SO号 SO行号 PO号 PO行号
                    var po = getCellXValue(table, i, 1, 1),
                        poItemNo = getCellXValue(table, i, 1, 0),
                        psapid = getCellXValue(table, i, 2, 0),
                        pmodel = getCellXValue(table, i, 3, 0),
                        pname = getCellXValue(table, i, 4, 0),
                        pnumber = getCellXValue(table, i, 6, 0),
                        plant = getCellXValue(table, i, 7, 1),
                        storage = getCellXValue(table, i, 8, 1),
                        so = getCellXValue(table, i, 12, 0),
                        soItemNo = getCellXValue(table, i, 13, 0),
                        salesman = getCellXValue(table, i, 14, 0);


                    var batch = "",
                        serials = "";
                    for (var j = 2; j < _table.rows.length; j++) {
                        var _batch = getCellXValue(_table, j, 4, 0);
                        var _serialNo = getCellXValue(_table, j, 5, 0);
                        var _poItemNo = getCellXValue(_table, j, 1, 0);
                        if (Number(poItemNo) == Number(_poItemNo)) {
                            if (serials == "")
                                serials = _serialNo;
                            else
                                serials = serials + "、" + _serialNo;

                            if (batch == "")
                                batch = _batch;
                        }
                    }
                    rv.push({
                        po: po, poItemNo: poItemNo, psapid: psapid, pmodel: pmodel, pname: pname, pnumber: pnumber, plant: plant, storage: storage, so: so, soItemNo: soItemNo, salesman: salesman,
                        batch: batch, serialNo: serials
                    });
                }
            }
            data.lineItem = rv;

            dataStr = JSON.stringify(data);
            openPostWindow(url, dataStr, name);
        }

        //入库单
        function openPostWindow(url, data, name) {
            var tempForm = document.createElement("form");
            tempForm.id = "tempForm1";
            tempForm.method = "post";
            tempForm.action = url;
            tempForm.target = name; // _blank - URL加载到一个新的窗口

            var hideInput = document.createElement("input");
            hideInput.type = "hidden";
            hideInput.name = "pdata"
            hideInput.value = data;
            tempForm.appendChild(hideInput);

            // 可以传多个参数
            /* var nextHideInput = document.createElement("input");
            nextHideInput.type = "hidden";
            nextHideInput.name = "content";
            nextHideInput.value = data;
            tempForm.appendChild(nextHideInput); */

            if (document.all) {    // 兼容不同浏览器
                tempForm.attachEvent("onsubmit", function () { });        //IE
            } else {
                tempForm.addEventListener("submit", function () { }, false);    //firefox
            }
            document.body.appendChild(tempForm);
            if (document.all) {    // 兼容不同浏览器
                tempForm.fireEvent("onsubmit");
            } else {
                tempForm.dispatchEvent(new Event("submit"));
            }
            tempForm.submit();
            document.body.removeChild(tempForm);

        }

        function openWindow(url, name) {
            //window.open('about:blank', name, 'height=400, width=400, top=0, left=0, toolbar=yes, menubar=yes, scrollbars=yes, resizable=yes,location=yes, status=yes');
            //window.open(url, name, null);
            window.open(url, name);
        }



        //收货过账
        function submit_SHGZ() {

            //检查数据
            var table = document.getElementById("tableItems");
            var v = false;
            var IsBatch;
            var SerialCode;
            for (var i = 2; i < table.rows.length; i++) {
                //po行号
                var row = agent.Eles[table.rows[i].cells[1].children[0].getAttribute("xform_xele_index")].getValue();
                //数量
                var number = agent.Eles[table.rows[i].cells[6].children[0].getAttribute("xform_xele_index")].getValue();
                //是否确认收货
                var confirm = agent.Eles[table.rows[i].cells[9].children[0].getAttribute("xform_xele_index")].getValue();
                if (confirm == 1) {
                    v = true;
                    //检查实际收货数量、库存地
                    //未收货数量初始值
                    var _number = agent.Eles[table.rows[i].cells[6].children[1].getAttribute("xform_xele_index")].getValue();
                    if (parseInt(number) == 0) {
                        alert(row + "行实际收货数量必须大于0！");
                        return;
                    }

                    if (parseInt(number) > parseInt(_number)) {
                        alert(row + "行实际收货数量不能大于PO数量！");
                        return;
                    }

                    //批次 序列号
                    var batch = agent.Eles[table.rows[i].cells[1].children[2].getAttribute("xform_xele_index")].getValue();
                    var serial = agent.Eles[table.rows[i].cells[1].children[3].getAttribute("xform_xele_index")].getValue();
                    if (batch == "是")
                        IsBatch = batch;
                    if (serial != "")
                        SerialCode = serial;
                }
            }
            if (!v) {
                alert("行项目请先勾选确认收货！");
                return;
            }

            //检查批次序列号信息
            if (IsBatch == "是" || (SerialCode != "" && SerialCode != undefined && SerialCode != "Z002")) {
                var _table = document.getElementById("tableSerial");
                if (_table.rows.length <= 2) {
                    alert("确认收货的产品有批次或序列号管理，请更新【产品批次和序列号】");
                    return;
                }
                else {
                    var res = checkBatchSerial();
                    if (!res) return;
                }
            }

            //更新库存地
            //var s = updateStock();
            //if (!s) return false;

            //收货过账
            shgz();

        }

        //检查批次序列号信息
        function checkBatchSerial() {
            var _table = document.getElementById("tableSerial");
            var table = document.getElementById("tableItems");
            for (var i = 2; i < table.rows.length; i++) {

                //是否确认收货
                var confirm = getCellXValue(table, i, 9, 0);
                if (confirm == 1) {
                    //批次 序列号
                    var batch = getCellXValue(table, i, 1, 2);
                    var serial = getCellXValue(table, i, 1, 3);
                    var poItemNo = getCellXValue(table, i, 1, 0);

                    var pc = "";
                    var isLine = false;//批次序列号是否存在此行信息

                    for (var j = 2; j < _table.rows.length; j++) {
                        var _poItemNo = getCellXValue(_table, j, 1, 0);

                        if (poItemNo == _poItemNo) {
                            isLine = true;
                            var line = getCellXValue(_table, j, 0, 0);
                            //检查批次
                            if (batch == "是") {
                                var b = getCellXValue(_table, j, 4, 0);
                                if (b == "") {
                                    alert("序号" + line + ",PO行号" + poItemNo + "请填写批次！");
                                    return false;
                                }
                                if (pc != "") {
                                    if (pc != b) {
                                        //alert("序号" + line + ",PO行号" + poItemNo + "批次必须一致！");
                                        alert("PO行号" + poItemNo + "批次必须一致！");
                                        return false;
                                    }
                                }
                                else
                                    pc = b;
                            }

                            //检查序列号
                            if (serial == "Z001") {
                                var s = getCellXValue(_table, j, 5, 0);
                                if (s == "") {
                                    alert("序号" + line + ",PO行号" + poItemNo + "请填写序列号！");
                                    return false;
                                }
                            }
                        }
                    }

                    if (serial == "Z001" || batch == "是") {
                        if (!isLine) {
                            alert("请更新PO行号" + poItemNo + "产品批次和序列号");
                            return false;
                        }
                    }
                }
            }

            return true;
        }

        //更新库存地
        function updateStock() {

            var res;
            var obj = {};
            obj.PO = getXValue("SAPPO");
            var rv = new Array();
            var table = document.getElementById("tableItems");
            for (var i = 2; i < table.rows.length; i++) {
                var confirm = getCellXValue(table, i, 9, 0)
                if (confirm == 1) {
                    var po = getCellXValue(table, i, 1, 1),
                        poItemNo = getCellXValue(table, i, 1, 0),
                        plant = getCellXValue(table, i, 7, 1),
                        storage = getCellXValue(table, i, 8, 1);

                    rv.push({
                        PO: po,
                        PORowNumber: poItemNo,
                        Storage: storage
                    });
                }

            }

            obj.LineItem = rv;
            //将对象转换成字符
            var str = JSON.stringify(obj);
            //alert(str);
            var url = YZSoft.$url('Oimec/ApiServices/LogisticsAPIHandler.ashx');
            var param = {
                method: 'UpdatePOStock',
                data: str
            };
            YZSoft.Ajax.request({
                async: false,
                url: url,
                method: "post",
                params: param,
                success: function (action) {
                    var data = action.result;
                    if (data.Code == 0) {
                        res = true;
                    }
                    else {
                        if (data.Bean != null) {
                            var strmsg = data.Bean[0].MESSAGE;
                            alert(strmsg);
                        }
                        else { alert(data.Message); }

                        res = false;
                    }

                },
                failure: function (response) {
                }
            });

            if (!res) res = false;
            return res;

        }

        //执行收货过账
        function shgz() {

            var obj = {};
            var remark = getXValue("remark");
            obj.text = remark;//抬头文本
            var rv = new Array();

            var number = 1;
            var _table = document.getElementById("tableSerial");
            var table = document.getElementById("tableItems");
            for (var i = 2; i < table.rows.length; i++) {

                var confirm = getCellXValue(table, i, 9, 0)
                if (confirm == 1) {

                    var po = getCellXValue(table, i, 1, 1),
                     poItemNo = getCellXValue(table, i, 1, 0),
                     sapid = getCellXValue(table, i, 2, 0),
                     dnumber = getCellXValue(table, i, 6, 0),
                     plant = getCellXValue(table, i, 7, 1),
                     storage = getCellXValue(table, i, 8, 1);

                    var o = {
                        EntryNumber: dnumber,
                        MaterialId: sapid,
                        MaterialItemNumber: number,
                        Plant: plant,
                        RepertoryAddr: storage,
                        PurOrderNum: po,
                        PurItemNo: poItemNo,
                        MoveStatus: "B",
                        MoveType: "101"
                    };


                    //批次
                    var IsBatch = getCellXValue(table, i, 1, 2);
                    var batch = "";

                    var SerialCode = getCellXValue(table, i, 1, 3);
                    var rv_serial = new Array();
                    if (SerialCode == "Z001" || IsBatch == "是") {
                        //序列号管理
                        for (var j = 2; j < _table.rows.length; j++) {
                            var _po = getCellXValue(_table, j, 1, 1);
                            var _poItemNo = getCellXValue(_table, j, 1, 0);
                            if (poItemNo == _poItemNo) {
                                var serialNo = getCellXValue(_table, j, 5, 0);
                                rv_serial.push(serialNo);

                                if (IsBatch == "是") {
                                    var _batch = getCellXValue(_table, j, 4, 0)
                                    if (_batch != "") {
                                        batch = _batch;
                                    }
                                }
                            }
                        }
                    }
                    o.Batch = batch;
                    o.SerialNo = rv_serial;
                    rv.push(o);

                    number++;
                }
            }

            obj.VoucherLineitem = rv;
            //将对象转换成字符
            var str = JSON.stringify(obj);
            //alert(str);
            var url = YZSoft.$url('Oimec/ApiServices/LogisticsAPIHandler.ashx');
            var param = {
                method: 'POReceivingGoods',
                data: str
            };
            YZSoft.Ajax.request({
                async: false,
                url: url,
                method: "post",
                params: param,
                success: function (action) {
                    var data = action.result;
                    if (data.Code == 0) {
                        alert("收货过账成功，物料凭证号" + data.Bean.MaterialNo);

                        setXValue("voucher", data.Bean.MaterialNo);
                        XFormOnChange(agent.Eles[document.getElementById('voucher').getAttribute("xform_xele_index")]);
                        //window.opener = null; window.top.open('', '_self', ''); window.close(this);
                    }
                    else {
                        alert(data.Message);
                    }

                },
                failure: function (response) {
                }
            });

        }

        //【收货过账】按钮失效控制
        function ShowSubmit(v) {
            var po = getXValue("SAPPO");
            if (po == "" || po == null)
                return true;

            var table = document.getElementById("tableItems");
            if (table != null) {
                if (table.rows.length <= 2)
                    return true;
            }

            return false;
        }

        //序列号自动换行
        function Serial_OnChange(e) {
            var name = $(e).attr("name");
            var nextRowName = $(e).parent().parent().next().find("div[name=" + name + "]").find("input")[0];
            if (nextRowName != undefined) {
                nextRowName.focus();
            }
        }


        //获取table单元格数据
        function getCellXValue(table, r, c, chi) {
            return agent.Eles[table.rows[r].cells[c].children[chi].getAttribute("xform_xele_index")].getValue()
        }

        //根据产品明细动态显示批次和序列号
        function getPO(t) {

            var tds = t.getElementsByTagName('td');
            var PORowNumber = "";

            var tableItems = document.getElementById("tableItems");

            for (var i = 2; i < tableItems.rows.length; i++) {
                var s = tableItems.rows[i];

                if (t == s) {
                    for (var j = 0; j < tds.length; j++) {

                        var d = tds[j];

                        if (j == "0") {
                            d.getElementsByTagName('span')[0].style.background = "#dcdcdc";
                            d.getElementsByTagName('span')[0].style.background = "red";
                        }
                        if (j == "1") {
                            var idPORowNumber = d.getElementsByTagName('input')[0].id;
                            PORowNumber = document.getElementById(idPORowNumber).value;
                            //s  console.log(suppplier);

                            break;
                        }
                    }
                } else {
                    s.getElementsByTagName('span')[0].style.background = "#dcdcdc";
                }
            }

            var aDivPORowNumber = document.getElementsByName("SerialDetailPORowNumber");
            var tableObj = document.getElementById("tableSerial");
            //alert(aDivPORowNumber.length)
            for (var i = 0; i < aDivPORowNumber.length; i++) {

                var divPORowNumber = aDivPORowNumber[i];
                var idPORowNumber = divPORowNumber.getElementsByTagName('input')[0].id;
                var PORowNumberValue = document.getElementById(idPORowNumber).value;

                if (PORowNumber != PORowNumberValue) {


                    tableObj.rows[i + 2].style.display = "none";
                } else {

                    tableObj.rows[i + 2].style.display = "";
                }

            }



            // agent.Eles[document.getElementById("num").getAttribute("xform_xele_index")].setValue("新供应商72-2");    //XLabel3
        }



    </script>
</head>
<body>
    <form runat="server">
        <table width="1200" align="center" class="head" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td class="logo"></td>
                    <td class="biaoti" style="padding-left: 30px">
                        <asp:Label ID="Label1" runat="server" Text="SAP-PO收货"></asp:Label></td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" class="table" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td colspan="3">
                        <asp:Label ID="Label6" runat="server" Text="标记*的为申请人必填项" Font-Bold="True" ForeColor="Red"></asp:Label>
                    </td>
                    <td style="text-align: right">
                        <aspxform:XLabel ID="voucher" runat="server" XDataBind="voucher" HiddenExpress="1"></aspxform:XLabel>
                        <aspxform:XButton ID="XButton1" Style="height: 30px; width: 100px" DisableExpress="voucher==''" runat="server" Text="打印入库单" OnClientClick="submit_print();"></aspxform:XButton>
                    </td>
                </tr>
                <tr>
                    <td class="title1" colspan="4">基本信息</td>
                </tr>
                <tr>
                    <td class="tsbottomlabel" style="width: 12%">
                        <asp:Label ID="Label10" runat="server" Text="*" ForeColor="Red"></asp:Label>&nbsp;
                        <asp:Label ID="Label7" runat="server" Text="SAP-PO号"></asp:Label></td>
                    <td class="tsbottomtext" style="width: 88%" colspan="3">
                        <aspxform:XTextBox ID="SAPPO" runat="server" XDataBind="SAPPO" CssClass="text" Height="30px" Width="300px" BorderColor="#DCDCDC" BorderWidth="1"></aspxform:XTextBox>
                        &nbsp;<aspxform:XCustomBrowserButton ID="XCustomBrowserButton2" runat="server" Text="获取SAP-PO信息" Height="30px" Width="120px" XClass="Oimec.Dialogs.SupplierDeliverInfoButton" Filter="PO->SAPPO" DataMap="PO->PO;PORowNumber->PORowNumber;PurchaseContractNo->PurchaseContractNo;SupplierName->SupplierName;Plant->Plant;Plant1->Plant1;Storage->Storage;ProductSAPID->ProductSAPID;ProductModel->ProductModel;ProductName->ProductName;SalesMan->SalesMan;SalesManID->SalesManID;SO->SO;SORowNumber->SORowNumber;ActNum->DeliverNumber;PONumber->PONumber;IsBatch->IsBatch;SerialCode->SerialCode;PlantName->PlantName;StorageName->StorageName;SellerCustomerName->SellerCustomerName;SupplierDeliveryDate->SupplierDeliveryDate;ManufacturerName->ManufacturerName" AppendMode="ClearAndAppend" UseSubmitBehavior="False"></aspxform:XCustomBrowserButton>
                        &nbsp;
                        <asp:Label ID="Label47" runat="server" Font-Bold="true" Font-Size="9" ForeColor="Blue" Text="(只能输入一个PO号)"></asp:Label></td>
                </tr>
                <tr>
                    <td width="10%" height="19" class="tsbottomlabel">
                        <asp:Label ID="XLabel41" runat="server" Text="供应商名称"></asp:Label></td>
                    <td width="35%" class="tsbottomtext" colspan="3">
                        <aspxform:XLabel ID="SupplierName" Style="height: 30px; width: 100%" runat="server" XDataBind="SupplierName" BackColor="#d4e4fe"></aspxform:XLabel>
                        <aspxform:XLabel ID="SupplierID" HiddenExpress="1" Style="height: 30px; width: 100%" runat="server" XDataBind="SupplierID" BackColor="#d4e4fe"></aspxform:XLabel>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <div align="center" id="scrollDiv" style="border-top: #93a1ae 1px solid; height: auto; border-right: #93a1ae 1px solid; width: 1200px; overflow-x: scroll; border-bottom: #93a1ae 1px solid; text-align: center; clear: both; border-left: #93a1ae 1px solid">
            <table width="2000" align="center" class="scrolltable" id="tableItems" style="border-top: medium none" border="0" cellspacing="0" cellpadding="0" dynamicarea="2,1" menudock="Left" emptygrid="KeepEmpty">
                <tbody>
                    <tr>
                        <td height="17" class="title1" style="border-top: medium none" colspan="25">
                            <asp:Label ID="Label11" runat="server" Text="产品明细"></asp:Label></td>
                    </tr>
                    <tr>
                        <td width="50" height="15" class="tds">
                            <asp:Label ID="Label12" runat="server" Text="序号"></asp:Label></td>
                        <td width="60" class="tds">&nbsp;<asp:Label ID="Label14" runat="server" Text="PO行号"></asp:Label></td>
                        <td width="100" class="tds">
                            <asp:Label ID="Label20" runat="server" Text="产品SAPID"></asp:Label></td>
                        <td width="100" class="tds">
                            <asp:Label ID="Label22" runat="server" Text="产品型号"></asp:Label></td>
                        <td width="150" class="tds">
                            <asp:Label ID="Label23" runat="server" Text="产品名称"></asp:Label></td>
                        <td width="60" class="tds">
                            <asp:Label ID="Label26" runat="server" Text="PO数量"></asp:Label></td>
                        <td width="100" class="tds">
                            <asp:Label ID="Label39" runat="server" Text="* " ForeColor="Red"></asp:Label>&nbsp;<asp:Label ID="Label27" runat="server" Text="实际收货数量"></asp:Label></td>
                        <td width="100" class="tds">
                            <asp:Label ID="Label29" runat="server" Text="工厂"></asp:Label></td>
                        <td width="100" class="tds">
                            <asp:Label ID="Label4" runat="server" Text="* " ForeColor="Red"></asp:Label>&nbsp;
                            <asp:Label ID="Label30" runat="server" Text="库存地"></asp:Label></td>
                        <td width="60" class="tds">
                            <asp:Label ID="Label32" runat="server" Text="确认收货"></asp:Label></td>
                        <td width="100" class="tds">
                            <asp:Label ID="Label2" runat="server" Text="采购合同号"></asp:Label></td>
                        <td width="150" class="tds">
                            <asp:Label ID="Label24" runat="server" Text="厂商名称"></asp:Label></td>
                        <td width="80" class="tds">
                            <asp:Label ID="Label33" runat="server" Text="SO号"></asp:Label></td>
                        <td width="60" class="tds">
                            <asp:Label ID="Label34" runat="server" Text="SO行号"></asp:Label></td>
                        <td width="80" class="tds">
                            <asp:Label ID="Label3" runat="server" Text="业务员"></asp:Label></td>
                        <td width="200" class="tds">
                            <asp:Label ID="Label35" runat="server" Text="售达方客户名称"></asp:Label></td>
                        <td width="120" class="tds">&nbsp;<asp:Label ID="Label37" runat="server" Text="供应商发货日期"></asp:Label></td>
                    </tr>
                    <tr style="height: 20px" onclick="getPO(this)">
                        <td class="tds1">
                            <aspxform:XGridLineNo ID="LineNumber" runat="server" XDataBind="LineNumber" Height="100%" Width="100%" BorderWidth="1" TextAlign="Center" BorderStyle="None">1</aspxform:XGridLineNo>
                        </td>
                        <td class="tds1">
                            <aspxform:XTextBox ID="PORowNumber" runat="server" XDataBind="PORowNumber" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" TextAlign="Center" name="PORowNumber" ReadOnly="True"></aspxform:XTextBox>
                            <aspxform:XTextBox ID="PO" runat="server" XDataBind="PO" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" name="PO" ReadOnly="True" HiddenExpress="1"></aspxform:XTextBox>
                            <aspxform:XTextBox ID="IsBatch" runat="server" XDataBind="IsBatch" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" name="IsBatch" ReadOnly="True" HiddenExpress="1"></aspxform:XTextBox>
                            <aspxform:XTextBox ID="SerialCode" runat="server" XDataBind="SerialCode" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" name="SerialCode" ReadOnly="True" HiddenExpress="1"></aspxform:XTextBox>
                        </td>
                        <td class="tds1">
                            <aspxform:XTextBox ID="ProductSAPID" runat="server" XDataBind="ProductSAPID" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" ReadOnly="True"></aspxform:XTextBox>
                        </td>
                        <td class="tds1">
                            <aspxform:XTextBox ID="ProductModel" runat="server" XDataBind="ProductModel" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" ReadOnly="True"></aspxform:XTextBox>
                        </td>
                        <td class="tds1">
                            <aspxform:XTextBox ID="ProductName" runat="server" XDataBind="ProductName" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" ReadOnly="True"></aspxform:XTextBox>
                        </td>
                        <td class="tds1">
                            <aspxform:XTextBox ID="PONumber" runat="server" XDataBind="PONumber" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" TextAlign="Center" ReadOnly="True" Format="type:number;.0"></aspxform:XTextBox>
                        </td>
                        <td class="tds1">
                            <aspxform:XTextBox ID="DeliverNumber1" runat="server" XDataBind="DeliverNumber1" Express="DeliverNumber" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" TextAlign="Center" Format="type:number;.0"></aspxform:XTextBox>
                            <aspxform:XTextBox ID="DeliverNumber" runat="server" XDataBind="DeliverNumber" HiddenExpress="1" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" TextAlign="Center" Format="type:number;.0"></aspxform:XTextBox>
                        </td>
                        <td class="tds1">
                            <aspxform:XTextBox ID="Plant1" runat="server" XDataBind="Plant1" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" TextAlign="Center" ReadOnly="True" HiddenInput="False"></aspxform:XTextBox>
                            <aspxform:XTextBox ID="Plant" runat="server" XDataBind="Plant" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" ReadOnly="True" HiddenInput="True"></aspxform:XTextBox>
                            <aspxform:XTextBox ID="PlantName" runat="server" XDataBind="PlantName" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" ReadOnly="True" HiddenInput="True"></aspxform:XTextBox>
                        </td>
                        <td class="tds1">
                            <aspxform:XDropDownList ID="StorageName" runat="server" XDataBind="StorageName" Height="25px" Width="100%" DataMap="SAPStorageID->Storage" XDataSource="TableName:DF_Logistics_SAPStorage;Filter:SAPPlant->Plant" ValueColumn="StorageName" DisplayColumn="StorageName"></aspxform:XDropDownList>
                            <aspxform:XTextBox ID="Storage" runat="server" XDataBind="Storage" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" ReadOnly="True" HiddenInput="True"></aspxform:XTextBox>
                            <br />
                        </td>
                        <td class="tds1">
                            <aspxform:XCheckBox ID="confirm" runat="server" XDataBind="confirm"></aspxform:XCheckBox>
                        </td>
                        <td align="center" class="tds1">
                            <aspxform:XTextBox ID="PurchaseContractNo" runat="server" XDataBind="PurchaseContractNo" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" TextAlign="left" ReadOnly="True"></aspxform:XTextBox>
                        </td>
                        <td class="tds1">
                            <aspxform:XTextBox ID="ManufacturerName" runat="server" XDataBind="ManufacturerName" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" ReadOnly="True"></aspxform:XTextBox>
                        </td>
                        <td class="tds1">
                            <aspxform:XTextBox ID="SO" TextAlign="Center" runat="server" XDataBind="SO" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" ReadOnly="True"></aspxform:XTextBox>
                        </td>
                        <td class="tds1">
                            <aspxform:XTextBox ID="SORowNumber" TextAlign="Center" runat="server" XDataBind="SORowNumber" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" ReadOnly="True"></aspxform:XTextBox>
                        </td>
                        <td class="tds1">
                            <aspxform:XTextBox ID="SalesMan" runat="server" TextAlign="Center" XDataBind="SalesMan" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" ReadOnly="True"></aspxform:XTextBox>
                            <aspxform:XTextBox ID="SalesManID" runat="server" XDataBind="SalesManID" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" ReadOnly="True" HiddenExpress="1"></aspxform:XTextBox>
                        </td>
                        <td class="tds1">
                            <aspxform:XTextBox ID="SellerCustomerName" runat="server" XDataBind="SellerCustomerName" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" ReadOnly="True"></aspxform:XTextBox>
                        </td>
                        <td class="tds1">
                            <aspxform:XTextBox ID="SupplierDeliveryDate" TextAlign="Center" runat="server" XDataBind="SupplierDeliveryDate" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" ReadOnly="True"></aspxform:XTextBox>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <br />
        <table width="1200" runat="server" align="center" class="table" id="tableSerial" border="0" cellspacing="0" cellpadding="0" dynamicarea="2,1" menudock="Left" emptygrid="KeepEmpty">
            <tbody>
                <tr>
                    <td height="17" class="title1" style="border-top: medium none" colspan="8">
                        <aspxform:XCustomBrowserButton ID="XCustomBrowserButton1" runat="server" Text="产品批次和序列号" Height="25px" Width="120px" XClass="Oimec.Dialogs.SupplierDeliverBatchSerialButton" DataMap="ProductSAPID->SerialDetail.ProductSAPID;ProductModel->SerialDetail.ProductModel;PO->SerialDetail.PO;PORowNumber->SerialDetail.PORowNumber;Batch->SerialDetail.Batch;SerialParam->SerialDetail.SerialParam;SerialParamDes->SerialDetail.SerialParamDes" AppendMode="ClearAndAppend" UseSubmitBehavior="False" DisabledExpress="Global.StepName!='采购员发起到货申请'"></aspxform:XCustomBrowserButton>
                        &nbsp;
                        <asp:Label ID="Label45" runat="server" Text="（注：若对应产品无批次或无序列号管理，则此列表不显示数据）" ForeColor="Blue" Font-Size="9"></asp:Label></td>
                </tr>
                <tr align="center">
                    <td width="50" height="30" class="tds">
                        <asp:Label ID="Label18" runat="server" Text="序号"></asp:Label></td>
                    <td width="60" class="tds">
                        <asp:Label ID="Label5" runat="server" Text="PO行号"></asp:Label></td>
                    <td width="110" class="tds">
                        <asp:Label ID="Label19" runat="server" Text="产品SAPID"></asp:Label></td>
                    <td width="150" class="tds">
                        <asp:Label ID="Label31" runat="server" Text="产品型号"></asp:Label></td>
                    <td width="80" class="tds">
                        <asp:Label ID="Label28" runat="server" Text="批次"></asp:Label></td>
                    <td width="150" class="tds">
                        <asp:Label ID="Label38" runat="server" Text="序列号"></asp:Label></td>
                    <td width="150" class="tds">
                        <asp:Label ID="Label40" runat="server" Text="序列号参数"></asp:Label></td>
                </tr>
                <tr align="center">
                    <td class="tds1">
                        <aspxform:XGridLineNo ID="XGridLineNo2" runat="server" XDataBind="SerialDetail.LineNunber" Height="100%" Width="100%" BorderWidth="1" TextAlign="Center" BorderStyle="None">1</aspxform:XGridLineNo>
                    </td>
                    <td class="tds1">
                        <aspxform:XTextBox ID="XTextBox12" name="SerialDetailPORowNumber" runat="server" XDataBind="SerialDetail.PORowNumber" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" TextAlign="Center" ReadOnly="True"></aspxform:XTextBox>
                        <aspxform:XTextBox ID="XTextBox29" runat="server" XDataBind="SerialDetail.PO" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" DisableBehavior="ReadOnly" BackColor="#D4E4FE" ReadOnly="True" HiddenExpress="1"></aspxform:XTextBox>
                    </td>
                    <td class="tds1">
                        <aspxform:XTextBox ID="XTextBox11" runat="server" XDataBind="SerialDetail.ProductSAPID" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" DisableBehavior="ReadOnly" BackColor="#e9f1f4" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                    <td class="tds1">
                        <aspxform:XTextBox ID="XTextBox28" runat="server" XDataBind="SerialDetail.ProductModel" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" DisableBehavior="ReadOnly" BackColor="#e9f1f4" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                    <td class="tds1">
                        <aspxform:XTextBox ID="XTextBox18" runat="server" XDataBind="SerialDetail.Batch1" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" TextAlign="Center" DisableExpress="SerialDetail.Batch==''" Express="SerialDetail.Batch"></aspxform:XTextBox>
                        <aspxform:XTextBox ID="XTextBox1" runat="server" XDataBind="SerialDetail.Batch" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" TextAlign="Center" HiddenInput="true"></aspxform:XTextBox>
                    </td>
                    <td class="tds1">
                        <aspxform:XTextBox ID="SerialNo" name="SerialNo" runat="server" XDataBind="SerialDetail.SerialNo" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" DisableExpress="SerialDetail.SerialParam==''||SerialDetail.SerialParam=='Z002'" OnChange="Serial_OnChange(this)"></aspxform:XTextBox>
                    </td>
                    <td class="tds1">
                        <aspxform:XTextBox ID="XTextBox43" runat="server" XDataBind="SerialDetail.SerialParamDes" Height="100%" Width="100%" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" TextAlign="Center" ReadOnly="True"></aspxform:XTextBox>
                        <aspxform:XTextBox ID="XTextBox32" runat="server" XDataBind="SerialDetail.SerialParam" Width="20px" BorderColor="#DCDCDC" BorderWidth="1" BackColor="#e9f1f4" TextAlign="Center" ReadOnly="True" HiddenExpress="1"></aspxform:XTextBox>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table class="table" style="width: 1200px">
            <tbody>
                <tr>
                    <td class="title1">备注</td>
                </tr>
                <tr>
                    <td class="tsbottomtext">
                        <aspxform:XTextBox ID="remark" runat="server" Width="100%" TextMode="MultiLine" Rows="3"></aspxform:XTextBox>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <div>
            &nbsp;<aspxform:XButton ID="submit" Style="height: 30px; width: 100px" runat="server" Text="收货过账" DisableExpress='javascript("ShowSubmit",SAPPO)' OnClientClick="submit_SHGZ();"></aspxform:XButton>
        </div>
    </form>
</body>
</html>
