<?php require "layout/innerHeader.php" ?>

<!-- content -->
<section class="content pagecontent">
  <div class="container">
    <aside class="leftmenu panel-shadow" id="leftmenu">
      <h3 class="title">
        <i class="icon-dashboard"></i> 我的操作台
        <i class="arrow" onclick="$('#leftmenu').toggleClass('opened')"></i>
      </h3>
      <ul>
        <li><a href="edit-account.php">企业基本信息</a></li>
        <li><a href="forgetPsChange.php">修改登录密码</a></li>
        <li class="active"><a href="order-detail.php">新增销售订单</a></li>
      </ul>
    </aside>


    <div class="content-box panel-shadow">
      <div class="page-title">
        <h2 class="title  border-theme"><span class="text-theme">新增销售订单</span></h2>
      </div>
      <form class="form-horizontal validate-form" name="basicInfo" id="basicInfo" autocomplete="off">
          <div class="form-group">
            <label class="col-md-2 control-label"><span class="text-danger pr5">*</span>收货地址</label>
            <div class="col-md-10">
              <p class="loadtext">
                <span id="address1">张XX(上海市宝山区南京路12号3号楼201室)</span>
                <button type="button" class="btn btn-sm btn-theme ml10" onClick="changeData('1')">选择</button>
              </p>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-2 control-label"><span class="text-danger pr5">*</span>开票方式</label>
            <div class="col-md-4">
              <div class="btn-group">
                <select name="date" class="form-control">
                  <option selected="selected" value="1">专用发票</option>
                  <option value="2">增值税发票</option>
                </select>
              </div>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-2 control-label"><span class="text-danger pr5">*</span>收票地址</label>
            <div class="col-md-10">
              <p class="loadtext">
                <span class="text-muted" id="address2">==请选择==</span>
                <button type="button" class="btn btn-sm btn-theme ml10" onClick="changeData('2')">选择</button>
              </p>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-2 control-label"><span class="text-danger pr5">*</span>开票信息</label>
            <div class="col-md-10">
              <p class="loadtext">
                <span class="text-muted" id="address3">==请选择==</span>
                <button type="button" class="btn btn-sm btn-theme ml10" onClick="changeData('3')">选择</button>
              </p>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-2 control-label">订购明细</label>
            <div class="col-md-10">
              <div class="productTr nm">
                <table class="table table-striped table-sideborder nm">
                  <thead>            
                    <tr>
                      <th width="80">寄卖单ID</th>
                      <th width="80">CAS号</th>
                      <th >化学品中文名称</th>
                      <th >化学品英文名称</th>
                      <th width="80">纯度级别</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr data-id="111">
                      <td>9711</td>
                      <td>110-17-8</td>
                      <td>中文名称：中文名称中文名称中文名称</td>
                      <td>English name: English name English name English name English name English name</td>
                      <td>99</td>
                    </tr>
                    <tr data-id="222">
                      <td>9711</td>
                      <td>110-17-8</td>
                      <td>中文名称：中文名称中文名称中文名称</td>
                      <td>English name: English name English name English name English name English name</td>
                      <td>99</td>
                    </tr>
                  </tbody>
                </table>
              </div>
              
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-2 control-label"><span class="text-danger pr5">*</span>总价</label>
            <div class="col-md-4">
              <div class="input-group">
                <input type="text" class="form-control" name="total">
                <span class="input-group-addon">元</span>
              </div>
            </div>
          </div>
          <div class="form-group">
            <label class="col-md-2 control-label">订单备注</label>
            <div class="col-md-10">
              <textarea class="form-control" name="ramark" rows="2"></textarea>
            </div>
          </div>
          <div class="form-group mt10">
						<div class="col-sm-8 col-sm-offset-2">
              <button type="button" class="btn btn-theme btn-confirm" id="submitRegister"><i class="icon-file-alt mr5"></i> 确认提交</button>
              <button type="button" class="btn btn-default ml10" onClick="$('#basicInfo')[0].reset();"><i class="icon-repeat mr5"></i>重填</button>
						</div>
					</div>
      </form>
    </div>
  </div>
