<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>发票管理-添加采购发票</title>
    <link rel="stylesheet" type="text/css" href="/css/external/fileUploadBase.css">
    <style>
        .btn-info:active,
        .btn-info:focus {
            background-color: #fff;
        }

        li.notcompanyli:hover {
            color: #333 !important;
        }

        .base-extend .newTabAddUpdateBox td.enter .viewDetailWord {
            width: 0.75rem;
            text-align: center;
            top: 0.1rem;
            color: #333 !important;
            cursor: default;
            font-style: normal;
        }

        .base-extend .newTabAddUpdateBox td.enter .prevDetailWord {
            width: 0.85rem;
            text-align: center;
            top: 0.1rem;
            color: #333 !important;
            cursor: default;
            font-style: normal;
        }

        .error option, select.error {
            color: #333 !important;
        }

        input::-webkit-outer-spin-button,
        input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            appearance: none;
            margin: 0;
        }

        .chooseGoodsTable td {
            border-left: 1px solid #E8F0F3;
            border-top: 1px solid #E8F0F3;
            padding: 0.1rem;
            text-align: left;
            background-color: #F0F9FC;
            font-size: 0.12rem;
            color: #333;
            min-height: 0.34rem;
            word-break: break-all;
            position: relative;
        }
    </style>
</head>
<body>
<div class="base-extend">
    <div class="modal fade businessDialog" id="myModal-chooseGoods" data-backdrop="static">
        <div class="modal-dialog" style="width:12.5rem;">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true" style="font-size:0.18rem">×</span><span class="sr-only">关闭</span>
                </button>
                <span class="modal-title">选择货物</span>
            </div>
            <div class="modal-content" style="max-height:4.7rem;overflow-y:auto;overflow-x:hidden;">
                <div class="listBackBox" style="padding-top:0;">
                    <div class="projectTableBox" id="formForProjectListBox" style="margin:0;">
                        <div class="customerMarketingList formForProjectList col-xs-12 businessTable"
                             style="left:0;padding:0.1rem 0.2rem 0 0.2rem;" tipword="">
                            <p class="detailContentBox-title">可选货物</p>
                            <table id="chooseGoodsList" class="tablebox" style="width: 100%;"></table>
                            <div id="chooseGoodsListPage" class="tablepagebox"></div>

                            <p class="detailContentBox-title" style="margin-top: 20px;display: none">已选货物</p>
                            <table class="chooseGoodsTable" style="width: 100%!important;display: none">
                                <tr>
                                    <td width="6%">
                                        <span style="color: #656565;font-weight: 700">编号</span>
                                    </td>
                                    <td width="14%">
                                        <span style="color: #656565;font-weight: 700">验收日期</span>
                                    </td>
                                    <td width="14%">
                                        <span style="color: #656565;font-weight: 700">名称</span>
                                    </td>
                                    <td width="12%">
                                        <span style="color: #656565;font-weight: 700">厂家</span>
                                    </td>
                                    <td width="12%">
                                        <span style="color: #656565;font-weight: 700">型号</span>
                                    </td>
                                    <td width="12%">
                                        <span style="color: #656565;font-weight: 700">单位</span>
                                    </td>
                                    <td width="10%">
                                        <span style="color: #656565;font-weight: 700">数量</span>
                                    </td>
                                    <td width="12%">
                                        <span style="color: #656565;font-weight: 700">采购单价</span>
                                    </td>
                                    <td width="8%">
                                        <span style="color: #656565;font-weight: 700">操作</span>
                                    </td>
                                </tr>
                                <tbody class="choosedGoodsList">

                                </tbody>
                            </table>

                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button class="btn btn-default btn-white btn-info colorbtn chooseSure" style='margin-bottom:0;'>确定
                </button>
                <button class="btn btn-default btn-white btn-info" data-dismiss="modal" style='margin-bottom:0;'>取消
                </button>
            </div>
        </div>
    </div>

    <div class="modal fade businessDialog" id="myModal-chooseGoods2" data-backdrop="static">
        <div class="modal-dialog" style="width:12.5rem;">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true" style="font-size:0.18rem">×</span><span class="sr-only">关闭</span>
                </button>
                <span class="modal-title">选择货物</span>
            </div>
            <div class="modal-content" style="max-height:4.7rem;overflow-y:auto;overflow-x:hidden;">
                <div class="listBackBox" style="padding-top:0;">
                    <div class="projectTableBox" id="formForProjectListBox2" style="margin:0;">
                        <div class="customerMarketingList formForProjectList col-xs-12 businessTable"
                             style="left:0;padding:0.1rem 0.2rem 0 0.2rem;" tipword="">
                            <p class="detailContentBox-title">可选货物</p>
                            <table id="chooseGoodsList2" class="tablebox" style="width: 100%;"></table>
                            <div id="chooseGoodsListPage2" class="tablepagebox"></div>

                            <p class="detailContentBox-title" style="margin-top: 20px;display: none">已选货物</p>
                            <table class="chooseGoodsTable2" style="width: 100%!important;display: none">
                                <tr>
                                    <td width="6%">
                                        <span style="color: #656565;font-weight: 700">编号</span>
                                    </td>
                                    <td width="14%">
                                        <span style="color: #656565;font-weight: 700">验收日期</span>
                                    </td>
                                    <td width="14%">
                                        <span style="color: #656565;font-weight: 700">名称</span>
                                    </td>
                                    <td width="12%">
                                        <span style="color: #656565;font-weight: 700">厂家</span>
                                    </td>
                                    <td width="12%">
                                        <span style="color: #656565;font-weight: 700">型号</span>
                                    </td>
                                    <td width="12%">
                                        <span style="color: #656565;font-weight: 700">单位</span>
                                    </td>
                                    <td width="10%">
                                        <span style="color: #656565;font-weight: 700">数量</span>
                                    </td>
                                    <td width="12%">
                                        <span style="color: #656565;font-weight: 700">采购单价</span>
                                    </td>
                                    <td width="8%">
                                        <span style="color: #656565;font-weight: 700">操作</span>
                                    </td>
                                </tr>
                                <tbody class="choosedGoodsList2">

                                </tbody>
                            </table>

                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button class="btn btn-default btn-white btn-info colorbtn chooseSure2" style='margin-bottom:0;'>确定
                </button>
                <button class="btn btn-default btn-white btn-info" data-dismiss="modal" style='margin-bottom:0;'>取消
                </button>
            </div>
        </div>
    </div>

    <ol class="breadcrumb">
        <i class="icon-chevron-sign-left newBackBtn"></i>
        <li>发票管理</li>
        <li>添加采购发票</li>
    </ol>
    <div class="detailContentBox">
        <p class="detailContentBox-title">添加发票</p>
        <form class="form-horizontal" id="entryForm" autocomplete="off">
            <input type="hidden" name="basicId" th:value="${businessBasicInfo?.id}">
            <input type="hidden" name="businessNumber" th:value="${businessBasicInfo?.businessNumber}">
            <div class="newTabAddUpdateBox">
                <div class="row">
                    <table class="fileInfoListBox invoiceFile">
                        <tr>
                            <td colspan="3">
                                <span class="detailContentBox-tabletitle">采购发票附件</span>
                            </td>
                        </tr>
                        <tr>
                            <td width="15%">
                                <span class="required_fileds_star">采购发票附件</span>：
                            </td>
                            <td class="enter addFileList">
                                <input type="file" name="file" class="fileinput" multiple style="display:none">
                                <div class="uploaderFile">
                                    <div class="fileContent">
                                        <span class="spanHolder">上传附件</span>
                                    </div>
                                </div>
                                <span class="error" style="display:none;">请上传附件</span>
                            </td>
                            <td width="13%" class="choiceFile" style="text-align:center;">
                                +上传附件
                            </td>
                        </tr>
                    </table>
                    <table class="fileInfoListBox goodsFile">
                        <tr>
                            <td width="15%">
                                <span class="required_fileds_star">发票货物清单附件</span>：
                            </td>
                            <td class="enter addFileList">
                                <input type="file" name="file" class="fileinput" multiple style="display:none">
                                <div class="uploaderFile">
                                    <div class="fileContent">
                                        <span class="spanHolder">上传附件</span>
                                    </div>
                                </div>
                                <span class="error" style="display:none;">请上传附件</span>
                            </td>
                            <td width="13%" class="choiceFile" style="text-align:center;">
                                +上传附件
                            </td>
                        </tr>
                    </table>
                </div>

                <div class="row">
                    <table>
                        <tr>
                            <td colspan="4">
                                <span class="detailContentBox-tabletitle">采购发票信息</span>
                            </td>
                        </tr>
                        <tr>
                            <td width="15%">
                                <span class="required_fileds_star">发票日期</span>：
                            </td>
                            <td width="35%" class="enter">
                                <input type="text" readonly name="invoiceDate" class="form-control"
                                       th:value="${#calendars.format(purchInvoiceVo?.purchInvoiceInfo?.invoiceDate,'yyyy-MM-dd')}">
                            </td>
                            <td width="15%">
                                <span class="required_fileds_star">发票金额</span>：
                            </td>
                            <td width="35%" class="enter">
                                <input type="text" name="invoiceAmount" class="form-control amountInput"
                                       th:value="${purchInvoiceVo?.purchInvoiceInfo?.invoiceAmount}">
                            </td>
                        </tr>
                        <tr>
                            <td width="15%">
                                <span class="required_fileds_star">发票单号</span>：
                            </td>
                            <td width="35%" class="enter">
                                <input type="text" name="invoiceNumber" class="form-control"
                                       th:value="${purchInvoiceVo?.purchInvoiceInfo?.invoiceNumber}">
                            </td>
                            <td width="15%">
                                <span class="required_fileds_star">供应商名称</span>：
                            </td>
                            <td width="35%" class="enter">
                                <select name="supplierId" class="form-control">
                                    <option th:each="supplier,supplierStat:${businessBasicInfo?.businessSupplierInfos}"
                                            th:value="${supplier?.supplierId}" th:text="${supplier?.supplierName}" th:seletcd="${purchInvoiceVo?.purchInvoiceInfo?.supplierId}"></option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td width="15%">
                                <span class="required_fileds_star">发票类型</span>：
                            </td>
                            <td width="35%" class="enter">
                                <select name="invoiceType" class="form-control" tag:option="invoiceType" th:value="${purchInvoiceVo?.purchInvoiceInfo?.invoiceTypeDic?.id}"></select>
                            </td>
                            <td width="15%">
                                <span class="required_fileds_star">金额种类</span>：
                            </td>
                            <td width="35%" class="enter">
                                <select name="amountKind" class="form-control" tag:option="amountKind" th:value="${purchInvoiceVo?.purchInvoiceInfo?.amountKindDic?.id}"></select>
                            </td>
                        </tr>
                    </table>
                </div>

                <div class="row huokuan" style="display: none">
                    <table class="goodsTable">
                        <tr>
                            <td colspan="11">
                                <span class="detailContentBox-tabletitle">货物信息</span>
                                <span id="chooseButton" class="colorbtn btn" style="float: right;">
                                    选择货物
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td width="5%">
                                <span>编号</span>
                            </td>
                            <td width="10%">
                                <span>名称</span>
                            </td>
                            <td width="10%">
                                <span>型号</span>
                            </td>
                            <td width="9%">
                                <span>单位</span>
                            </td>
                            <td width="9%">
                                <span>数量</span>
                            </td>
                            <td width="10%">
                                <span>采购单价</span>
                            </td>
                            <td width="10%">
                                <span>采购总价 </span>
                            </td>
                            <td width="10%">
                                <span>已开票数量</span>
                            </td>
                            <td width="10%">
                                <span>开票数量</span>
                            </td>
                            <td width="10%">
                                <span>开票金额</span>
                            </td>
                            <td width="7%">
                                <span>操作</span>
                            </td>
                        </tr>
                        <tr class="goodsListTbody" style="display: none">
                            <td width="5%" style="background-color:#fff;">
                                <span>1</span>
                            </td>
                            <td width="10%" style="background-color:#fff;">

                            </td>
                            <td width="10%" style="background-color:#fff;">

                            </td>
                            <td width="9%" style="background-color:#fff;">

                            </td>
                            <td width="9%" style="background-color:#fff;">

                            </td>
                            <td width="10%" style="background-color:#fff;" class="enter">
                                <input type="text" class="form-control validInput amountInput unitPrice">
                                <span class="error" style="display:none;">请填写采购单价</span>
                            </td>
                            <td width="10%" style="background-color:#fff;" class="enter">
                                <input type="text" class="form-control validInput amountInput totalPrice">
                                <span class="error" style="display:none;">请填写采购总价</span>
                            </td>
                            <td width="10%" style="background-color:#fff;" class="enter">
                                <input type="text" readonly class="form-control validInput amountInput invoicedQuantity">
                                <span class="error" style="display:none;">请填写已开票数量</span>
                            </td>
                            <td width="10%" style="background-color:#fff;" class="enter">
                                <input type="text" class="form-control validInput amountInput openQuantity">
                                <span class="error" style="display:none;">请填写开票数量</span>
                            </td>
                            <td width="10%" style="background-color:#fff;" class="enter">
                                <input type="text" class="form-control validInput amountInput openAmount">
                                <span class="error" style="display:none;">请填写开票金额</span>
                            </td>
                            <td width="7%" style="background-color:#fff;">
                                <span class="negativeInformationReduce">-删除</span>
                            </td>
                        </tr>
                        <tbody class="goodsListTable">
                        <tr class="goodsListTbody goodsListTbodyBack"
                            th:each="goods,goodsStat:${purchInvoiceVo?.purchInvoiceGoodsList}">
                            <td width="3%" style="background-color:#fff;">
                                <span th:text="${goodsStat.count}"></span>
                            </td>
                            <td width="10%" style="background-color:#fff;" th:text="${goods?.goodsName}">
                            </td>
                            <td width="10%" style="background-color:#fff;" th:text="${goods?.modelNumber}">
                            </td>
                            <td width="6%" style="background-color:#fff;" th:text="${goods?.units}">
                            </td>
                            <td width="7%" style="background-color:#fff;" th:text="${goods?.quantity}">
                            </td>
                            <td width="10%" style="background-color:#fff;" class="enter">
                                <input type="text" class="form-control validInput amountInput unitPrice"
                                       th:value="${goods?.unitPrice}">
                                <span class="error" style="display:none;">请填写采购单价</span>
                            </td>
                            <td width="10%" style="background-color:#fff;" class="enter">
                                <input type="text" class="form-control validInput amountInput totalPrice" readonly
                                       th:value="${goods?.totalPrice}">
                                <span class="error" style="display:none;">请填写采购总价</span>
                            </td>
                            <td width="10%" style="background-color:#fff;" class="enter">
                                <input type="text" class="form-control validInput invoicedQuantity"
                                       readonly
                                       th:value="${goods?.invoicedQuantity}">
                                <span class="error" style="display:none;">请填写已开票数量</span>
                            </td>
                            <td width="10%" style="background-color:#fff;" class="enter">
                                <input type="text" class="form-control validInput openQuantity"
                                       th:value="${goods?.openQuantity}">
                                <span class="error" style="display:none;">请填写开票数量</span>
                            </td>
                            <td width="10%" style="background-color:#fff;" class="enter">
                                <input type="text" class="form-control validInput amountInput openAmount"
                                       readonly
                                       th:value="${goods?.openAmount}">
                                <span class="error" style="display:none;">请填写开票金额</span>
                            </td>
                            <td width="7%" style="background-color:#fff;">
                                <span class="negativeInformationReduce">-删除</span>
                            </td>
                        </tr>
                        </tbody>
                        <tbody>
                        <tr>
                            <td colspan="11" style="background-color: #fff">
                                &nbsp;&nbsp;&nbsp;&nbsp;总金额合计：<span class="totalAmount"></span>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>

                <!--    贴现费用    -->
                <div class="row tiexian" style="display: none">
                    <table class="goodsTable2">
                        <tr>
                            <td colspan="10">
                                <span class="detailContentBox-tabletitle">发票货物信息</span>
                                <span id="chooseButton2" class="colorbtn btn" style="float: right;">
                                    选择货物
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td width="10%">
                                <span>编号</span>
                            </td>
                            <td width="20%">
                                <span>名称</span>
                            </td>
                            <td width="20%">
                                <span>型号</span>
                            </td>
                            <td width="20%">
                                <span>单位</span>
                            </td>
                            <td width="20%">
                                <span>开票金额</span>
                            </td>
                            <td width="10%">
                                <span>操作</span>
                            </td>
                        </tr>
                        <tr class="goodsListTbody2" style="display: none">
                            <td width="10%" style="background-color:#fff;">
                                <span>1</span>
                            </td>
                            <td width="20%" style="background-color:#fff;">
                            </td>
                            <td width="20%" style="background-color:#fff;">
                            </td>
                            <td width="20%" style="background-color:#fff;">
                            </td>
                            <td width="20%" style="background-color:#fff;">
                                <input type="text" class="form-control validInput amountInput openAmount">
                                <span class="error" style="display:none;">请填写开票金额</span>
                            </td>
                            <td width="10%" style="background-color:#fff;">
                                <span class="negativeInformationReduce">-删除</span>
                            </td>
                        </tr>
                        <tbody class="goodsListTable2">
                        <tr class="goodsListTbody2 goodsListTbodyBack2"
                            th:each="goods,goodsStat:${purchInvoiceVo?.purchInvoiceGoodsList}">
                            <td width="10%" style="background-color:#fff;">
                                <span th:text="${goodsStat.count}"></span>
                            </td>
                            </td>
                            <td width="20%" style="background-color:#fff;" th:text="${goods?.goodsName}">
                            </td>
                            <td width="20%" style="background-color:#fff;" th:text="${goods?.modelNumber}">
                            </td>
                            <td width="20%" style="background-color:#fff;" th:text="${goods?.units}">
                            </td>
                            <td width="20%" style="background-color:#fff;" class="enter">
                                <input type="text" class="form-control validInput amountInput openAmount"
                                       th:value="${goods?.billCapitalOccupationFee}">
                                <span class="error" style="display:none;">请填写开票金额</span>
                            </td>
                            <td width="6%" style="background-color:#fff;">
                                <span class="negativeInformationReduce">-删除</span>
                            </td>
                        </tr>
                        </tbody>
                        <tbody>
                        <tr>
                            <td colspan="6" style="background-color: #fff">
                                &nbsp;&nbsp;&nbsp;&nbsp;总金额合计：<span class="totalAmount2"></span>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>

                <div class="row zijin" style="display: none">
                    <table class="supplierTable">
                        <tr>
                            <td colspan="4">
                                <span class="detailContentBox-tabletitle">发票供应商信息</span>
                                <span id="addSupplier" class="colorbtn btn" style="float: right;">
                                    添加
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td width="12%">
                                <span>编号</span>
                            </td>
                            <td width="50%">
                                <span>供应商名称</span>
                            </td>
                            <td width="25%">
                                <span>开票金额</span>
                            </td>
                            <td width="13%">
                                <span>操作</span>
                            </td>
                        </tr>
                        <tr class="supplierListTbody" style="display: none">
                            <td width="12%" style="background-color:#fff;">
                                <span>1</span>
                            </td>
                            <td width="50%" style="background-color:#fff;" class="enter">
                                <select name="supplierId" class="form-control validInput">
                                    <option th:each="supplier,supplierStat:${businessBasicInfo?.businessSupplierInfos}"
                                            th:value="${supplier?.supplierId}" th:text="${supplier?.supplierName}"></option>
                                </select>
                                <span class="error" style="display:none;font-size:0.12rem;">请选择供应商</span>
                            </td>
                            <td width="25%" style="background-color:#fff;" class="enter">
                                <input type="text" class="form-control validInput amountInput openAmount">
                                <span class="error" style="display:none;">请填写开票金额</span>
                            </td>
                            <td width="13%" style="background-color:#fff;">
                                <span class="negativeInformationReduce">-删除</span>
                            </td>
                        </tr>
                        <tbody class="supplierListTable">
                        <tr class="supplierListTbody supplierListTbodyBack"
                            th:each="goods,goodsStat:${purchInvoiceVo?.purchInvoiceGoodsList}">
                            <td width="12%" style="background-color:#fff;">
                                <span th:text="${goodsStat.count}"></span>
                            </td>
                            <td width="50%" style="background-color:#fff;" class="enter">
                                <select name="supplierId" class="form-control validInput">
                                    <option th:each="supplier,supplierStat:${businessBasicInfo?.businessSupplierInfos}"
                                            th:value="${supplier?.supplierId}" th:text="${supplier?.supplierName}" th:seletcd="${goods?.supplierId}"></option>
                                </select>
                                <span class="error" style="display:none;font-size:0.12rem;">请选择供应商</span>
                            </td>
                            <td width="25%" style="background-color:#fff;" class="enter">
                                <input type="text" class="form-control validInput amountInput openAmount"
                                       th:value="${goods?.openAmount}">
                                <span class="error" style="display:none;">请填写开票金额</span>
                            </td>
                            <td width="13%" style="background-color:#fff;">
                                <span class="negativeInformationReduce">-删除</span>
                            </td>
                        </tr>
                        </tbody>
                        <tbody>
                        <tr>
                            <td colspan="4" style="background-color: #fff">
                                &nbsp;&nbsp;&nbsp;&nbsp;总金额合计：<span class="totalAmount3"></span>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>

            </div>
            <div class="yk_addBtns yk_addNewMsg newTabAddUpdateBtnBox">
                <button class="btn btn-white btn-info colorbtn submitBusiness">提交</button>
                <button class="btn btn-white btn-info btn-cancel">关闭</button>
            </div>
        </form>
    </div>
</div>
</body>
<script src="/js/purchInvoiceManage/entry.js"></script>
</html>