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

    // Insert page code here
    //

</script>
<html xmlns:xform="xmlns:xform">
<head runat="server">
    <link href="/Oimec/Styles/css/StyleSheet.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
    <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;
        }

        .yz-inp-cnt {
            display: inline;
        }
    </style>
    <script>
        // 数字转换成大写金额函数
        function atoc(numberValue) {
            var numberValue = new String(Math.round(numberValue * 100)); // 数字金额
            var chineseValue = ""; // 转换后的汉字金额
            var String1 = "零壹贰叁肆伍陆柒捌玖"; // 汉字数字
            var String2 = "万仟佰拾亿仟佰拾万仟佰拾元角分"; // 对应单位
            var len = numberValue.length; // numberValue 的字符串长度
            var Ch1; // 数字的汉语读法
            var Ch2; // 数字位的汉字读法
            var nZero = 0; // 用来计算连续的零值的个数
            var String3; // 指定位置的数值
            if (len > 15) {
                alert("超出计算范围");
                return "";
            }
            if (numberValue == 0) {
                chineseValue = "零元整";
                return chineseValue;
            }

            String2 = String2.substr(String2.length - len, len); // 取出对应位数的STRING2的值
            for (var i = 0; i < len; i++) {
                String3 = parseInt(numberValue.substr(i, 1), 10); // 取出需转换的某一位的值
                if (i != (len - 3) && i != (len - 7) && i != (len - 11) && i != (len - 15)) {
                    if (String3 == 0) {
                        Ch1 = "";
                        Ch2 = "";
                        nZero = nZero + 1;
                    }
                    else if (String3 != 0 && nZero != 0) {
                        Ch1 = "零" + String1.substr(String3, 1);
                        Ch2 = String2.substr(i, 1);
                        nZero = 0;
                    }
                    else {
                        Ch1 = String1.substr(String3, 1);
                        Ch2 = String2.substr(i, 1);
                        nZero = 0;
                    }
                }
                else { // 该位是万亿，亿，万，元位等关键位
                    if (String3 != 0 && nZero != 0) {
                        Ch1 = "零" + String1.substr(String3, 1);
                        Ch2 = String2.substr(i, 1);
                        nZero = 0;
                    }
                    else if (String3 != 0 && nZero == 0) {
                        Ch1 = String1.substr(String3, 1);
                        Ch2 = String2.substr(i, 1);
                        nZero = 0;
                    }
                    else if (String3 == 0 && nZero >= 3) {
                        Ch1 = "";
                        Ch2 = "";
                        nZero = nZero + 1;
                    }
                    else {
                        Ch1 = "";
                        Ch2 = String2.substr(i, 1);
                        nZero = nZero + 1;
                    }
                    if (i == (len - 11) || i == (len - 3)) { // 如果该位是亿位或元位，则必须写上
                        Ch2 = String2.substr(i, 1);
                    }
                }
                chineseValue = chineseValue + Ch1 + Ch2;
            }

            if (String3 == 0) { // 最后一位（分）为0时，加上“整”
                chineseValue = chineseValue + "整";
            }

            return chineseValue;
        }


        function aa() {
            var a = agent.Eles[document.getElementById("XTextBox27").getAttribute("xform_xele_index")];
            var temp = a.getValue();
            window.open("Print.aspx?serialNum=" + temp);
        }

        function getDate(dateTime, type) {
            if (dateTime != "" && dateTime != undefined) {

                var arr1 = dateTime.split(" ");
                var sdate = arr1[0].split('-');
                if (type == "year")
                    return sdate[0];
                if (type == "month")
                    return sdate[1];
            }
            else {
                var date = new Date();
                if (type == "year")
                    return date.getFullYear();
                if (type == "month")
                    return date.getMonth() + 1;
            }

        }

    </script>
    <script type="text/javascript">
        function GETBALANCE(cpyCode, CostCenterAccount, Subject, erArea) {
            if (cpyCode != "") {
                YZSoft.Ajax.request({
                    url: YZSoft.$url('Oimec/ApiServices/OAAPIHandler.ashx'),
                    method: 'POST',
                    params: { method: 'GetAvailableCost', cpyCode: cpyCode, CostCenterAccount: CostCenterAccount, Subject: Subject, erArea: erArea },
                    success: function (action) {
                        var result = action.result;
                        agent.Eles[document.getElementById("XTextBox22").getAttribute("xform_xele_index")].setValue(action.result.Value);
                    }
                });
            }
        }

        Ext.onReady(function () {

            var stepName = agent.Eles[document.getElementById("XTextBox39").getAttribute("xform_xele_index")].getValue();
            //重新获取可用费用
            if (stepName == "提交人直接主管审批" || stepName == "成本中心负责人审批") {
                //成本中心公司、成本中心账号、费用科目、业务范围
                var cpyCode = agent.Eles[document.getElementById("XTextBox25").getAttribute("xform_xele_index")].getValue();
                var CostCenterAccount = agent.Eles[document.getElementById("XTextBox3").getAttribute("xform_xele_index")].getValue();
                var Subject = agent.Eles[document.getElementById("XTextBox7").getAttribute("xform_xele_index")].getValue();
                var erArea = agent.Eles[document.getElementById("XTextBox23").getAttribute("xform_xele_index")].getValue();

                YZSoft.Ajax.request({
                    url: YZSoft.$url('Oimec/ApiServices/OAAPIHandler.ashx'),
                    method: 'POST',
                    params: {
                        method: 'GetAvailableCost',
                        cpyCode: cpyCode,
                        CostCenterAccount: CostCenterAccount,
                        Subject: Subject,
                        erArea: erArea
                    },
                    success: function (action) {
                        var result = action.result;
                        //alert(action.result.Value);
                        agent.Eles[document.getElementById("XTextBox22").getAttribute("xform_xele_index")].setValue(action.result.Value);
                    }
                });
            }


            var a17 = agent.Eles[document.getElementById("XTextBox17").getAttribute("xform_xele_index")].getValue();
            var a34 = agent.Eles[document.getElementById("XTextBox34").getAttribute("xform_xele_index")].getValue();
            var a39 = agent.Eles[document.getElementById("XTextBox39").getAttribute("xform_xele_index")].getValue();
            if (a17 != userToken.Account) {
                document.getElementById('XTextBox22').style.visibility = "hidden";
            }
            //if (userToken.Account == document.getElementById('XTextBox34').value && document.getElementById('XTextBox39').value == "提交人直接主管审批") {
            if (userToken.Account == agent.Eles[document.getElementById("XTextBox34").getAttribute("xform_xele_index")].getValue() && agent.Eles[document.getElementById("XTextBox39").getAttribute("xform_xele_index")].getValue() == "提交人直接主管审批") {
                document.getElementById('XTextBox22').style.visibility = "visible";
            }
            //else {
            //    document.getElementById('XTextBox22').style.visibility = "hidden";
            //}
        });

        //提交时，将电子发票附件上传到AliOss
        agent.on('beforeSubmit', function (post, acname) {
            var stepName = agent.Eles[document.getElementById("XTextBox39").getAttribute("xform_xele_index")].getValue();

            if ((stepName == "成本中心负责人审批" || stepName == "提交人直接主管审批") && acname == "同意") {

                //发票介质 InvoiceType
                var InvoiceType = checkedVaule("InvoiceType");
                if (InvoiceType == "全部电子发票" || InvoiceType == "部分电子发票") {
                    var formNo = agent.Eles[document.getElementById("XLabel3").getAttribute("xform_xele_index")].getValue();
                    var taskID = agent.Eles[document.getElementById("TaskID").getAttribute("xform_xele_index")].getValue();
                    //获取明细电子发票附件
                    var tableid = "tablenew";
                    var tableObj = document.getElementById(tableid);
                    var EInvoiceAttachment = "";
                    for (var i = 2; i < tableObj.rows.length; i++) {
                        var str = agent.Eles[tableObj.rows[i].cells[2].children[0].getAttribute("xform_xele_index")].getValue();
                        if (str != "") {
                            if (EInvoiceAttachment == "")
                                EInvoiceAttachment = str;
                            else
                                EInvoiceAttachment = EInvoiceAttachment + ";" + str;
                        }
                    }
                    if (EInvoiceAttachment != "")
                        UpEInvoiceAttachment(EInvoiceAttachment, formNo, taskID);
                }
            }


        });

        //上传电子发票附件
        function UpEInvoiceAttachment(EInvoiceAttachment, formNo, taskID) {
            if (EInvoiceAttachment != null && EInvoiceAttachment != "") {
                YZSoft.Ajax.request({
                    url: YZSoft.$url('Oimec/ApiServices/AliOssAPIHandler.ashx'),
                    method: 'POST',
                    params: {
                        method: 'UpAliOss',
                        formNo: formNo,
                        taskID: taskID,
                        fileid: EInvoiceAttachment,
                        type: "EInvoice"
                    },
                    success: function (action) {
                        //var result = action.result;
                        //alert(action.result.Value);

                    }
                });

            }
        }

        //单选获取选中的值
        function checkedVaule(name) {
            var obj = document.getElementsByName(name);
            for (var i = 0; i < obj.length; i++) {
                if (obj[i].checked) {
                    return obj[i].value;
                }
            }
        };
    </script>