</section>

<!--选择地址-->
<div id="changeAddress" class="modal fade">
	<div class="modal-dialog">
		<form class="modal-content form-horizontal form-bordered min" action="" autocomplete="off">
			<div class="modal-header">
				<button data-dismiss="modal" class="close" type="button">×</button>
				<h4 class="modal-title"></h4>
			</div>
			<div class="modal-body">
				<div class="indicator"><span class="spinner"></span></div>


				<div class="productTr nm dis-none" id="listTable1">
					<table class="table table-condensed table-striped table-sideborder table-compact table-fixed nm">
						<thead>            
							<tr>
                <th class="text-center" width="80">联系人</th>
								<th class="text-left">地址</th>
								<th class="text-center" width="120">电话</th>
								<th class="text-center" width="70">操作</th>
							</tr>
						</thead>
						<tbody>
							<tr data-id="111">
								<td class="text-center">张XX</td>
								<td class="text-left">上海市宝山区南京路12号3号楼201室</td>
								<td class="text-center">13800000000</td>
								<td class="text-center"><button type="button" class="btn btn-xs btn-theme btn-confirm">选择</button></td>
							</tr>
              <tr data-id="222">
								<td class="text-center">张XX</td>
								<td class="text-left">上海市宝山区南京路12号3号楼201室</td>
								<td class="text-center">13800000000</td>
								<td class="text-center"><button type="button" class="btn btn-xs btn-theme btn-confirm">选择</button></td>
							</tr>
						</tbody>
					</table>
				</div>

        <div class="productTr nm dis-none" id="listTable2">
					<table class="table table-condensed table-striped table-sideborder table-compact table-fixed nm">
						<thead>            
							<tr>
                <th class="text-center" width="80">联系人</th>
								<th class="text-left">地址</th>
								<th class="text-center" width="120">电话</th>
								<th class="text-center" width="70">操作</th>
							</tr>
						</thead>
						<tbody>
              <tr>
								<td class="text-center" colspan="4">
                  <p class="text-muted pt15 pb15">
                    暂无地址，请添加<br> 
                    <button type="button" class="btn btn-sm btn-default mt10"><i class="icon-cog mr5"></i>地址管理</button>
                  </p>
                </td>
							</tr>
						</tbody>
					</table>
				</div>

        <div class="productTr nm dis-none" id="listTable3">
					<table class="table table-condensed table-striped table-sideborder table-compact table-fixed nm">
						<thead>            
							<tr>
                <th class="text-center" width="80">名称</th>
								<th class="text-left">账户信息</th>
								<th class="text-center" width="120">类别</th>
								<th class="text-center" width="70">操作</th>
							</tr>
						</thead>
						<tbody>
							<tr data-id="111">
								<td class="text-center">公司账户</td>
								<td class="text-left">开户行：交通银行上海南桥支行 开户名：XXXXXXXX有限公司 银行账号：XXXX XXXXX</td>
								<td class="text-center">银行账号</td>
								<td class="text-center"><button type="button" class="btn btn-xs btn-theme btn-confirm">选择</button></td>
							</tr>
						</tbody>
					</table>
				</div>

			</div>

			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</form>
	</div>
</div>

<?php include "layout/footer.php" ?>
<script type="text/javascript">
  function changeData(type){
    let title = "";
    switch(type){
      case "1": title = "请选择收货地址"; break;
      case "2": title = "请选择收票地址"; break;
      case "3": title = "请选择开票信息"; break;
    }
    
    $("#changeAddress .modal-title").text(title);
    $("#changeAddress .productTr").hide();
    $("#changeAddress").modal("show").find("#listTable" + type).show();
  }
  $(function() {
    
  });
</script>
</body>
</html>