<!DOCTYPE html>
<html>
<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;
        }
        .changeBtn{
            color:#53c3fe;
            cursor:pointer;
        }
        .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:10.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="5%">
                                        <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="14%">
                                        <span style="color: #656565;font-weight: 700">型号</span>
                                    </td>
                                    <td width="13%">
                                        <span style="color: #656565;font-weight: 700">单位</span>
                                    </td>
                                    <td width="13%">
                                        <span style="color: #656565;font-weight: 700">数量</span>
                                    </td>
                                    <td width="13%">
                                        <span style="color: #656565;font-weight: 700">销售单价</span>
                                    </td>
                                    <td width="10%">
                                        <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>
    <ol class="breadcrumb">
        <li>采购合同管理</li>
        <li>变更合同</li>
    </ol>

    <div class="detailContentBox">
        <div class="businessNavigation">
            <ul></ul>
        </div>
        <!-- 查看历史消息部分 -->
        <div class="projectManagementTop">
            <div class="newTabAddUpdateBox" style="border:none;"></div>
        </div>

        <div class="projectManagementBottom">
            <p class="detailContentBox-title">变更合同</p>
            <form class="form-horizontal businessClass-form" id="contractSign-form">
                <input type="hidden" name="taskId" th:value="${taskId}">
                <input type="hidden" name="businessKey" th:value="${businessKey}">
                <input type="hidden" name="purchContractManagementId" th:value="${contractSupplementInfo?.purchContractManagementId}">
                <!-- 用于计算暂定单价 -->
                <!-- 利差计算方式 -->
                <input type="hidden" name="accrualMarginCalcMethod" th:value="${purchContractInfo?.purchContractPriceRule?.accrualMarginCalcMethodDict?.id}" th:code="${purchContractInfo?.purchContractPriceRule?.accrualMarginCalcMethodDict?.code}">
                <!-- 预估保理融资期限 -->
                <input type="hidden" name="factoringFinanceDeadline" th:value="${purchContractInfo?.purchContractPriceRule?.factoringFinanceDeadline}" >
                <!-- 月利率 -->
                <input type="hidden" name="monthlyInterestRate" th:value="${purchContractInfo?.purchContractPriceRule?.monthlyInterestRate}" >
                <input type="hidden" name="differAmount" th:value="${purchContractInfo?.purchContractPriceRule?.differAmount}" >
                <input type="hidden" name="purchContractSupplementInfoId" th:value="${purchContractSupplementInfo?.id}" >


                <div class="newTabAddUpdateBox">
                    <div class="row">
                        <table>
                            <tr>
                                <td width="15%">
                                    <span class="required_fileds_star">是否需要审核</span>：
                                </td>
                                <td width="35%" class="enter hasradio approvalTd">
                                    <label>
                                        <input type="radio" class="radios" value="1" name="approval" th:checked="${purchContractSupplementInfo?.approval} == 1">
                                        <span>是</span>
                                    </label>
                                    <label>
                                        <input type="radio" class="radios" value="0" name="approval" th:checked="${purchContractSupplementInfo?.approval} == 0">
                                        <span>否</span>
                                    </label>
                                </td>
                                <td width="15%" class="approvalHide">
                                    <span class="required_fileds_star">是否新增货物</span>：
                                </td>
                                <td width="35%" class="enter hasradio approvalHide">
                                    <label>
                                        <input type="radio" class="radios" value="1" name="addGoods" th:checked="${purchContractSupplementInfo?.addGoods} == 1">
                                        <span>是</span>
                                    </label>
                                    <label>
                                        <input type="radio" class="radios" value="0" name="addGoods" th:checked="${purchContractSupplementInfo?.addGoods} == 0">
                                        <span>否</span>
                                    </label>
                                </td>
                            </tr>
                            <tr class="approvalHide">
                                <td width="15%">
                                    <span class="">补充合同编号</span>：
                                </td>
                                <td width="35%" class="enter">
                                    <input type="text" maxlength="50" name="supplementContractNumber" class="form-control" th:value="${purchContractSupplementInfo?.supplementContractNumber}">
                                </td>
                                <td width="15%">
                                    <span class="required_fileds_star">合同生效日</span>：
                                </td>
                                <td width="35%" class="enter">
                                    <input type="text" maxlength="50" name="contractEffectDate" th:value="${#calendars.format(purchContractSupplementInfo?.contractEffectDate, 'yyyy-MM-dd')}" readonly class="form-control">
                                </td>
                            </tr>
                            <tr class="approvalHide">
                                <td width="15%">
                                    <span class="required_fileds_star">价格计算规则</span>：
                                </td>
                                <td colspan="3" class="enter">
                                    <input type="text" maxlength="50" name="priceRuleDetail" th:value="${purchContractSupplementInfo?.priceRuleDetail}" class="form-control">
                                </td>
                            </tr>
                            <tr class="approvalHide">
                                <td width="15%">
                                    <span class="">其他约定</span>：
                                </td>
                                <td colspan="3" class="enter">
                                    <input type="text" name="otherConvention" th:value="${purchContractSupplementInfo?.otherConvention}" class="form-control">
                                </td>
                            </tr>
                        </table>
                    </div>

                    <div class="row approvalChange">
                        <table>
                            <tr>
                                <td colspan="3">
                                    <span class="detailContentBox-tabletitle">合同文件</span>
                                </td>
                            </tr>
                            <tr class="contractBox">
                                <td width="15%">
                                    <span  th:class="required_fileds_star">合同文件</span>:
                                </td>
                                <td colspan="1" class="enter contractBoxUploadTd">
                                    <div class="contractBoxUploadTdFileStorage" th:each="fileStorage,fileStorages:${purchContractSupplementInfo?.fileStorages}" style="display:none">
                                        <input type="text" class="originalId"   th:value="${fileStorage?.id}">
                                        <input type="text" class="originalUrl"  th:value="${fileStorage?.path}">
                                        <input type="text" class="originalType" th:value="${fileStorage?.fileType}">
                                        <input type="text" class="originalName" th:value="${fileStorage?.originalName}">
                                        <input type="text" class="originalSize" th:value="${fileStorage?.size}">
                                    </div>
                                    <div class="fileListBox">
                                        <input type="file" class="fileinput" name="file" style="display:none">
                                        <div class="uploaderFile" style="display: block;border-bottom:0">
                                            <div class="fileContent">
                                                <span class="spanHolder">上传文件</span>
                                            </div>
                                        </div>
                                    </div>
                                </td>
                                <td width="15%" class="choiceFile" style="text-align:center;">
                                    +请上传附件
                                </td>
                            </tr>
                            <tr>
                                <td width="15%">
                                    <span class="">说明</span>：
                                </td>
                                <td colspan="2" class="enter">
                                    <input type="text" name="remark" th:value="${purchContractSupplementInfo?.remark}"  class="form-control">
                                </td>
                            </tr>
                        </table>

                    </div>
                    <div class="row">
                        <table class="goodsTable">
                            <tr>
                                <td colspan="10">
                                    <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="15%">
                                    <span>厂家</span>
                                </td>
                                <td width="15%">
                                    <span>型号</span>
                                </td>
                                <td width="10%">
                                    <span>单位</span>
                                </td>
                                <td width="10%">
                                    <span>数量</span>
                                </td>
                                <td width="10%">
                                    <span>暂定单价</span>
                                </td>
                                <td width="14%">
                                    <span>备注</span>
                                </td>
                                <td width="10%">
                                    <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;" class="enter">
                                    <input type="text" readonly class="form-control validInput">
                                    <span class="error" style="display:none;">请填写名称</span>
                                </td>
                                <td width="15%" style="background-color:#fff;" class="enter">
                                    <input type="text" readonly class="form-control validInput">
                                    <span class="error" style="display:none;">请填写厂家</span>
                                </td>
                                <td width="15%" style="background-color:#fff;" class="enter">
                                    <input type="text" readonly class="form-control validInput">
                                    <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">
                                    <span class="error" style="display:none;">请填写单位</span>
                                </td>
                                <td width="10%" style="background-color:#fff;" class="enter">
                                    <input type="text" class="form-control validInput">
                                    <span class="error" style="display:none;">请填写数量</span>
                                </td>
                                <td width="10%" style="background-color:#fff;" class="enter">
                                    <input type="text" oninput="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)" readonly class="form-control">
                                </td>
                                <td width="14%" style="background-color:#fff;" class="enter">
                                    <input type="text" class="form-control">
                                </td>
                                <td width="10%" style="background-color:#fff;">
                                    <!--                                <span class="negativeInformationPlus">+添加</span>-->
                                    <span class="negativeInformationReduce">删除</span>
                                </td>
                            </tr>
                            <tbody class="goodsListTable">
                                <tr class="goodsListTbody goodsListTbodyBack"
                                    th:each="goods,goodsStat:${purchContractSupplementInfo?.supplementGoodsInfos}" th:id="${goods?.id}">
                                    <td width="5%" style="background-color:#fff;">
                                        <span th:text="${goodsStat.count}"></span>
                                    </td>
                                    <td width="10%" style="background-color:#fff;" class="enter">
                                        <input type="text" readonly class="form-control validInput"
                                            th:goodsId="${goods?.id}"
                                            th:value="${goods?.goodsName}">
                                        <span class="error" style="display:none;">请填写名称</span>
                                    </td>
                                    <td width="15%" style="background-color:#fff;" class="enter">
                                        <input type="text" readonly class="form-control validInput"
                                            th:value="${goods?.goodsFactory}">
                                        <span class="error" style="display:none;">请填写厂家</span>
                                    </td>
                                    <td width="15%" style="background-color:#fff;" class="enter">
                                        <input type="text" readonly class="form-control validInput"
                                            th:value="${goods?.modelNumber}">
                                        <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"
                                            th:value="${goods?.units}">
                                        <span class="error" style="display:none;">请填写单位</span>
                                    </td>
                                    <td width="10%" style="background-color:#fff;" class="enter">
                                        <input class="form-control validInput"
                                            th:value="${goods?.quantity}">
                                        <span class="error" style="display:none;">请填写数量</span>
                                    </td>
                                    <td width="10%" style="background-color:#fff;" class="enter">
                                        <input type="text" oninput="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)" readonly class="form-control"  th:value="${goods?.price} == '不明确' ? '不明确' : ${#numbers.formatDecimal(goods?.price,1,2)}">
                                    </td>
                                    <td width="14%" style="background-color:#fff;" class="enter">
                                        <input type="text" class="form-control" th:value="${goods?.remark}">
                                    </td>
                                    <td width="10%" style="background-color:#fff;">
                                        <!-- <span class="negativeInformationPlus">+添加</span> -->
                                        <span class="negativeInformationReduce">删除</span>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>

                <div class="yk_addBtns yk_addNewMsg newTabAddUpdateBtnBox" >

<!--                    <button class="btn btn-white btn-info colorbtn back">退回</button>-->
                    <button class="btn btn-white btn-info colorbtn save">提交</button>
                    <button class="btn btn-white btn-info btn-cancel">关闭</button>
                </div>
            </form>
        </div>

    </div>
</div>
<script src="/js/base/uploadFile.js"></script>
<script src="/js/purchaseContractManage/contractChange.js"></script>
<script src="/js/purchaseContractManage/searchHistory.js"></script>
</body>
</html>