</head>
<body>
    <form runat="server">
        <!-- Insert content here -->
        <table width="1200" align="center" class="head" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td class="logo">
                    </td>
                    <td width="1000" class="biaoti">
                        <asp:Label id="XLabel1" runat="server" value valuetodisplaytext text="个人车辆使用费报销单"></asp:Label>
                        <aspxform:XTextBox id="XTextBox27" runat="server" Express="DF_ER_HeadTable.SerialNum" Width="100px" BorderWidth="1" BorderColor="#DCDCDC" HiddenExpress="1"></aspxform:XTextBox>
                    </td>
                    <td width="400" class="formno">
                        <aspxform:XButton id="XButton2" runat="server" Width="60px" OnClientClick="aa()" Text="打 印"></aspxform:XButton>
                        <asp:Label id="XLabel2" runat="server" value valuetodisplaytext text="表单号："></asp:Label>
                        <aspxform:XLabel id="XLabel3" runat="server" Text="--系统自动生成--" BackColor="#8AB3DF" XDataBind="DF_ER_HeadTable.SerialNum" Value ValueToDisplayText></aspxform:XLabel>
                        <aspxform:XTextBox id="TaskID" runat="server" Width="100px" BorderWidth="1" BorderColor="#DCDCDC" HiddenExpress="1" XDataBind="DF_ER_HeadTable.TaskID"></aspxform:XTextBox>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" align="center" class="table" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td class="title1" colspan="4">
                        <asp:Label id="XLabel4" runat="server" value valuetodisplaytext text="个人信息"></asp:Label></td>
                </tr>
                <tr>
                    <td class="ts" style="WIDTH: 10%">
                        <asp:Label id="XLabel5" runat="server" value valuetodisplaytext text="姓名"></asp:Label>
                        <aspxform:XTextBox id="XTextBox12" style="DISPLAY: none" runat="server" Width="10px" BorderWidth="1" BorderColor="#DCDCDC" XDataBind="DF_ER_HeadTable.EstablishUserAccount" ValueToDisplayText="TableName:V_DF_HR_BasicInfo;FilterColumn:AttendanceKakaNO;DisplayColumn:AttendanceKakaNO" DataMap="Name->DF_ER_HeadTable.EstablishUser;Department->DF_ER_HeadTable.EstablishDpt;Region->DF_ER_HeadTable.Region;MobilePhone->DF_ER_HeadTable.Mobile;AttendanceKakaNO->DF_ER_HeadTable.BPMAccount;BUName->DF_ER_HeadTable.BU"></aspxform:XTextBox>
                    </td>
                    <td class="ts1" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox2" style="WIDTH: 70%" runat="server" BorderWidth="1" BorderColor="#DCDCDC" DisableBehavior="ReadOnly" XDataBind="DF_ER_HeadTable.EstablishUser" ValueToDisplayText Enabled="False"></aspxform:XTextBox>
                    </td>
                    <td class="ts" style="WIDTH: 10%">
                        <asp:Label id="XLabel6" runat="server" value valuetodisplaytext text="部门"></asp:Label></td>
                    <td class="ts1" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox1" style="WIDTH: 70%" runat="server" BorderWidth="1" BorderColor="#DCDCDC" DisableBehavior="ReadOnly" XDataBind="DF_ER_HeadTable.EstablishDpt" ValueToDisplayText Enabled="False"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="XLabel24" runat="server" value valuetodisplaytext text="BU"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox18" style="WIDTH: 70%" runat="server" BorderWidth="1" BorderColor="#DCDCDC" DisableBehavior="ReadOnly" XDataBind="DF_ER_HeadTable.BU" Enabled="False"></aspxform:XTextBox>
                    </td>
                    <td class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="XLabel25" runat="server" value valuetodisplaytext text="地区"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox11" style="WIDTH: 70%" runat="server" BorderWidth="1" BorderColor="#DCDCDC" XDataBind="DF_ER_HeadTable.Region" Enabled="False"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="XLabel29" runat="server" value valuetodisplaytext text="BPM账号"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox19" style="WIDTH: 70%" runat="server" BorderWidth="1" BorderColor="#DCDCDC" XDataBind="DF_ER_HeadTable.BPMAccount" Enabled="False"></aspxform:XTextBox>
                    </td>
                    <td class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="XLabel30" runat="server" value valuetodisplaytext text="联系电话"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox20" style="WIDTH: 70%" runat="server" BorderWidth="1" BorderColor="#DCDCDC" XDataBind="DF_ER_HeadTable.Mobile" DisableExpress="1"></aspxform:XTextBox>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" height="144" align="center" class="table" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td class="title1" colspan="6">
                        <asp:Label id="XLabel7" runat="server" value valuetodisplaytext text="报销信息"></asp:Label>
                        <aspxform:XDataBrowserButton id="XDataBrowserButton1" runat="server" Width="133px" HiddenExpress="Global.StepName!='开始'" Text="选择成本中心" DataMap="CostCenter->DF_ER_HeadTable.CostCenterAccount;CostCenterName->DF_ER_HeadTable.CostCenter;CostCenterCharge->DF_ER_HeadTable.CostCenterCharge;ChargeID->DF_ER_HeadTable.ChargeID;CostCenterCompanyName->DF_ER_HeadTable.Company;erArea->DF_ER_HeadTable.erArea;cpyCode->DF_ER_HeadTable.cpyCode;DepositAccount->DF_ER_HeadTable.DepositAccount" DisplayColumns="CostCenter:成本中心编号;CostCenterName:成本中心名称" PopupWndWidth="-1" PopupWndHeight="-1" XDataSource='TableName:DF_ER_CostCenter;Filter:DeleteMark->"0"' UseSubmitBehavior="False"></aspxform:XDataBrowserButton>
                        <aspxform:XTextBox id="XTextBox26" runat="server" Width="20px" BorderWidth="1" BorderColor="#DCDCDC" HiddenExpress="1" XDataBind="DF_ER_HeadTable.DepositAccount"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="ts" style="WIDTH: 10%">
                        <asp:Label id="XLabel8" runat="server" value valuetodisplaytext text="*" forecolor="Red"></asp:Label>&nbsp;<asp:Label id="XLabel9" runat="server" value valuetodisplaytext text="成本中心"></asp:Label></td>
                    <td class="ts1" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox3" style="WIDTH: 70%" runat="server" BorderWidth="1" BorderColor="#DCDCDC" DisableBehavior="ReadOnly" XDataBind="DF_ER_HeadTable.CostCenterAccount" Enabled="False"></aspxform:XTextBox>
                    </td>
                    <td class="ts" style="WIDTH: 10%">
                        <asp:Label id="XLabel10" runat="server" value valuetodisplaytext text="成本中心名称"></asp:Label></td>
                    <td class="ts1" style="WIDTH: 35%" colspan="3">
                        <aspxform:XTextBox id="XTextBox4" style="WIDTH: 70%" runat="server" BorderWidth="1" BorderColor="#DCDCDC" DisableBehavior="ReadOnly" XDataBind="DF_ER_HeadTable.CostCenter" Enabled="False"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="ts" style="WIDTH: 10%">
                        <asp:Label id="XLabel11" runat="server" value valuetodisplaytext text="成本中心负责人"></asp:Label>
                        <aspxform:XTextBox id="XTextBox17" runat="server" Width="24px" BorderWidth="1px" BorderColor="Gainsboro" HiddenExpress="1" Max="0" Min="0" XDataBind="DF_ER_HeadTable.ChargeID" Value ValueToDisplayText HiddenInput="False"></aspxform:XTextBox>
                    </td>
                    <td class="ts1" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox5" style="WIDTH: 70%" runat="server" BorderWidth="1" BorderColor="#DCDCDC" DisableBehavior="ReadOnly" XDataBind="DF_ER_HeadTable.CostCenterCharge" Enabled="False"></aspxform:XTextBox>
                        <aspxform:XTextBox id="XTextBox34" runat="server" Width="20px" BorderWidth="1" BorderColor="#DCDCDC" HiddenExpress="1" XDataBind="OwnerAccount"></aspxform:XTextBox>
                        <aspxform:XDropDownList id="XDropDownList7" runat="server" Width="20px" HiddenExpress="1" DataMap="OwnerAccount->OwnerAccount" XDataSource="TableName:V_DF_ER_HigherApproval;Filter:SerialNum->DF_ER_HeadTable.SerialNum,NodeName->NodeName;BufferType:RuntimeUpdate" DisplayColumn="OwnerAccount" ValueColumn="OwnerAccount">
                            <asp:ListItem>未绑定</asp:ListItem>
                        </aspxform:XDropDownList>
                        <aspxform:XTextBox id="XTextBox39" runat="server" Express="Global.StepName" Width="20px" BorderWidth="1" BorderColor="#DCDCDC" HiddenExpress="1" XDataBind="NodeName"></aspxform:XTextBox>
                    </td>
                    <td class="ts" style="WIDTH: 10%">
                        <asp:Label id="XLabel12" runat="server" value valuetodisplaytext text="成本中心公司"></asp:Label></td>
                    <td class="ts1" style="WIDTH: 35%" colspan="3">
                        <aspxform:XTextBox id="XTextBox6" style="WIDTH: 70%" runat="server" BorderWidth="1" BorderColor="#DCDCDC" DisableBehavior="ReadOnly" XDataBind="DF_ER_HeadTable.Company" Enabled="False"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td height="19" class="ts" style="WIDTH: 10%">
                        <asp:Label id="XLabel33" runat="server" value valuetodisplaytext text="可用费用"></asp:Label></td>
                    <td class="ts1" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox22" style="WIDTH: 70%" runat="server" Express="javascript('GETBALANCE',DF_ER_HeadTable.cpyCode,DF_ER_HeadTable.CostCenterAccount,DF_ER_HeadTable.Subject,DF_ER_HeadTable.erArea)" BorderWidth="1" BorderColor="#DCDCDC" XDataBind="DF_ER_HeadTable.AvailableCost" Enabled="False" DisableExpress="1" HiddenInput="False"></aspxform:XTextBox>
                    </td>
                    <td class="ts" style="WIDTH: 10%">
                        <asp:Label id="XLabel35" runat="server" value valuetodisplaytext text="业务范围"></asp:Label></td>
                    <td class="ts1" style="WIDTH: 35%" colspan="3">
                        <aspxform:XTextBox id="XTextBox23" style="WIDTH: 70%" runat="server" BorderWidth="1" BorderColor="#DCDCDC" DisableBehavior="ReadOnly" XDataBind="DF_ER_HeadTable.erArea" Enabled="False"></aspxform:XTextBox>
                        <aspxform:XTextBox id="XTextBox25" runat="server" Width="51px" BorderWidth="1px" BorderColor="Gainsboro" HiddenExpress="1" Max="0" Min="0" XDataBind="DF_ER_HeadTable.cpyCode" Value ValueToDisplayText HiddenInput="False"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="ts" style="WIDTH: 10%">
                        <asp:Label id="XLabel34" runat="server" value valuetodisplaytext text="会计凭证号"></asp:Label></td>
                    <td class="ts1" style="WIDTH: 35%">
                        <aspxform:XTextBox id="XTextBox24" style="WIDTH: 70%" runat="server" BorderWidth="1" BorderColor="#DCDCDC" DisableBehavior="ReadOnly" XDataBind="DF_ER_HeadTable.voucherCode" Enabled="False"></aspxform:XTextBox>
                    </td>
                    <td class="ts" style="WIDTH: 10%">
                        <asp:Label id="XLabel37" runat="server" value valuetodisplaytext text="*" forecolor="Red"></asp:Label>&nbsp;<asp:Label id="XLabel36" runat="server" value valuetodisplaytext text="发票张数"></asp:Label></td>
                    <td class="ts1" style="WIDTH: 10%">
                        <aspxform:XTextBox id="XTextBox36" style="WIDTH: 70%" runat="server" BorderWidth="1" BorderColor="#DCDCDC" DisableBehavior="ReadOnly" XDataBind="DF_ER_HeadTable.invoiceCount" ValidationGroup="a"></aspxform:XTextBox>
                    </td>
                    <td class="ts" style="WIDTH: 10%">
                        <asp:Label id="XLabel42" runat="server" value valuetodisplaytext text="*" forecolor="Red"></asp:Label>&nbsp;其中电子发票张数</td>
                    <td class="ts1" style="WIDTH: 15%">
                        <aspxform:XTextBox id="XTextBox40" style="WIDTH: 70%" runat="server" BorderWidth="1" BorderColor="#DCDCDC" DisableBehavior="ReadOnly" XDataBind="DF_ER_HeadTable.EInvoiceCount" ValidationGroup="a"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td height="13" class="ts">
                        <asp:Label id="XLabel13" runat="server" value valuetodisplaytext text="币种"></asp:Label></td>
                    <td class="ts1">
                        <aspxform:XTextBox id="XTextBox8" style="WIDTH: 70%" runat="server" BorderWidth="1" BorderColor="#DCDCDC" DisableBehavior="ReadOnly" XDataBind="DF_ER_HeadTable.Currency" Enabled="False">人民币</aspxform:XTextBox>
                    </td>
                    <td class="ts">
                        <asp:Label id="XLabel22" runat="server" value valuetodisplaytext text="费用科目"></asp:Label></td>
                    <td class="ts1" colspan="3">
                        <aspxform:XTextBox id="XTextBox7" style="WIDTH: 70%" runat="server" BorderWidth="1" BorderColor="#DCDCDC" DisableBehavior="ReadOnly" XDataBind="DF_ER_HeadTable.Subject" Enabled="False"></aspxform:XTextBox>
                        <aspxform:XDropDownList id="XDropDownList6" runat="server" Width="25px" HiddenExpress="1" DataMap="subName->DF_ER_HeadTable.Subject" XDataSource="ProcedureName:DF_Proc_GetSubject;Filter:@type->type" DisplayColumn="subName" ValueColumn="subName">
                            <asp:ListItem>未绑定</asp:ListItem>
                        </aspxform:XDropDownList>
                        <aspxform:XTextBox id="XTextBox21" runat="server" Width="26px" BorderWidth="1px" BorderColor="Gainsboro" HiddenExpress="1" Max="0" Min="0" XDataBind="type" Value ValueToDisplayText HiddenInput="False">交通费</aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="ts">
                        <asp:Label id="XLabel14" runat="server" value valuetodisplaytext text="*" forecolor="Red"></asp:Label>&nbsp;<asp:Label id="XLabel15" runat="server" value valuetodisplaytext text="报销合计"></asp:Label></td>
                    <td class="ts1">
                        <aspxform:XTextBox id="XTextBox9" style="WIDTH: 70%" runat="server" Express="sum(DF_ER_CarItems.VehicleFees)+sum(DF_ER_CarItems.OtherExpenses)" BorderWidth="1" BorderColor="#DCDCDC" DisableBehavior="ReadOnly" XDataBind="DF_ER_HeadTable.ReimbursementTotal" Enabled="False" Format="type:currency;.2" TextAlign="Right"></aspxform:XTextBox>
                    </td>
                    <td class="ts">
                        <asp:Label id="XLabel16" runat="server" value valuetodisplaytext text="大写"></asp:Label></td>
                    <td class="ts1" colspan="3">
                        <aspxform:XTextBox id="XTextBox10" runat="server" Express="javascript('atoc',DF_ER_HeadTable.ReimbursementTotal)" Width="100%" BorderWidth="1" BorderColor="#DCDCDC" DisableBehavior="ReadOnly" XDataBind="DF_ER_HeadTable.ReimbursementTotalCapital" Enabled="False"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td height="36" class="ts">
                        <asp:Label id="XLabel17" runat="server" value valuetodisplaytext text="领款人"></asp:Label>
                        <aspxform:XDropDownList id="XDropDownList2" runat="server" HiddenExpress="1" DataMap="Department->DF_ER_HeadTable.PayeeDept" XDataSource="TableName:V_DF_HR_BasicInfo;Filter:AttendanceKakaNO->DF_ER_HeadTable.Payee" DisplayColumn="Name" ValueColumn="Name">
                            <asp:ListItem>未绑定</asp:ListItem>
                        </aspxform:XDropDownList>
                    </td>
                    <td class="ts1">
                        <aspxform:XTextBox id="XTextBox13" style="WIDTH: 70%" runat="server" BorderWidth="1px" BorderColor="Gainsboro" Max="0" Min="0" DisableBehavior="ReadOnly" XDataBind="DF_ER_HeadTable.Payee" Value ValueToDisplayText="TableName:V_DF_HR_BasicInfo;FilterColumn:AttendanceKakaNO;DisplayColumn:Name" Enabled="False" HiddenInput="False"></aspxform:XTextBox>
                        <aspxform:XDataBrowserButton id="XDataBrowserButton2" runat="server" Width="21px" DataMap="Department->DF_ER_HeadTable.PayeeDept;AttendanceKakaNO->DF_ER_HeadTable.Payee" DisplayColumns="Name:姓名,;Department:部门," XDataSource="TableName:V_DF_HR_BasicInfo"></aspxform:XDataBrowserButton>
                    </td>
                    <td class="ts">
                        <asp:Label id="XLabel18" runat="server" value valuetodisplaytext text="领款人部门"></asp:Label></td>
                    <td class="ts1" colspan="3">
                        <aspxform:XTextBox id="XTextBox14" style="WIDTH: 70%" runat="server" BorderWidth="1" BorderColor="#DCDCDC" DisableBehavior="ReadOnly" XDataBind="DF_ER_HeadTable.PayeeDept" Enabled="False"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="XLabel19" runat="server" value valuetodisplaytext text="*" forecolor="Red"></asp:Label>&nbsp;<asp:Label id="XLabel20" runat="server" value valuetodisplaytext text="是否冲销借款"></asp:Label></td>
                    <td class="tsbottomtext" style="WIDTH: 35%">
                        <aspxform:XRadioButtonList id="XRadioButtonList1" runat="server" XDataBind="DF_ER_HeadTable.IsLoan" RepeatDirection="Horizontal">
                            <asp:ListItem>是</asp:ListItem>
                            <asp:ListItem Selected="True">否</asp:ListItem>
                        </aspxform:XRadioButtonList>
                    </td>
                    <td class="tsbottomlabel" style="WIDTH: 10%">
                        <asp:Label id="XLabel21" runat="server" value valuetodisplaytext text="借款金额"></asp:Label>
                        <aspxform:XDropDownList id="XDropDownList1" style="DISPLAY: none" runat="server" DataMap="Arrears->DF_ER_HeadTable.LoanAmount" XDataSource="ProcedureName:DF_PROC_Arrears;Filter:@bpmAccount->DF_ER_HeadTable.Payee" DisplayColumn="Arrears" ValueColumn="Arrears">
                            <asp:ListItem>未绑定</asp:ListItem>
                        </aspxform:XDropDownList>
                    </td>
                    <td class="tsbottomtext" style="WIDTH: 35%" colspan="3">
                        <aspxform:XTextBox id="XTextBox16" style="WIDTH: 70%" runat="server" BorderWidth="1" BorderColor="#DCDCDC" DisableBehavior="ReadOnly" XDataBind="DF_ER_HeadTable.LoanAmount" Enabled="False" Format="type:currency;.2" TextAlign="Right"></aspxform:XTextBox>
                    </td>
                </tr>
                <tr>
                    <td class="tsbottomlabel">
                        <asp:Label id="Label11" runat="server" value valuetodisplaytext text="*" forecolor="Red"></asp:Label>&nbsp;发票介质</td>
                    <td class="tsbottomtext">
                        <aspxform:XRadioButtonList id="InvoiceType" runat="server" XDataBind="DF_ER_HeadTable.InvoiceType" DisableExpress='Global.StepName!="开始"' RepeatDirection="Horizontal">
                            <asp:ListItem>全部电子发票</asp:ListItem>
                            <asp:ListItem>部分电子发票</asp:ListItem>
                            <asp:ListItem>全部纸质发票</asp:ListItem>
                        </aspxform:XRadioButtonList>
                    </td>
                    <td class="tsbottomlabel">
                    </td>
                    <td class="tsbottomtext" colspan="3">
                    </td>
                </tr>
            </tbody>
        </table>
        <aspxform:XRequiredFieldValidator id="报销合计为零时不能提交" runat="server" ValidationGroup="a" Display="None" ErrorMessage="报销合计为零时不能提交" ControlToValidate="XTextBox9"></aspxform:XRequiredFieldValidator>
        <aspxform:XRequiredFieldValidator id="成本中心公司信息不完整" runat="server" ValidationGroup="a" Display="None" ErrorMessage="成本中心公司信息不完整" ControlToValidate="XTextBox6"></aspxform:XRequiredFieldValidator>
        <aspxform:XRequiredFieldValidator id="成本中心负责人信息不完整" runat="server" ValidationGroup="a" Display="None" ErrorMessage="成本中心负责人信息不完整" ControlToValidate="XTextBox5"></aspxform:XRequiredFieldValidator>
        <aspxform:XRequiredFieldValidator id="成本中心负责人帐号不完整" runat="server" ValidationGroup="a" Display="None" ErrorMessage="成本中心负责人帐号不完整" ControlToValidate="XTextBox17"></aspxform:XRequiredFieldValidator>
        <aspxform:XRequiredFieldValidator id="成本中心非空" runat="server" ValidationGroup="a" Display="None" ErrorMessage="请选择成本中心" ControlToValidate="XTextBox3"></aspxform:XRequiredFieldValidator>
        <aspxform:XRequiredFieldValidator id="请填写发票张数" runat="server" ValidationGroup="a" Display="None" ErrorMessage="请填写发票张数" ControlToValidate="XTextBox36"></aspxform:XRequiredFieldValidator>
        <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator1" runat="server" ValidationGroup="a" Display="None" ErrorMessage="请填写电子发票张数" ControlToValidate="XTextBox40">请填写电子发票张数</aspxform:XRequiredFieldValidator>
        &nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator3" runat="server" ValidationGroup="a" Display="None" ErrorMessage="请选择发票介质" ControlToValidate="InvoiceType">请选择发票种类</aspxform:XRequiredFieldValidator>
        <aspxform:XCompareValidator id="报销合计大于可用费用不能提交" runat="server" ValidationGroup="a" Display="None" ErrorMessage="报销合计大于可用费用不能提交" ControlToValidate="XTextBox9" Type="Double" ControlToCompare="XTextBox22" Operator="LessThanEqual"></aspxform:XCompareValidator>
        <aspxform:XCompareValidator id="XCompareValidator1" runat="server" ValidationGroup="b" ErrorMessage="报销合计大于可用费用不能提交" ControlToValidate="XTextBox9" Type="Double" ControlToCompare="XTextBox22" Operator="LessThanEqual"></aspxform:XCompareValidator>
        <br />
        <table width="1200" align="center" class="table" id="tabqutdetail" border="0" cellspacing="0" cellpadding="3" dynamicarea="2,1" menudock="Left">
            <tbody>
                <tr>
                    <td height="21" class="title1" colspan="8">
                        <asp:Label id="XLabel32" runat="server" value valuetodisplaytext text="车辆使用明细"></asp:Label></td>
                </tr>
                <tr>
                    <td width="45" height="25" class="tds">
                        <p align="center">
                            <asp:Label id="XLabel28" runat="server" text="序号"></asp:Label>
                        </p>
                    </td>
                    <td width="120" align="center" class="tds">
                        <asp:Label id="Label3" runat="server" value valuetodisplaytext text="日期"></asp:Label></td>
                    <td width="218" class="tds">
                        <asp:Label id="XLabel60" runat="server" value valuetodisplaytext text="车辆使用目的"></asp:Label></td>
                    <td width="262" class="tds">
                        <asp:Label id="XLabel61" runat="server" value valuetodisplaytext text="路途说明"></asp:Label></td>
                    <td width="126" class="tds">
                        <p align="right">
                            <aspxform:XDropDownList id="XDropDownList4" runat="server" HiddenExpress="1" XDataBind="varPrice" DisableExpress="DF_ER_CarItems.Year=='' || DF_ER_CarItems.Month==''" XDataSource="ProcedureName:DF_PROC_PricePerKm;Filter:@Year->DF_ER_CarItems.Year,@Month->DF_ER_CarItems.Month" DisplayColumn="ParaValues" ValueColumn="ParaValues" Font-Bold="True">
                                <asp:ListItem Selected="True">未绑定</asp:ListItem>
                            </aspxform:XDropDownList>
                            <asp:Label id="XLabel64" runat="server" value valuetodisplaytext text="里程数（km）"></asp:Label>
                        </p>
                    </td>
                    <td width="100" class="tds">
                        <p align="right">
                            <asp:Label id="XLabel68" runat="server" value valuetodisplaytext text="车辆使用费（元）"></asp:Label>
                        </p>
                    </td>
                    <td width="100" align="right" class="tds">
                        <asp:Label id="Label4" runat="server" value valuetodisplaytext text="其他费用（元）"></asp:Label></td>
                    <td width="253" align="center" class="tds">
                        <asp:Label id="Label5" runat="server" value valuetodisplaytext text="其他费用说明"></asp:Label></td>
                </tr>
                <tr>
                    <td height="29" class="xjtds1" style="TEXT-ALIGN: center">
                        <aspxform:XGridLineNo id="XGridLineNo1" runat="server" Width="100%" BorderWidth="1" BorderColor="#DCDCDC" BackColor="Transparent" XDataBind="DF_QUTATION_DETAIL.LineNumber" TextAlign="Center" BorderStyle="None">1</aspxform:XGridLineNo>
                    </td>
                    <td class="xjtds1" style="TEXT-ALIGN: center">
                        <aspxform:XDateTimePicker id="XDateTimePicker1" runat="server" Width="100%" BorderWidth="1" BorderColor="#DCDCDC" XDataBind="DF_ER_CarItems.DateTime" Height="30px"></aspxform:XDateTimePicker>
                        <aspxform:XTextBox id="XTextBox30" runat="server" Express="javascript('getDate',DF_ER_CarItems.DateTime,&quot;year&quot;)" Width="50%" BorderWidth="1px" BorderColor="Gainsboro" Max="0" Min="0" XDataBind="DF_ER_CarItems.Year" ValueToDisplayText HiddenInput="True"></aspxform:XTextBox>
                        <aspxform:XTextBox id="XTextBox31" runat="server" Express="javascript('getDate',DF_ER_CarItems.DateTime,&quot;month&quot;)" Width="50%" BorderWidth="1" BorderColor="#DCDCDC" XDataBind="DF_ER_CarItems.Month" HiddenInput="True"></aspxform:XTextBox>
                    </td>
                    <td class="xjtds1">
                        <aspxform:XTextBox id="XTextBox43" runat="server" Width="100%" XDataBind="DF_ER_CarItems.Purpose" Height="30px"></aspxform:XTextBox>
                    </td>
                    <td class="xjtds1">
                        <aspxform:XTextBox id="XTextBox44" runat="server" Width="100%" XDataBind="DF_ER_CarItems.Remark" Height="30px"></aspxform:XTextBox>
                    </td>
                    <td class="xjtds1">
                        <aspxform:XTextBox id="XTextBox47" runat="server" Width="100%" XDataBind="DF_ER_CarItems.Mileage" Format="type:number;.2" TextAlign="Right" Height="30px"></aspxform:XTextBox>
                    </td>
                    <td class="xjtds1">
                        <aspxform:XTextBox id="XTextBox48" runat="server" Express="varPrice*DF_ER_CarItems.Mileage" Width="100%" XDataBind="DF_ER_CarItems.VehicleFees" Enabled="False" Format="type:currency;.2" TextAlign="Right" Height="30px" ReadOnly="True"></aspxform:XTextBox>
                    </td>
                    <td class="xjtds1">
                        <aspxform:XTextBox id="XTextBox32" runat="server" Width="100%" XDataBind="DF_ER_CarItems.OtherExpenses" Format="type:currency;.2" TextAlign="Right" Height="30px"></aspxform:XTextBox>
                    </td>
                    <td class="xjtds1">
                        <aspxform:XTextBox id="XTextBox33" runat="server" Width="100%" XDataBind="DF_ER_CarItems.OtherExpensesExplain" Height="30px"></aspxform:XTextBox>
                    </td>
                </tr>
            </tbody>
        </table>
        <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator2" runat="server" ValidationGroup="a" Display="None" ErrorMessage="请选择日期" ControlToValidate="XDateTimePicker1" ForeColor="Red">请选择日期</aspxform:XRequiredFieldValidator>
        <br />
        <table width="1200" align="center" class="table" id="tablenew" border="0" cellspacing="0" cellpadding="3" dynamicarea="2,1" menudock="Left">
            <tbody>
                <tr>
                    <td height="17" class="title1" colspan="4">
                        <asp:Label id="XLabel43" runat="server" value valuetodisplaytext text="电子发票明细"></asp:Label><asp:Label id="XLabel39" runat="server" value valuetodisplaytext text="（此处添加电子发票明细）" forecolor="Red"></asp:Label></td>
                </tr>
                <tr>
                    <td align="center" class="tds" style="TEXT-ALIGN: center">
                        <p align="center">
                            <asp:Label id="XLabel44" runat="server" text="序号"></asp:Label>
                        </p>
                    </td>
                    <td align="center" class="tds" style="TEXT-ALIGN: center">
                        <asp:Label id="XLabel45" runat="server" value valuetodisplaytext text="电子发票号"></asp:Label></td>
                    <td align="center" class="tds" style="TEXT-ALIGN: center">
                        <asp:Label id="Label1" runat="server" value valuetodisplaytext text="电子发票附件"></asp:Label></td>
                    <td align="center" class="tds" style="TEXT-ALIGN: center">
                        <div align="center"><asp:Label id="XLabel46" runat="server" value valuetodisplaytext text="金额"></asp:Label>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td height="25" class="xjtds1" style="TEXT-ALIGN: center">
                        <aspxform:XGridLineNo id="XGridLineNo2" runat="server" Width="100%" BorderWidth="1" BorderColor="#DCDCDC" BackColor="Transparent" TextAlign="Center" BorderStyle="None" Height="30px">1</aspxform:XGridLineNo>
                    </td>
                    <td class="xjtds1" style="TEXT-ALIGN: center">
                        <aspxform:XTextBox id="XTextBox41" runat="server" Width="100%" BorderWidth="1" BorderColor="#DCDCDC" XDataBind="DF_ER_EInvoiceItems.EInvoiceNum" TextAlign="Center" Height="30px"></aspxform:XTextBox>
                    </td>
                    <td class="xjtds1">
                        <aspxform:XAttachments id="EInvoiceAttachment" runat="server" Width="100%" XDataBind="DF_ER_EInvoiceItems.EInvoiceAttachment" DisableExpress='Global.StepName!="开始"' Height="30px" FileTypes="*.jpg;*.png;*.pdf" FileTypesDescription="Word,Excel" MaximumFileSize></aspxform:XAttachments>
                    </td>
                    <td class="xjtds1">
                        <aspxform:XTextBox id="XTextBox42" runat="server" Width="100%" BorderWidth="1px" BorderColor="#DCDCDC" XDataBind="DF_ER_EInvoiceItems.Amount" Format="type:currency;.2" TextAlign="Right" Height="30px"></aspxform:XTextBox>
                    </td>
                </tr>
            </tbody>
        </table>
        <aspxform:XRequiredFieldValidator id="XRequiredFieldValidator4" runat="server" DisableExpress='DF_ER_HeadTable.InvoiceType!="全部电子发票" &amp;&amp;  DF_ER_HeadTable.InvoiceType!="部分电子发票"' ValidationGroup="a" Display="None" ErrorMessage="请填写电子发票号" ControlToValidate="XTextBox41" ForeColor="Red">请填写电子发票号</aspxform:XRequiredFieldValidator>
        &nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator5" runat="server" DisableExpress='DF_ER_HeadTable.InvoiceType!="全部电子发票" &amp;&amp;  DF_ER_HeadTable.InvoiceType!="部分电子发票"' ValidationGroup="a" Display="None" ErrorMessage="请上传电子发票附件" ControlToValidate="EInvoiceAttachment" ForeColor="Red">请上传电子发票附件</aspxform:XRequiredFieldValidator>
        &nbsp;<aspxform:XRequiredFieldValidator id="XRequiredFieldValidator6" runat="server" DisableExpress='DF_ER_HeadTable.InvoiceType!="全部电子发票" &amp;&amp;  DF_ER_HeadTable.InvoiceType!="部分电子发票"' ValidationGroup="a" Display="None" ErrorMessage="请填写金额" ControlToValidate="XTextBox42" ForeColor="Red">请填写金额</aspxform:XRequiredFieldValidator>
        <br />
        <table width="1200" align="center" class="table" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr class="title1">
                    <td class="ts">
                        <asp:Label id="XLabel23" runat="server" value valuetodisplaytext text="事由"></asp:Label></td>
                </tr>
                <tr>
                    <td class="tsbottomtext">
                        <aspxform:XTextBox id="XTextBox15" runat="server" Width="100%" BorderWidth="1px" BorderColor="Gainsboro" Max="0" Min="0" XDataBind="DF_ER_HeadTable.Remark" Value ValueToDisplayText HiddenInput="False" Height="60px" TextMode="MultiLine"></aspxform:XTextBox>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" align="center" class="table" border="0" cellspacing="0" cellpadding="0">
            <tbody>
                <tr class="title1">
                    <td class="ts">
                        <asp:Label id="XLabel26" runat="server" value valuetodisplaytext text="附件"></asp:Label></td>
                </tr>
                <tr>
                    <td class="tsbottomtext">
                        <aspxform:XAttachments id="XAttachments1" runat="server" Width="100%" XDataBind="DF_ER_HeadTable.Attachment" FileTypes="*.doc;*.docx;*.xls;*.xlsx;*.pdf" FileTypesDescription="Word,Excel"></aspxform:XAttachments>
                    </td>
                </tr>
            </tbody>
        </table>
        <br />
        <table width="1200" align="center">
            <tbody>
                <tr>
                    <td>
                        <aspxform:XSignTrace id="XSignTrace1" runat="server" Width="100%" BorderWidth="1" BorderColor="#dcdcdc"></aspxform:XSignTrace>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
</body>
</html>
