<template>
  <div class="printPage">
    <div class="print-area" v-if="form.housingTicketContent">
      <p style="text-align: center; line-height: 37px">
        <strong><span style="font-size: 32px">房票安置转换</span></strong
        ><strong><span style="font-size: 32px">协议</span></strong>
      </p>
      <p style="text-align: right; line-height: 37px">
        <span style="font-size: 16px"
          ><span style="font-family: 仿宋">编号:</span
          ><span style="font-family: 仿宋">{{
            form.numbering || ""
          }}</span></span
        >
      </p>
      <p style="line-height: 37px">
        <span style="font-size: 22px"
          ><span style="font-family: 仿宋">甲方</span
          ><span style="font-family: 仿宋">:</span></span
        ><span style="font-size: 22px">内江</span
        ><span
          ><span style="font-size: 22px; text-decoration: underline" id="v1">{{
            form.nameA
          }}</span></span
        ><span style="font-size: 22px">区</span
        ><span
          ><span style="font-size: 22px; text-decoration: underline" id="v2">{{
            form.streetOfficeNameA
          }}</span></span
        ><span style="font-size: 22px">街道办事处</span>
      </p>
      <p style="line-height: 37px">
        <span style="font-size: 22px"
          ><span style="font-family: 仿宋">乙方</span
          ><span style="font-family: 仿宋">:姓名:</span></span
        ><span
          ><span style="font-size: 22px; text-decoration: underline" id="v3">{{
            form.nameB
          }}</span></span
        ><span style="font-size: 22px"
          >&nbsp;<span style="font-family: 仿宋">性别</span
          ><span style="font-family: 仿宋">:</span></span
        ><span
          ><span style="font-size: 22px; text-decoration: underline" id="v4">{{
            form.sexB === "1" ? "男" : "女"
          }}</span></span
        ><span style="font-size: 22px"
          >&nbsp;<span style="font-family: 仿宋">身份证号码</span
          ><span style="font-family: 仿宋">:</span></span
        ><span
          ><span style="font-size: 22px; text-decoration: underline" id="v5">{{
            form.idCardB
          }}</span></span
        >
      </p>
      <p style="line-height: 37px">
        <span style="font-size: 22px">身份证所载住址：内江</span
        ><span
          ><span style="font-size: 22px; text-decoration: underline" id="v6">{{
            form.housingTicketContent.boxA1
          }}</span></span
        ><span style="font-size: 22px">区</span
        ><span
          ><span style="font-size: 22px; text-decoration: underline" id="v7">{{
            form.housingTicketContent.boxA2
          }}</span></span
        ><span style="font-size: 22px">街道</span
        ><span
          ><span style="font-size: 22px; text-decoration: underline" id="v8">{{
            form.housingTicketContent.boxA3
          }}</span></span
        ><span style="font-size: 22px">社区</span
        ><span
          ><span style="font-size: 22px; text-decoration: underline" id="v9">{{
            form.housingTicketContent.boxA4
          }}</span></span
        ><span style="font-size: 22px">组</span
        ><span
          ><span style="font-size: 22px; text-decoration: underline" id="v10">{{
            form.housingTicketContent.boxA5
          }}</span></span
        >
      </p>
      <p style="line-height: 37px">
        <span style="font-size: 22px"
          ><span style="font-family: 仿宋">丙</span>
          <span style="font-family: 仿宋"
            >方：内江高新区拆迁协调办公室</span
          ></span
        >
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px">&nbsp;</span>
      </p>
      <!-- <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px"></span>
      </p> -->
      <p>
        <span
        style="text-indent: 37px; line-height: 37px; font-family: 仿宋"
        v-for="(vos, vosIndex) in form.housingTicketContent.vos"
        :key="vosIndex"
      >
        <span style="font-size: 22px">乙方系</span>
        <span>
          <span style="font-size: 22px; text-decoration: underline" id="v11">{{
            vos.projectName
          }}</span>
        </span>
        <span style="font-size: 22px">项目的房屋被安置对象，于</span>
        <span>
          <span style="font-size: 22px; text-decoration: underline" id="v12">{{
            vos.year
          }}</span>
        </span>
        <span style="font-size: 22px">年</span>
        <span>
          <span style="font-size: 22px; text-decoration: underline" id="v13">{{
            vos.month
          }}</span>
        </span>
        <span style="font-size: 22px">月</span>
        <span
          ><span style="font-size: 22px; text-decoration: underline" id="v14">{{
            vos.day
          }}</span></span
        ><span style="font-size: 22px">日与内江市</span
        ><span
          ><span style="font-size: 22px; text-decoration: underline" id="v15">{{
            vos.boxA
          }}</span>
        </span>
        <span style="font-size: 22px">
          <span style="font-family: 仿宋"
            >签订了《统一建房拆迁安置协议》（以下简称</span
          >
          <span style="font-family: 仿宋">“原协议”）。 </span>
        </span>
      </span>
      <span style="font-size: 22px; font-family: 仿宋">
        内江市
        <span>
          <span style="font-size: 22px; text-decoration: underline" id="v16">{{
            form.housingTicketContent.boxB
          }}</span>
        </span>
        <span style="font-size: 22px"
          >在原协议项下的全部权利和义务由甲方承继，并为尽快实现乙方的房屋安置，甲乙双方一致同意将原协议约定的统一建房安置方式变更为</span
        ><span style="font-size: 22px">房票安置</span
        ><span style="font-size: 22px">方式，即由乙方在内江市</span
        ><span
          ><span style="font-size: 22px; text-decoration: underline" id="v17">{{
            form.housingTicketContent.boxC
          }}</span></span
        ><span style="font-size: 22px"
          >确定的房源库中自主购买房地产开发商的商品房进行房屋安置。为此，双方经协商，就</span
        ><span style="font-size: 22px">房票安置</span
        ><span style="font-size: 22px">事宜达成本协议。</span>
      </span>
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <strong
          ><span style="font-size: 22px"
            >一、乙方家庭户籍人员情况及安置房屋户型和面积</span
          ></strong
        >
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px">乙方以户为单位作为</span
        ><span style="font-size: 22px">房票安置</span
        ><span style="font-size: 22px">的被安置对象，其家庭户籍人员如下：</span>
      </p>
      <!-- <p > -->
      <table style="width: 100%; border-collapse: collapse">
        <thead>
          <tr>
            <th style="border: 1px solid #000; font-size: 14px; padding: 8px">
              姓名
            </th>
            <th style="border: 1px solid #000; font-size: 14px; padding: 8px">
              关系
            </th>
            <th style="border: 1px solid #000; font-size: 14px; padding: 8px">
              身份证
            </th>
            <th style="border: 1px solid #000; font-size: 14px; padding: 8px">
              户籍所在地
            </th>
            <th style="border: 1px solid #000; font-size: 14px; padding: 8px">
              原协议确定安置房屋户型和面积
            </th>
          </tr>
        </thead>
        <tbody id="tbody">
          <tr v-for="(h, idx) in sumTableData" :key="idx">
            <td
              style="
                width: 10%;
                border: 1px solid #000;
                font-size: 14px;
                padding: 8px;
              "
            >
              {{ h.name }}
            </td>
            <td
              style="
                width: 10%;
                border: 1px solid #000;
                font-size: 14px;
                padding: 8px;
              "
            >
              {{ h.relationship }}
            </td>
            <td
              style="
                width: 20%;
                border: 1px solid #000;
                font-size: 14px;
                padding: 8px;
              "
            >
              {{ h.idCard }}
            </td>
            <td
              style="
                width: 30%;
                border: 1px solid #000;
                font-size: 14px;
                padding: 8px;
              "
            >
              {{ h.placeOfDomicile }}
            </td>
            <td
              style="
                width: 30%;
                border: 1px solid #000;
                font-size: 14px;
                padding: 8px;
              "
              v-if="idx === 0"
              :rowspan="sumTableData.length"
            >
              <!-- {{
                form.housingTicketContent.householdRegistrationDataList
                  .map((item) => item.oldContent + item.oldContent2)
                  .toString()
              }} -->
              <!-- {{
                form.housingTicketContent.householdRegistrationDataList
                  .map((item) => {
                    return;
                    item.innerVos.map(
                      (ite) => ite.oldContent + ite.oldContent2
                    );
                  })
                  .toString()
              }} -->
              {{ oldContent }}
            </td>
          </tr>
        </tbody>
      </table>
      <!-- </p> -->

      <p style="text-indent: 37px; line-height: 37px">
        <strong><span style="font-size: 22px">二、安置方式</span></strong>
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px">原协议约定的统一建房安置方式现变更为</span
        ><span style="font-size: 22px">房票安置</span
        ><span style="font-size: 22px"
          >方式，即甲方按照政策和原协议确定的安置乙方的房屋户型、面积及家庭户籍人数计付安置补偿款，并由乙方用安置补偿款在</span
        ><span
          ><span style="font-size: 22px; text-decoration: underline" id="v18">{{
            form.housingTicketContent.boxC
          }}</span></span
        ><span style="font-size: 22px"
          >的房源库中自主选购房地产开发商的商品房，以实现房屋安置。</span
        >
      </p>
      <p style="text-indent: 43px; line-height: 37px">
        <strong
          ><span style="font-size: 22px">三、安置补偿款和支付方式</span></strong
        >
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <strong><span style="font-size: 22px">（一）安置补偿款</span></strong>
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px"
          >1.基本安置补偿款：乙方的基本安置补偿款按乙方安置房屋面积与政策规定的补偿单价计付，经计算为</span
        ><span style="">
          <!-- form.householdRegistrationDataList[0].boxA -->
          <span style="font-size: 22px; text-decoration: underline" id="v19">{{
            form.housingTicketContent.householdRegistrationDataList.reduce(
              (acc, obj) => Number(acc) + Number(obj.boxA),
              0
            )
          }}</span></span
        ><span style="font-size: 22px">元，计算公式为：安置面积</span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v20">{{
            form.housingTicketContent.householdRegistrationDataList.reduce(
              (acc, obj) => Number(acc) + Number(obj.boxB),
              0
            )
          }}</span></span
        ><span style="font-size: 22px"
          ><span style="font-family: 仿宋">㎡</span
          ><span style="font-family: 仿宋">×</span></span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v21">{{
            form.housingTicketContent.householdRegistrationDataList[0].boxC
          }}</span></span
        ><span style="font-size: 22px"
          ><span style="font-family: 仿宋">元</span
          ><span style="font-family: 仿宋">/㎡=</span></span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v22">{{
            form.housingTicketContent.householdRegistrationDataList.reduce(
              (acc, obj) => Number(acc) + Number(obj.boxA),
              0
            )
          }}</span></span
        ><span style="font-size: 22px"
          ><span style="font-family: 仿宋">元</span>
          <span style="font-family: 仿宋">；</span></span
        >
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px">2.</span
        ><span style="font-size: 22px">房票安置补贴</span
        ><span style="font-size: 22px">：被安置人数</span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v23">{{
            form.housingTicketContent.householdRegistrationDataList.reduce(
              (acc, obj) => Number(acc) + Number(obj.boxE),
              0
            )
          }}</span></span
        ><span style="font-size: 22px"
          ><span style="font-family: 仿宋">人</span
          ><span style="font-family: 仿宋">×3000元/人=</span></span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v24">{{
            form.housingTicketContent.householdRegistrationDataList[0].boxF
          }}</span></span
        ><span style="font-size: 22px">元；</span>
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px">3.高层物业补贴：安置房屋面积</span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v25">{{
            form.housingTicketContent.householdRegistrationDataList.reduce(
              (acc, obj) => Number(acc) + Number(obj.boxB),
              0
            )
          }}</span></span
        ><span style="font-size: 22px"
          ><span style="font-family: 仿宋">㎡</span
          ><span style="font-family: 仿宋">×0.91元/㎡/月×180月=</span></span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v26">{{
            form.housingTicketContent.householdRegistrationDataList.reduce(
              (acc, obj) => Number(acc) + Number(obj.boxH),
              0
            )
          }}</span></span
        ><span style="font-size: 22px">元；</span>
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px">4.</span
        ><span style="font-size: 22px">住宅专项维修资金补贴</span
        ><span style="font-size: 22px">：安置房屋面积</span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v27">{{
            form.housingTicketContent.householdRegistrationDataList.reduce(
              (acc, obj) => Number(acc) + Number(obj.boxB),
              0
            )
          }}</span></span
        ><span style="font-size: 22px"
          ><span style="font-family: 仿宋">㎡</span
          ><span style="font-family: 仿宋">×75元/㎡=</span></span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v28">{{
            form.housingTicketContent.householdRegistrationDataList.reduce(
              (acc, obj) => Number(acc) + Number(obj.boxJ),
              0
            )
          }}</span></span
        ><span style="font-size: 22px">元。</span>
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px">5.过渡费支付：</span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v29"
            >{{
              form.housingTicketContent.householdRegistrationDataList.reduce(
                (acc, obj) => Number(acc) + Number(obj.boxK),
                0
              )
            }}<span style="font-family: 仿宋">元。</span></span
          ></span
        >
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px">6.以上1-5项合计为</span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v30">{{
            form.housingTicketContent.householdRegistrationDataList.reduce(
              (acc, obj) => Number(acc) + Number(obj.boxL),
              0
            )
          }}</span></span
        ><span style="font-size: 22px">元（大写：</span
        ><span style="">
          <!-- form.householdRegistrationDataList[0].boxM -->
          <span style="font-size: 22px; text-decoration: underline" id="v31">{{
            numberParseChina(
              form.housingTicketContent.householdRegistrationDataList.reduce(
                (acc, obj) => Number(acc) + Number(obj.boxL),
                0
              )
            )
          }}</span></span
        ><span style="font-size: 22px">）。</span>
      </p>
      <!-- <p style="text-indent: 37px; line-height: 37px">
        <strong
          ><span style="font-size: 22px"
            >（二）被安置对象超基本安置面积应缴纳的款项</span
          ></strong
        >
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px"
          ><span style="font-family: 仿宋"
            >根据政策和原协议，乙方安置房屋超出基本安置面积（</span
          ><span style="font-family: 仿宋"
            >30㎡/人）之外的部分，乙方按</span
          ></span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v32">{{
            form.housingTicketContent.boxJ || "　/　"
          }}</span></span
        ><span style="font-size: 22px"
          ><span style="font-family: 仿宋">元</span
          ><span style="font-family: 仿宋"
            >/㎡的优惠单价承担该超出部分房款的70%，据此计算，乙方应向甲方缴纳</span
          ></span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v33">{{
            form.housingTicketContent.boxK || "　/　"
          }}</span></span
        ><span style="font-size: 22px"
          >元，计算公式为：超基本安置面积（即安置房屋面积</span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v34">{{
            form.housingTicketContent.boxG || "　/　"
          }}</span></span
        ><span style="font-size: 22px">㎡－基本面积</span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v35">{{
            form.housingTicketContent.boxH || "　/　"
          }}</span></span
        ><span style="font-size: 22px">㎡）部分</span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v36">{{
            form.housingTicketContent.boxL || "　/　"
          }}</span></span
        ><span style="font-size: 22px"
          ><span style="font-family: 仿宋">㎡</span
          ><span style="font-family: 仿宋">×</span></span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v37">{{
            form.housingTicketContent.boxJ || "　/　"
          }}</span></span
        ><span style="font-size: 22px"
          ><span style="font-family: 仿宋">元</span
          ><span style="font-family: 仿宋">/㎡=</span></span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v38">{{
            form.housingTicketContent.boxK || "　/　"
          }}</span></span
        ><span style="font-size: 22px"
          ><span style="font-family: 仿宋">元</span>
          <span style="font-family: 仿宋">。</span></span
        >
      </p> -->
      <p style="text-indent: 37px; line-height: 37px">
        <strong
          ><span style="font-size: 22px"
            >上述（一）经品迭后，乙方本协议项下最终实际获得的安置补偿款为</span
          ></strong
        ><strong
          ><span
            ><span
              style="font-size: 22px; text-decoration: underline"
              id="v39"
              >{{
                form.housingTicketContent.householdRegistrationDataList.reduce(
                  (acc, obj) => Number(acc) + Number(obj.boxL),
                  0
                )
              }}</span
            ></span
          ></strong
        ><strong><span style="font-size: 22px">元。</span></strong>
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <strong><span style="font-size: 22px">（二）支付方式</span></strong>
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px"
          >1.最终安置补偿款中的30%部分由甲方在乙方与房地产开发商签订商品房买卖合同后20个工作日内一次性支付。</span
        >
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px"
          >2.最终安置补偿款中的70%部分由甲方分期支付。</span
        >
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <strong
          ><span style="font-size: 22px"
            >四、商品房的选购及购房款的支付</span
          ></strong
        >
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px">1.乙方应在本协议签订生效后1个月内在</span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v40">{{
            form.housingTicketContent.boxM
          }}</span></span
        ><span style="font-size: 22px">审核通过的</span
        ><span style="font-size: 22px">房票安置</span
        ><span style="font-size: 22px"
          >房屋的房源库中选择商品房并签订商品房买卖合同。</span
        >
      </p>

      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px"
          >2.乙方以户为单位进行商品房选购安置，并指定家庭户籍成员中的</span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v41">{{
            form.housingTicketContent.boxN
          }}</span></span
        ><span style="font-size: 22px"
          >作为购房人（即商品房买卖合同购买人、房屋产权人和借款合同借款人）。</span
        >
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px"
          >3.为确保乙方依法得到房屋安置，不因房屋拆迁影响居住条件，乙方获得的安置补偿款须用于购买商品房，且选购的商品房价款不因房源户型限制而低于安置补偿款的90%；如乙方选购的商品房价款超过安置补偿款的，超出部分由乙方自行筹集解决。</span
        >
      </p>
      <p style="line-height: 37px">
        <strong><span style="font-size: 22px">五、其他事项</span></strong>
      </p>
      <p style="text-indent: 43px; line-height: 37px">
        <span style="font-size: 22px"
          >1.本协议签订后，乙方如果未按本协议约定期限选购商品房实现安置的，本协议自动终止，乙方的房屋安置按原协议执行。</span
        >
      </p>
      <p style="text-indent: 43px; line-height: 37px">
        <span style="font-size: 22px"
          >2.乙方在签订本协议后，不得再次要求甲方变更安置方式。</span
        >
      </p>
      <p style="text-indent: 43px; line-height: 37px">
        <span style="font-size: 22px"
          >3.甲方如果未按本协议约定向乙方支付安置补偿款，由此给乙方造成的损失由甲方全部承担。</span
        >
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px"
          >4.乙方购房价款在安置补偿款以内的，不承担契税；购房价款超过安置补偿款的部分，按相关政策规定缴纳契税。</span
        >
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px"
          >5.乙方购买商品房所产生的办证费用、维修资金、物业管理费等由乙方自行承担。</span
        >
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px"
          >6.本协议签订后，原协议与本协议不一致的以本协议为准，未做变更的继续有效。</span
        >
      </p>
      <p style="text-indent: 37px">
        <span style="font-size: 22px"
          >7.甲、乙双方签订房票安置协议及相关事项由丙方监管。</span
        >
      </p>
      <p style="text-indent: 43px; line-height: 37px">
        <strong><span style="font-size: 22px">六、协议的生效</span></strong>
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px">本协议经甲方盖章、乙方签字</span
        ><span style="font-size: 22px">、</span
        ><span style="font-size: 22px">丙方盖章</span
        ><span style="font-size: 22px">后生效。</span>
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px">本协议一式</span
        ><span style="font-size: 22px">五</span
        ><span style="font-size: 22px">份，甲方持三份、乙</span
        ><span style="font-size: 22px">方</span
        ><span style="font-size: 22px">持一份</span
        ><span style="font-size: 22px">、</span
        ><span style="font-size: 22px">丙方持一份</span
        ><span style="font-size: 22px">。</span>
      </p>
      <p style="text-indent: 37px; line-height: 37px">
        <span style="font-size: 22px">（以下无正文）</span>
      </p>
      <p style="line-height: 37px">
        <span style="font-size: 22px">&nbsp;</span>
      </p>
      <p style="line-height: 37px">
        <span style="font-size: 22px"
          ><span style="font-family: 仿宋">甲</span>
          <span style="font-family: 仿宋">方：内江市</span></span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v42">{{
            form.nameA
          }}</span></span
        ><span style="font-size: 22px">区</span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v43">{{
            form.streetOfficeNameA
          }}</span></span
        ><span style="font-size: 22px">街道办事处（盖章）</span>
      </p>
      <p style="line-height: 37px">
        <span style="font-size: 22px"
          ><span style="font-family: 仿宋">法定代表人（签名）：</span>
          &nbsp;</span
        >
      </p>
      <p style="line-height: 37px">
        <span style="font-size: 22px"
          ><span style="font-family: 仿宋">分管领导：</span>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;　
        </span>
      </p>
      <p style="line-height: 37px">
        <span style="font-size: 22px">经办人：</span>
      </p>
      <p style="line-height: 37px">
        <span style="font-size: 22px">&nbsp;</span>
      </p>
      <br />
      <p style="line-height: 37px">
        <span style="font-size: 22px"
          ><span style="font-family: 仿宋">乙</span>
          <span style="font-family: 仿宋">方：内江市</span></span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v44">{{
            form.housingTicketContent.boxA1
          }}</span></span
        ><span style="font-size: 22px">区</span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v45">{{
            form.housingTicketContent.boxA2
          }}</span></span
        ><span style="font-size: 22px">街道</span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v46">{{
            form.housingTicketContent.boxA3
          }}</span></span
        ><span style="font-size: 22px">社区</span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v47">{{
            form.housingTicketContent.boxA4
          }}</span></span
        ><span style="font-size: 22px">组户主</span
        ><span style=""
          ><span style="font-size: 22px; text-decoration: underline" id="v48">{{
            form.nameB
          }}</span></span
        ><span style="font-size: 22px">&nbsp;</span>
      </p>
      <p style="line-height: 37px">
        <span style="font-size: 22px"
          ><span style="font-family: 仿宋">乙方代表（签名）：</span>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span
        >
      </p>
      <p style="line-height: 37px">
        <span style="font-size: 22px"
          ><span style="font-family: 仿宋">身份证号码：</span>
          {{ form.idCardB }}</span
        >
      </p>
      <p style="line-height: 37px">
        <span style="font-size: 22px">&nbsp;</span>
      </p>
      <br />
      <p style="line-height: 37px">
        <span style="font-size: 22px"
          ><span style="font-family: 仿宋">丙</span>
          <span style="font-family: 仿宋"
            >方：内江高新区拆迁协调办公室</span
          ></span
        >
      </p>
      <p style="line-height: 37px">
        <span style="font-size: 22px">丙</span
        ><span style="font-size: 22px">方代表（</span
        ><span style="font-size: 22px">盖章</span
        ><span style="font-size: 22px">）：</span>
      </p>
      <p style="line-height: 37px">
        <span style="font-size: 22px">&nbsp;&nbsp;&nbsp;</span>
      </p>
      <p style="line-height: 37px; text-align: right">
        <span style="font-size: 22px"
          ><span style="font-family: 仿宋">签约时间：</span>
          {{ form.housingTicketContent.boxR1
          }}<span style="font-family: 仿宋">年</span>
          {{ form.housingTicketContent.boxR2
          }}<span style="font-family: 仿宋">月</span>
          {{ form.housingTicketContent.boxR3
          }}<span style="font-family: 仿宋">日</span></span
        >
      </p>
      <p>
        <span style="font-family: Calibri; font-size: 14px">&nbsp;</span>
      </p>
      <p>
        <br />
      </p>
    </div>
    <div v-if="!printing" style="padding-bottom: 50px">
      <el-button v-if="!$route.query.id" @click="submitData1" type="primary"
        >暂存</el-button
      >
      <el-button @click="print" type="primary">打印</el-button>
      <el-button
        v-if="!$route.query.id && !form.numbering"
        @click="handleSubmit"
        type="primary"
        v-loading.fullscreen.lock="fullscreenLoading"
        >已签约并提交</el-button
      >
      <el-button v-if="$route.query.id" @click="$router.back()">返回</el-button>
      <!-- <el-button
        @click="openFullScreen1"
        type="primary"
        v-loading.fullscreen.lock="fullscreenLoading"
        >测试</el-button
      > -->
    </div>

    <!-- <el-dialog title="房票编号" :visible.sync="dialogVisible" width="30%">
      <span>上一个房票编号：{{ lastNumber }}</span>
      <el-form ref="ticketNo" :model="form" :rules="rules">
        <el-form-item label="房票编号：" prop="numbering">
          <el-input
            v-model="form.numbering"
            placeholder="请输入房票编号"
          ></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="submitData">确 定</el-button>
      </span>
    </el-dialog> -->
  </div>
