<!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;
        }
        .emptyGoods {
            float: right;
            cursor: pointer;
            color: #169bd5;
            line-height: 30px;
            margin-left: 5px;
        }
        .calcMoney {
            margin-right: 10px;
        }
    </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 class="cancelBtn" 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="10%">
                                        <span style="color: #656565;font-weight: 700">结算单号</span>
                                    </td>
                                    <td width="10%">
                                        <span style="color: #656565;font-weight: 700">供应商</span>
                                    </td>
                                    <td width="13%">
                                        <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 cancelBtn" 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 class="cancelBtn2" 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="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="10%">
                                        <span style="color: #656565;font-weight: 700">结算单号</span>
                                    </td>
                                    <td width="10%">
                                        <span style="color: #656565;font-weight: 700">供应商</span>
                                    </td>
                                    <td width="13%">
                                        <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 cancelBtn2" 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="${basicInformation?.businessBasicInfoId}">
            <input type="hidden" name="businessNumber" >
            <div class="newTabAddUpdateBox">
                <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">
                                <select name="supplierName" class="form-control">
                                    <option th:each="supplier,supplierStat:${suppliers}" th:value="${supplier?.id}" th:text="${supplier?.enterpriseName}"></option>
                                </select>
                            </td>
                            <td width="15%">
                                <span class="required_fileds_star">核心企业名称</span>：
                            </td>
                            <td width="35%" class="enter">
                                <select name="enterpriseName" class="form-control">
                                    <option th:each="supplier,supplierStat:${acceptanceBasicInfo?.suppliers}" th:value="${supplier?.id}" th:text="${supplier?.enterpriseName}"></option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td width="15%">
                                <span class="required_fileds_star">业务名称</span>：
                            </td>
                            <!-- <td width="35%" class="enter">
                                <select name="businessName" class="form-control">
                                    <option></option>
                                </select>
                            </td> -->
                            <td width="35%" class="enter">
                                <ul class="allBusinessName" style="display:none;"></ul>
                                <input type="text" readOnly name="businessName" id="businessName" class="form-control">
                                <div class="entCustomerListBox busListBox" style="position:absolute !important;z-index:999;background-color: #fff;border: 1px solid #ccc;box-shadow: 0px 0px 2px 2px rgba(62, 192, 230,0.3);display:none;">
                                    <input type="text" class="form-control" style="margin:0.05rem auto;width:97%;border-color: #5AC4FC;box-shadow: inset 0 1px 1px rgba(90,196,252,.075), 0 0 8px rgba(90,196,252,.6);" placeholder="可输入关键词查询">
                                    <button class="btn btn-info btn-white colorbtn searchBus" style="position:absolute;right:0;top:0.05rem;height:0.34rem;width:0.3rem;text-align:center;padding-left:0;padding-right:0;">查</button>
                                    <ul style="overflow:auto;"></ul>
                                </div>
                                <input type="hidden" id="businessNameId">
                            </td>
                            <td width="15%">
                                <span class="required_fileds_star">业务编号</span>：
                            </td>
                            <td width="35%" class="enter">
                                <!-- <select name="businessNo" class="form-control">
                                    <option th:each="supplier,supplierStat:${acceptanceBasicInfo?.businessNo}" th:value="${supplier?.id}" th:text="${supplier?.enterpriseName}"></option>
                                </select> -->
                                <input type="hidden" name="businessNoId" >
                                <input type="text" name="businessNo" class="form-control" readonly>
                            </td>                        
                        </tr>
                        <tr>
                            <td width="15%">
                                <span class="required_fileds_star">贸易平台</span>：
                            </td>
                            <td width="35%" class="enter">
                                <input type="hidden" readonly name="tradingPlatformId" >
                                <input type="text" readonly name="platformName" th:value="${acceptanceBasicInfo?.platform}" class="form-control">
                            </td>
                            <td width="15%">
                                <span class="required_fileds_star">合同名称(采购)</span>：
                            </td>
                            <td width="35%" class="enter">
                                <input type="text" name="contractName" readonly class="form-control"
                                >
                            </td>
                            
                        </tr>
                        <tr>
                            <td width="15%">
                                <span class="required_fileds_star">合同编号(采购)</span>：
                            </td>
                            <td width="35%" class="enter">
                                <input type="text" readonly name="contractNumber" class="form-control"
                                >
                            </td>
                            <td width="15%">
                                <span class="required_fileds_star">合同金额</span>：
                            </td>
                            <td width="35%" class="enter">
                                <input type="text" name="contractAmount" readonly class="form-control amountInput">
                            </td>
                        </tr>
                        <tr>
                            <td width="15%">
                                <span class="">备注</span>：
                            </td>
                            <td colspan="3" class="enter" style="border-bottom: 1px solid #E8F0F3;">
                                <textarea class="form-control" style="resize:none;" name="remark" rows="4"
                                          maxlength="500"></textarea>
                            </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" name="accountsReceivableStartDate" readonly class="form-control"
                                >
                            </td>
                            <td width="15%">
                                <span class="required_fileds_star">应收账款期限</span>：
                            </td>
                            <td width="35%" class="enter">
                                <input type="text" name="accountReceivablePeriod" class="form-control"
                                >
                            </td>
                        </tr>
                        <tr>
                            <td width="15%">
                                <span class="required_fileds_star">应收账款结束日</span>：
                            </td>
                            <td  colspan="3" class="enter">
                                <input type="text" name="accountsReceivableEndDate" readonly class="form-control"
                                >
                            </td>
                        </tr>
                    </table>
                </div>

                <div class="row">
                    <table class="goodsTable">
                        <tr>
                            <td colspan="15">
                                <span class="detailContentBox-tabletitle">货物信息</span>
                                <span id="chooseSettlementButton" class="colorbtn btn" style="float: right; ">
                                    选择已结算货物
                                </span>
                                <span id="chooseCheckButton" class="colorbtn btn" style="float: right; margin-right: 5px;">
                                    选择已验收货物
                                </span>
                                <div class="emptyGoods calcMoney">一键计算质保金</div>
                            </td>
                        </tr>
                        <tr>
                            <td width="5%">
                                <span>编号</span>
                            </td>
                            <td width="7%">
                                <span>验收日期</span>
                            </td>
                            <td width="7%" style="display: none">
                                <span>名称</span>
                            </td>
                            <td width="6%">
                                <span>名称</span>
                            </td>
                            <td width="6%">
                                <span>厂家</span>
                            </td>
                            <td width="7%">
                                <span>型号</span>
                            </td>
                            <td width="5%">
                                <span>单位</span>
                            </td>
                            <td width="7%">
                                <span>数量</span>
                            </td>
                            <td width="10%">
                                <span>销售单价</span>
                            </td>
                            <td width="7%">
                                <span>销售总价 </span>
                            </td>
                            <td width="7%">
                                <span>销售质保金</span>
                            </td>
                            <td width="7%">
                                <span>采购单价</span>
                            </td>
                            <td width="7%">
                                <span>采购总价</span>
                            </td>
                            <td width="7%">
                                <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="7%" style="background-color:#fff;">

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

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

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

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

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

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

                            </td>
                            <td width="10%" style="background-color:#fff;" class="enter">
                                <input type="text" class="form-control validInput salePrice" oninput="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
                                <span class="error" style="display:none;">请填写销售单价</span>
                            </td>
                            <td width="7%" style="background-color:#fff;" class="enter">
                                <input type="text" readonly class="form-control  amountInput totalSalePrice">
                                <span class="error" style="display:none;">请填写销售总价</span>
                            </td>
                            <td width="7%" style="background-color:#fff;" class="enter">
                                <input type="text" readonly class="form-control  amountInput salesGuaranteeMoney">
                                <span class="error" style="display:none;">请填写销售质保金</span>
                            </td>
                            <td width="7%" style="background-color:#fff;" class="enter">
                                <input type="text" readonly class="form-control  amountInput purchasePrice">
                                <span class="error" style="display:none;">请填写采购单价</span>
                            </td>
                            <td width="7%" style="background-color:#fff;" class="enter">
                                <input type="text" readonly class="form-control  amountInput totalPurchasePrice">
                                <span class="error" style="display:none;">请填写采购总价</span>
                            </td>
                            <td width="7%" style="background-color:#fff;" class="enter">
                                <input type="text" readonly class="form-control  amountInput purchaseGuaranteeMoney">
                                <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:${basicInformation?.mortgageInformations}">
                                <td width="5%" style="background-color:#fff;">
                                    <span th:text="${goodsStat.count}"></span>
                                </td>
                                <td width="7%" style="background-color:#fff;" th:text="${goods?.acceptanceDate}">
                                </td>
                                <td width="7%" style="background-color:#fff;display: none"
                                    th:text="${goods?.acceptanceDate}">
                                </td>
                                <td width="6%" style="background-color:#fff;" th:text="${goods?.goodsName}">
                                </td>
                                <td width="6%" style="background-color:#fff;" th:text="${goods?.goodsFactory}">
                                </td>
                                <td width="7%" style="background-color:#fff;" th:text="${goods?.goodsType}">
                                </td>
                                <td width="5%" style="background-color:#fff;" th:text="${goods?.goodsUnit}">
                                </td>
                                <td width="7%" style="background-color:#fff;" th:text="${goods?.goodsNum}">
                                </td>
                                <td width="10%" style="background-color:#fff;" class="enter">
                                    <input type="text" class="form-control validInput salePrice"
                                        oninput="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)"
                                        th:value="${#numbers.formatDecimal(goods?.salesPrice,1,2)}">
                                    <span class="error" style="display:none;">请填写销售单价</span>
                                </td>
                                <td width="7%" style="background-color:#fff;" class="enter">
                                    <input type="text" class="form-control  amountInput totalSalePrice" readonly
                                        th:value="${#numbers.formatDecimal(goods?.totalSalePrice,1,2)}">
                                    <span class="error" style="display:none;">请填写销售总价</span>
                                </td>
                                <td width="7%" style="background-color:#fff;" class="enter">
                                    <input type="text" class="form-control  amountInput salesGuaranteeMoney"readonly
                                        th:value="${#numbers.formatDecimal(goods?.salesGuaranteeMoney,1,2)}">
                                    <span class="error" style="display:none;">请填写销售质保金</span>
                                </td>
                                <td width="7%" style="background-color:#fff;" class="enter">
                                    <input type="text" class="form-control  amountInput purchasePrice" readonly
                                        th:value="${#numbers.formatDecimal(goods?.purchasePrice,1,2)}">
                                    <span class="error" style="display:none;">请填写采购单价</span>
                                </td>
                                <td width="7%" style="background-color:#fff;" class="enter">
                                    <input type="text" class="form-control  amountInput totalPurchasePrice" readonly
                                        th:value="${#numbers.formatDecimal(goods?.totalPurchasePrice,1,2)}">
                                    <span class="error" style="display:none;">请填写采购总价</span>
                                </td>
                                <td width="7%" style="background-color:#fff;" class="enter">
                                    <input type="text" class="form-control  amountInput purchaseGuaranteeMoney" readonly
                                        th:value="${#numbers.formatDecimal(goods?.purchaseGuaranteeMoney,1,2)}">
                                    <span class="error" style="display:none;">请填写采购质保金</span>
                                </td>
                                <td width="7%" style="background-color:#fff;">
                                    <span class="negativeInformationReduce">删除</span>
                                </td>
                            </tr>
                        </tbody>
                        <tr>
                            <td style="background-color:#fff;" colspan="14">
                                数量合计:
                                <span class="totalNum"></span>
                                销售总价合计：
                                <span class="totalPrice"></span>
                                采购总价合计：
                                <span class="totalPurchase"></span>
                            </td>
                        </tr>
                    </table>
                </div>

                <div class="row netPrice">
                    <table class="fileInfoListBox">
                        <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>
                </div>

                <!-- <div class="row yk_addNewMsg">
                    <button class="btn btn-white btn-info colorbtn getBottomInfo">生成底层信息</button>
                </div> -->
                <div class="row">
                    <table>
                        <tr>
                            <td colspan="15">
                                <span class="detailContentBox-tabletitle">底层信息</span>
                            </td>
                        </tr>
                        <tr>
                            <td width="5%">
                                <span>编号</span>
                            </td>
                            <td width="9%">
                                <span>名称</span>
                            </td>
                            <td width="9%">
                                <span>厂家</span>
                            </td>
                            <td width="9%">
                                <span>型号</span>
                            </td>
                            <td width="6%">
                                <span>单位</span>
                            </td>
                            <td width="6%">
                                <span>数量</span>
                            </td>
                            <td width="9%">
                                <span>应收账款金额</span>
                            </td>
                            <td width="9%">
                                <span>应收账款净额</span>
                            </td>
                            <!-- <td width="15%">
                                <span>应收账款起始日</span>
                            </td>
                            <td width="9%">
                                <span>应收账款期限</span>
                            </td>
                            <td width="15%">
                                <span>应收账款结束日</span>
                            </td> -->
                        </tr>
                        <tbody class="underlyingTbody">
                            <tr class="underlyingList underlyingListBack"
                                th:each="goods,goodsStat:${basicInformation?.mortgageGoodsInformations}">
                                <td style="background-color:#fff;">
                                    <span th:text="${goodsStat.count}"></span>
                                </td>
                                <td style="background-color:#fff;" th:text="${goods?.goodsName}"></td>
                                <td style="background-color:#fff;" th:text="${goods?.goodsFactory}"></td>
                                <td style="background-color:#fff;" th:text="${goods?.goodsType}"></td>
                                <td style="background-color:#fff;" th:text="${goods?.goodsUnit}"></td>
                                <td style="background-color:#fff;" th:text="${#numbers.formatDecimal(goods?.goodsNum,1,4)}"></td>
                                <td style="background-color:#fff;" th:text="${#numbers.formatDecimal(goods?.accountsReceivableAmount,1,2)}"></td>
                                <td style="background-color:#fff;" th:text="${#numbers.formatDecimal(goods?.netAccountsReceivableAmount,1,2)}"></td>
                                <!-- <td class="enter">
                                    <input type="text" class="form-control accountStart" th:value="${#calendars.format(goods?.startOfReconciliation,'yyyy-MM-dd')}">
                                </td>
                                <td style="background-color:#fff;" th:text="${goods?.accountPeriod}"></td>
                                <td style="background-color:#fff;" th:text="${#calendars.format(goods?.accountEnd,'yyyy-MM-dd')}"></td> -->
                                <td style="background-color:#fff;display: none" th:text="${goods?.acceptanceBusinessGoodsId}"></td>
                            </tr>
                        </tbody>
                        <tr>
                            <td style="background-color:#fff;" colspan="8">
                                数量合计：
                                <span class="underlyingTotalNum"></span>
                                应收账款净额合计:
                                <span class="netAccountsReceivableAmountAll"></span>
                                应收账款金额合计:
                                <span class="totalAmountAccountsReceivable"></span>
                            </td>
                            <!-- <td style="background-color:#fff;" class="accountsReceivableAmountAll"></td>
                            <td style="background-color:#fff;" class="netAccountsReceivableAmountAll"></td> -->
                        </tr>
                    </table>
                </div>
            </div>
            <div class="yk_addBtns yk_addNewMsg newTabAddUpdateBtnBox">
                <button class="btn btn-white btn-info colorbtn submitTemSave">暂存</button>
                <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/underlyingManage/entry.js"></script>
</html>
