<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>订单打印</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport"
    content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
  <style>
    h3,
    td,
    th {
      color: #000000
    }

    .layui-table td,
    .layui-table th {
      border-color: #000000;
      height: 1px
    }

    .label {
      padding: 2px 0;
      margin: 3px 0;
      font-weight: bold;
      text-align: center;
    }

    .title {
      box-sizing: border-box;
      display: flex;
      min-height: 34px;
      justify-content: flex-start;
      align-items: flex-end;
      white-space: nowrap;
      text-align: left;
      width: 10%;
      padding: 0 5px;
      border-width: 1px;
      border: 0;
    }

    .title::after {
      content: "："
    }

    .cell {
      width: 18%;
      border-width: 1px;
      border-color: rgb(0, 0, 0);
    }

    .cell>.border {
      min-height: 34px;
      display: flex;
      margin-right: 10px;
      align-items: flex-end;
      justify-content: flex-start;
      position: relative;
    }

    .cell>.border::after {
      width: 100%;
      content: "";
      display: table;
      position: absolute;
      left: 0;
      bottom: 0;
      border-bottom: 1px solid #000;
    }

    .content {
      padding: 5px;
      border-width: 1px;
      border-color: rgb(0, 0, 0);
      position: relative;
    }
  </style>
</head>

<body>

  <div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body" pad15>
        <div class="layui-row layui-col-space15">
          <div class="layui-col-md12">

            <div id="print_div">
              <h3 align="center" style="font-weight: bold;margin-bottom: 10px;">个人贷款申请表</h3>
              <table border="0px" style="margin-bottom: 10px;">
                <tr>
                  <td class="title"></td>
                  <td id="vmodel" class="cell"></td>
                  <td class="title"></td>
                  <td id="invioce" class="cell"></td>
                  <td class="title"></td>
                  <td id="lamount" class="cell"></td>
                  <td class="title"></td>
                  <td id="seller_text" class="cell"></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="ptax" class="cell"></td>
                  <td class="title"></td>
                  <td id="insurance" class="cell"></td>
                  <td class="title"></td>
                  <td id="boutique" class="cell"></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="wextension" class="cell"></td>
                  <td class="title"></td>
                  <td id="upkeep" class="cell"></td>
                  <td></td>
                  <td></td>
                </tr>
                  <tr>
                  <td class="title"></td>
                  <td id="dpratio" class="cell"></td>
                  <td class="title"></td>
                  <td id="laompany_text" class="cell"></td>
                  <td class="title"></td>
                  <td id="laompany_month" class="cell"></td>
                </tr>
              </table>
              <p class="label"></p>
              <table>
                <tr>
                  <td class="title"></td>
                  <td id="name" class="cell"></td>
                  <td class="title"></td>
                  <td id="sex_text" class="cell"></td>
                  <td class="title"></td>
                  <td id="bdate" class="cell"></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="rpr_text" class="cell"></td>
                  <td class="title"></td>
                  <td id="nationality_text" class="cell"></td>
                  <td class="title"></td>
                  <td id="ntype_text" class="cell"></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="inumber" class="cell"></td>
                  <td class="title"></td>
                  <td id="dincome" class="cell"></td>
                  <td class="title"></td>
                  <td id="mstatus_text" class="cell"></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="elevel_text" class="cell"></td>
                  <td class="title"></td>
                  <td id="naddress" colspan="2" class="cell"></td>
                  <td></td>
                  <td></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="hptype_text" class="cell"></td>
                  <td class="title"></td>
                  <td id="maddress_text" colspan="2" class="cell"></td>
                  <td></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="email" class="cell"></td>
                  <td class="title"></td>
                  <td id="wx" class="cell"></td>
                  <td class="title"></td>
                  <td id="tel" class="cell"></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="wname" class="cell"></td>
                  <td class="title"></td>
                  <td id="wphone" class="cell"></td>
                  <td></td>
                  <td></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="waddress" colspan="2" class="cell"></td>
                  <td class="title"></td>
                  <td id="itype_text" class="cell"></td>
                  <td></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="otype_text" class="cell"></td>
                  <td></td>
                  <td></td>
                  <td></td>
                  <td></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="wbst_text" class="cell"></td>
                  <td class="title"></td>
                  <td id="bstname" colspan="2" class="cell"></td>
                  <td></td>
                </tr>
              </table>
              <table>
                <tr>
                  <td class="title"></td>
                  <td id="bstcode" class="cell"></td>
                  <td class="title"></td>
                  <td id="bsttel" class="cell"></td>
                  <td></td>
                  <td></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="bstaddress" colspan="2" class="cell"></td>
                  <td></td>
                  <td></td>
                  <td></td>
                </tr>
              </table>
              <p class="label"></p>
              <table>
                <tr>
                  <td class="title"></td>
                  <td id="cname" class="cell"></td>
                  <td class="title"></td>
                  <td id="ctel" class="cell"></td>
                  <td class="title"></td>
                  <td id="relation_text" class="cell"></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="caddress" colspan="2" class="cell"></td>
                  <td></td>
                  <td></td>
                  <td></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="ctname" class="cell"></td>
                  <td class="title"></td>
                  <td id="cttel" class="cell"></td>
                  <td></td>
                  <td></td>
                </tr>
              </table>
              <p class="label"></p>
              <table>
                <tr>
                  <td class="title"></td>
                  <td id="tsname" class="cell"></td>
                  <td class="title"></td>
                  <td id="tsbdate" class="cell"></td>
                  <td class="title"></td>
                  <td id="tsitype_text" class="cell"></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="tsinumber" class="cell"></td>
                  <td class="title"></td>
                  <td id="tstel" class="cell"></td>
                  <td class="title"></td>
                  <td id="tsrelation_text" class="cell"></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="tsnaddress" colspan="2" class="cell"></td>
                  <td class="title"></td>
                  <td id="tsmaddress_text" colspan="2" class="cell"></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="tsemail" class="cell"></td>
                  <td class="title"></td>
                  <td id="tswx" class="cell"></td>
                  <td></td>
                  <td></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="tswname" colspan="2" class="cell"></td>
                  <td class="title"></td>
                  <td id="tswphone" class="cell"></td>
                  <td></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="tswaddress" colspan="2" class="cell"></td>
                  <td class="title"></td>
                  <td id="tsmincome" class="cell"></td>
                  <td></td>
                </tr>
                <tr>
                  <td class="title"></td>
                  <td id="notes" colspan="2" class="cell"></td>
                </tr>
              </table>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <script src="../../layuiadmin/layui/layui.js?t=1"></script>
  <script>
    layui.config({
      base: '../../../layuiadmin/' //静态资源所在路径
    }).extend({
      index: 'lib/index' //主入口模块
    }).use(['index', 'table'], function () {
      var $ = layui.$
        , admin = layui.admin
      var order_id = layui.view.getParameterByName('order_id');
      var editdata = JSON.parse(JSON.stringify(parent.layui.table.editdata)); // 框架有Bug所以这么转换

      admin.req({
        url: '/order/' + order_id + '/get_detail/'
        , done: function (res) {
          let { order_info } = res.data;
          order_info.forEach(item => {
            $(`#${item.name}`).html(`<div class="border">${item.value ? item.value : ' '}</div>`).prev().html(item.label)
          })
        }
      });
    });

    function doPrint() {
      document.body.innerHTML = document.getElementById('print_div').innerHTML;
      window.print();
      parent.layer.closeAll('iframe');
    }

  </script>
</body>

</html>