</template>

<script>
import { add, getLastNumber, info } from "@/api/ticket";
export default {
  data() {
    return {
      fullscreenLoading: false,
      form: {},
      sumTableData: [],
      printing: false,
      dialogVisible: false,
      lastNumber: undefined,
      rules: {
        numbering: [{ required: true, message: "不能为空", trigger: "blur" }],
      },
    };
  },
  computed: {
    oldContent() {
      // console.log(this.form.housingTicketContent.householdRegistrationDataList);
      let temp = "";
      this.form.housingTicketContent.householdRegistrationDataList.map(
        (item, index) => {
          return item.innerVos.map((ite, idx) => {
            if (idx > 0) {
              temp = temp + ",";
            }
            temp = temp + ite.oldContent + ite.oldContent2;
            // ite.oldContent + ite.oldContent2;
          });
        }
      );
      return temp;
      // return this.form.housingTicketContent.householdRegistrationDataList[0].innerVos.map(item=>item.oldContent+item.oldContent2)
    },
  },
  //   computed:{
  //     sumBoxA() {
  //       return this.data.reduce((acc, obj) => acc + obj.a, 0);
  //     },
  //     sumBoxB() {
  //       return this.data.reduce((acc, obj) => acc + obj.b, 0);
  //     }
  //   },
  created() {
    this.init();
  },
  methods: {
    init() {
      if (this.$route.query.id) {
        this.getInfo();
      } else {
        this.form = JSON.parse(localStorage.getItem("ticket"));
        // console.log();
        this.form.housingTicketContent.boxN =
          this.form.housingTicketContent.boxN.toString().replace(/,/g, "、");

        let sumTableData = [];
        this.form.housingTicketContent.householdRegistrationDataList.map(
          (item) => {
            item.householdRegistrationDataB.map((h) => {
              if (JSON.stringify(h) !== "{}") {
                sumTableData.push(h);
              }
            });
          }
        );
        this.sumTableData = sumTableData;
      }
    },
    getInfo() {
      info(this.$route.query).then((res) => {
        this.form = res.d;
        let sumTableData = [];
        this.form.housingTicketContent.householdRegistrationDataList.map(
          (item) => {
            item.householdRegistrationDataB.map((h) => {
              if (JSON.stringify(h) !== "{}") {
                sumTableData.push(h);
              }
            });
          }
        );

        this.sumTableData = sumTableData;
      });
    },
    // handleCreate() {

    // },
    handleSave() {},
    print() {
      this.printing = true;
      setTimeout(() => {
        window.print();
        this.printing = false;
      }, 100);
    },
    handleSubmit() {
      this.$confirm(`是否确定签约并提交?`, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        // this.form.numbering = 1;
        this.submitData();
      });
      // this.getLastNumber();
      // this.dialogVisible = true;
    },
    async getLastNumber() {
      await getLastNumber().then((res) => {
        this.lastNumber = res.d;
      });
    },
    submitData1() {
      // 暂存
      this.fullscreenLoading = true;
      this.form.housingTicketAgreement =
        document.getElementsByClassName("print-area")[0].innerHTML;
      this.form.number =
        this.form.housingTicketContent.householdRegistrationDataList.reduce(
          (acc, obj) => Number(acc) + Number(obj.boxL),
          0
        );
      add({ ...this.form })
        .then((res) => {
          // this.loading = false;
          this.fullscreenLoading = false;
          this.$message.success("提交成功");
          this.dialogVisible = false;
          setTimeout(() => {
            // window.close();
            this.$router.push({ path: "ticket/list" });
          }, 1000);
        })
        .catch((err) => {
          setTimeout(() => {
            this.fullscreenLoading = false;
          }, 500);
        });
    },
    submitData() {
      // this.loading = true;
      this.fullscreenLoading = true;
      this.form.housingTicketAgreement =
        document.getElementsByClassName("print-area")[0].innerHTML;
      this.form.number =
        this.form.housingTicketContent.householdRegistrationDataList.reduce(
          (acc, obj) => Number(acc) + Number(obj.boxL),
          0
        );
      add({ ...this.form, numbering: 1 })
        .then((res) => {
          // this.loading = false;
          this.fullscreenLoading = false;
          this.$message.success("提交成功");
          this.dialogVisible = false;
          setTimeout(() => {
            // window.close();
            this.$router.push({ path: "ticket/list" });
          }, 1000);
        })
        .catch((err) => {
          setTimeout(() => {
            this.fullscreenLoading = false;
          }, 500);
        });
    },
    numberParseChina(money) {
      //汉字的数字
      var cnNums = ["零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"];
      //基本单位
      var cnIntRadice = ["", "拾", "佰", "仟"];
      //对应整数部分扩展单位
      var cnIntUnits = ["", "万", "亿", "兆"];
      //对应小数部分单位
      var cnDecUnits = ["角", "分", "毫", "厘"];
      //整数金额时后面跟的字符
      var cnInteger = "整";
      //整型完以后的单位
      var cnIntLast = "圆";
      //最大处理的数字
      var maxNum = 999999999999999.9999;
      //金额整数部分
      var integerNum;
      //金额小数部分
      var decimalNum;
      //输出的中文金额字符串
      var chineseStr = "";
      //分离金额后用的数组，预定义
      var parts;
      if (money == "") {
        return "";
      }
      money = parseFloat(money);
      if (money >= maxNum) {
        //超出最大处理数字
        return "";
      }
      if (money == 0) {
        chineseStr = cnNums[0] + cnIntLast + cnInteger;
        return chineseStr;
      }
      //转换为字符串
      money = money.toString();
      if (money.indexOf(".") == -1) {
        integerNum = money;
        decimalNum = "";
      } else {
        parts = money.split(".");
        integerNum = parts[0];
        decimalNum = parts[1].substr(0, 4);
      }
      //获取整型部分转换
      if (parseInt(integerNum, 10) > 0) {
        var zeroCount = 0;
        var IntLen = integerNum.length;
        for (var i = 0; i < IntLen; i++) {
          var n = integerNum.substr(i, 1);
          var p = IntLen - i - 1;
          var q = p / 4;
          var m = p % 4;
          if (n == "0") {
            zeroCount++;
          } else {
            if (zeroCount > 0) {
              chineseStr += cnNums[0];
            }
            //归零
            zeroCount = 0;
            chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
          }
          if (m == 0 && zeroCount < 4) {
            chineseStr += cnIntUnits[q];
          }
        }
        chineseStr += cnIntLast;
      }
      //小数部分
      if (decimalNum != "") {
        var decLen = decimalNum.length;
        for (var i = 0; i < decLen; i++) {
          var n = decimalNum.substr(i, 1);
          if (n != "0") {
            chineseStr += cnNums[Number(n)] + cnDecUnits[i];
          }
        }
      }
      if (chineseStr == "") {
        chineseStr += cnNums[0] + cnIntLast + cnInteger;
      } else if (decimalNum == "") {
        chineseStr += cnInteger;
      }
      return chineseStr;
    },
    // openFullScreen1() {
    //   console.log("openFullScreen1");
    //   this.fullscreenLoading = true;
    //   setTimeout(() => {
    //     this.fullscreenLoading = false;
    //   }, 2000);
    // },
  },
};
</script>

<style scoped lang="scss">
// table {
//   border-collapse: collapse;
// }
td,
th {
  border: 1px solid #000;
  font-size: 14px;
  padding: 8px;
}
p {
  font-family: 仿宋;
}
.printPage {
  width: 842px;
  margin: 0 auto;
  padding: 0 90px;
}
@media print {
  .print-area {
    /* 打印样式 */
  }
}
</style>
