<template>
  <div id="statement-print" class="statement-print">
    <table class="statementTable" border="0">
      <thead>
      <tr>
        <td colspan="10">石狮圣誉血液透析中心结算单</td>
      </tr>
      </thead>

      <tbody>
      <tr>
        <td colspan="10">日期：{{info.setl_time ? info.setl_time.split(' ')[0] : ''}}</td>
      </tr>
      <tr class="view_tr">
        <td colspan="2">姓名：{{info.patient.name}}</td>
        <td colspan="2">性别：{{info.patient.gender == 1 ? '男': '女'}}</td>
        <td colspan="2">医保类型：{{info.insutype == '390'?'城乡居民基本医疗保险':'职工基本医疗保险'}}</td>
        <td colspan="2">社会保障号码：{{info.certno}}</td>
        <td colspan="2">账号余额：{{info.blac}}</td>
      </tr>
      <tr class="view_tr">
        <td colspan="10">明细信息</td>
      </tr>

        <!-- 帐单列表分为左右两列，需要对数据进行x/2分别放进list_L，list_R两个数组进行循环 -->
        <tr>
<!--          <td colspan="24">-->
<!--            <template v-for="(v, i) in info.list" >-->
<!--              <el-row gutter="24" >-->
<!--                <el-col span="12" :key="i" v-if='i%2 == 0'>-->
<!--                  <table class="list_table">-->
<!--                    <template>-->
<!--                      <tr colspan="12">-->
<!--                        <td colspan="2">{{v.name}}</td>-->
<!--                        <td>{{v.spec}}</td>-->
<!--                        <td>{{v.cnt}}</td>-->
<!--                        <td>{{v.det_item_fee_sumamt}}</td>-->
<!--                      </tr>-->
<!--                    </template>-->
<!--                  </table>-->
<!--                </el-col>-->
<!--                <el-col span="12" v-if="i+1 < info.list.length">-->
<!--                  <table class="list_table">-->
<!--                    <template >-->
<!--                      <tr colspan="12">-->
<!--                        <td colspan="2">{{v.name}}</td>-->
<!--                        <td>{{v.spec}}</td>-->
<!--                        <td>{{v.cnt}}</td>-->
<!--                        <td>{{v.det_item_fee_sumamt}}</td>-->
<!--                      </tr>-->
<!--                    </template>-->
<!--                  </table>-->
<!--                </el-col>-->
<!--              </el-row>-->
<!--            </template>-->
<!--          </td>-->
        <tr>
<!--          <td colspan="6">-->
<!--            <table class="list_table">-->
<!--              <tr>-->
<!--                <td colspan="2">{{'名称'}}</td>-->
<!--                <td>{{'规格'}}</td>-->
<!--                <td>{{'数量'}}</td>-->
<!--                <td>{{'价格'}}</td>-->
<!--              </tr>-->
<!--              <tr colspan="6" v-for="(v, index) in info.L_list" :key="index">-->
<!--                <td colspan="2">{{v.name}}</td>-->
<!--                <td>{{v.spec}}</td>-->
<!--                <td>{{v.cnt}}</td>-->
<!--                <td>{{v.det_item_fee_sumamt}}</td>-->
<!--              </tr>-->
<!--            </table>-->
<!--          </td>-->
        <td colspan="6">
          <table class="list_table">
            <tr>

            </tr>
            <tr colspan="6" v-for="(v, index) in info.L_list" :key="index">
              <td colspan="2">{{v.name}}</td>
              <td>{{v.spec}}</td>
              <td>{{v.cnt}}</td>
              <td>{{v.det_item_fee_sumamt}}</td>
            </tr>
          </table>
        </td>

          <td colspan="6">
            <table class="list_table">
              <tr>

              </tr>
              <tr colspan="6" v-for="(v, index) in info.R_list" :key="index">
                <td colspan="2">{{v.name}}</td>
                <td>{{v.spec}}</td>
                <td>{{v.cnt}}</td>
                <td>{{v.det_item_fee_sumamt}}</td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
<!--          <td colspan="10">共一页，第一页{{// info.medfee_sumamt}}</td>-->
        </tr>
        <tr class="dashed_tr">
          <td colspan="10">结付分类</td>
        </tr>
        <tr>
          <td colspan="10">
            <div>费用总计：{{info.medfee_sumamt}}</div>
            <div>统筹支付：{{info.fund_pay_sumamt}}</div>
            <div>账户支付：{{info.acct_pay}}</div>
            <div>个人现金支付：{{info.cash_payamt}}</div>
            <div>其他支付：{{info.oth_pay}}</div>
            <div>减免金额：</div>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</template>
<script>
export default {
  props: {
    info: {
      type: Object,
      default: function () {
        return {};
      },
    },
    p_admin: {
      type: Object,
      default: function () {
        return {};
      },
    },
    charge_admin: {
      type: Object,
      default: function () {
        return {};
      },
    },
  },
  data() {
    return {
      list:[1,2,3],
      list_L: [1,2],
      list_R: [1,2],
    };
  },
  methods: {
    getDay(dateString1, dateString2) {
      var startDate = Date.parse(dateString1);
      var endDate = Date.parse(dateString2);
      if (startDate > endDate) {
        return 0;
      }
      if (startDate == endDate) {
        return 1;
      }
      var days = (endDate - startDate) / (1 * 24 * 60 * 60 * 1000);
      return days;
    },
    getNowTime: function () {
      let dateTime;
      let yy = new Date().getFullYear();
      let mm = new Date().getMonth() + 1;
      let dd = new Date().getDate();
      let hh = new Date().getHours();
      let mf =
        new Date().getMinutes() < 10
          ? "0" + new Date().getMinutes()
          : new Date().getMinutes();
      let ss =
        new Date().getSeconds() < 10
          ? "0" + new Date().getSeconds()
          : new Date().getSeconds();
      dateTime = yy + "-" + mm + "-" + dd + " " + hh + ":" + mf + ":" + ss;
      return dateTime;
    },
  },
};
</script>


<style lang="scss" scoped>
  .statement-print {
    -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
    0 0 60px rgba(0, 0, 0, 0.06) inset;
    -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
    0 0 40px rgba(0, 0, 0, 0.06) inset;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
    margin-bottom: 20px;
    padding: 20px 10px;
  }

  .statementTitle {
    font-size: 28px;
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
  }

  .statementTable {
    width: 100%;
    text-align: center;
    border-collapse: collapse;
    line-height: 40px;
    font-size: 14px;
  }
  .statementTable thead{
    font-size: 28px;
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
  }

  .statementTable tbody{
    text-align: left;
  }
  tbody .view_tr{
    border: 1px solid;
    text-align: center;
  }
  .list_table{
    width: 100%;
    margin-bottom: 100px;
  }
  tbody .dashed_tr{
    border: 1px dashed;
    text-align: center;
  }
  tbody tr td div{
    height: 25px;
  }
</style>
