<template>
  <div id="statement-print" class="statement-print">
    <div class="statementTitle">费用明细清算单</div>
    <div class="statementTable" style="word-wrap: break-word; word-break: break-all;">
      <table border="1" style="border-collapse: collapse;width: 100%;border: none;">
        <tr>
          <td colspan="4">医院机构名称：{{info.fixmedins_name}}</td>
          <td colspan="4">发票号：</td>
        </tr>
        <tr style="border-bottom: 1px solid black;">
          <td colspan="2">单据编码：{{info.number}}</td>
          <td colspan="4">就诊时间：{{getTime(info.new_order.settle_accounts_date,"{y}-{m}-{d}")}}</td>
          <td colspan="3">金额单位：{{info.medfee_sumamt}}元</td>
        </tr>
        <tr>
          <td colspan="4">姓名：{{info.patient.name}}</td>
          <td colspan="4">身份证号：{{info.patient.id_card_no}}</td>
        </tr>
        <tr>
          <td colspan="8">诊断：{{info.diagnosis}}</td>
        </tr>
        <tr style="border-bottom: 1px solid black;">
          <td colspan="4" v-if="info.psn_type == '11'">人员类别：在职</td>
          <td colspan="4"  v-else-if="info.psn_type == '1101'">人员类别：职工在职</td>
          <td colspan="4" v-else-if="info.psn_type == '1102'">人员类别：公务员在职</td>
          <td colspan="4" v-else-if="info.psn_type == '1103'">人员类别：灵活就业人员在职</td>
          <td colspan="4" v-else-if="info.psn_type == '1160'">人员类别：地方其他扩展人员</td>
          <td colspan="4" v-else-if="info.psn_type == '12'">人员类别：退休人员</td>
          <td colspan="4" v-else-if="info.psn_type == '1201'">人员类别：职工退休</td>
          <td colspan="4" v-else-if="info.psn_type == '1202'">人员类别：公务员退休</td>
          <td colspan="4" v-else-if="info.psn_type == '1203'">人员类别：灵活就业人员退休</td>
          <td colspan="4" v-else-if="info.psn_type == '1260'">人员类别：地方其他扩展人员</td>
          <td colspan="4" v-else-if="info.psn_type == '13'">人员类别：离休</td>
          <td colspan="4" v-else-if="info.psn_type == '1300'">人员类别：离休人员</td>
          <td colspan="4" v-else-if="info.psn_type == '1360'">人员类别：地方其他扩展人员</td>
          <td colspan="4" v-else-if="info.psn_type == '14'">人员类别：居民(未成年)</td>
          <td colspan="4" v-else-if="info.psn_type == '1401'">人员类别：新生儿</td>
          <td colspan="4" v-else-if="info.psn_type == '1402'">人员类别：学龄前儿童</td>
          <td colspan="4" v-else-if="info.psn_type == '1403'">人员类别：中小学生</td>
          <td colspan="4" v-else-if="info.psn_type == '1404'">人员类别：大学生</td>
          <td colspan="4" v-else-if="info.psn_type == '1405'">人员类别：未成年(未入学)</td>
          <td colspan="4" v-else-if="info.psn_type == '15'">人员类别：居民(成年)</td>
          <td colspan="4" v-else-if="info.psn_type == '1501'">人员类别：普通居民(成年)</td>
          <td colspan="4" v-else-if="info.psn_type == '1560'">人员类别：地方其他扩展身份</td>
          <td colspan="4" v-else-if="info.psn_type == '16'">人员类别：居民(老年)</td>
          <td colspan="4" v-else></td>
          <td colspan="4" v-if="info.insutype == '310'">险种类型：职工基本医疗保险</td>
          <td colspan="4" v-if="info.insutype == '320'">险种类型：公务员医疗补助</td>
          <td colspan="4" v-if="info.insutype == '330'">险种类型：大额医疗费用补助</td>
          <td colspan="4" v-if="info.insutype == '340'">险种类型：离休人员医疗保障</td>
          <td colspan="4" v-if="info.insutype == '390'">险种类型：城乡居民基本医疗保险</td>
          <td colspan="4" v-if="info.insutype == '392'">险种类型：城乡居民大病医疗保险</td>
          <td colspan="4" v-if="info.insutype == '510'">险种类型：生育保险</td>
          <td colspan="4" v-else></td>


        </tr>
        <tr style="border-bottom: 1px solid black;text-align: center;">
          <td width="15.1%">医保编码</td>
          <td width="9.1%">医院编码</td>
          <td width="15.1%">医院名称</td>
          <td width="6.1%">单位</td>
          <td width="15.1%">规格</td>
          <td width="6.1%">数量</td>
          <td width="8.1%">单价</td>
          <td width="8.1%">金额</td>
           <td width="10.1%">医保标识</td>


        </tr>
        <!-- width="72.6%"  16.82%  16.1-->
        <tr>
          <td colspan="9" style="line-height: 30px;">
            <div v-for="item in info.new_list">
              <div style="display: flex;border-bottom: 1px solid black;font-size: 16px;font-weight: bolder;">
                <div style="width: 67.6%;">{{item.med_chrgitm_name}}</div>
                <div style="width: 8.1%;text-align: center;">小计</div>
                <div style="width: 8.1%;text-align: center;">{{item.total}}</div>
              </div>
              <div v-for="subItem in item.details" style="display: flex; border-bottom: 1px solid black;">
                <div style="width: 16.4%;padding: 5px;">{{subItem.yibao_code}}</div>
                <div style="width: 9.9%;padding: 5px;">{{subItem.yiyuan_code}}</div>
                <div style="width: 16.4%;padding: 5px;">{{subItem.name}}</div>
                <div style="width: 6.7%;padding: 5px;text-align: center;">{{subItem.unit}}</div>
                <div style="width: 16.4%;padding: 5px;">{{subItem.spec}}</div>
                <div style="width: 6.7%;padding: 5px;text-align: center;">{{subItem.count}}</div>
                <div style="width: 8.1%;padding: 5px;text-align: center;">{{subItem.price}}</div>
                <div style="width: 8.1%;padding: 5px;text-align: center;">{{subItem.total_price}}</div>
                 <div style="width: 10.1%;padding: 5px;"></div>

              </div>
            </div>
          </td>
        </tr>
        <tr style="border-bottom: 1px solid black; font: 16px bolder;">
          <td colspan="8">合计：{{info.medfee_sumamt}}</td>
        </tr>
        <tr>
          <td colspan="8">医保基金支付金额：{{info.fund_pay_sumamt}}</td>
        </tr>
        <tr style="border-bottom: 1px solid black;">
          <td colspan="8">个人现金支付金额：{{info.psn_cash_pay}}</td>
        </tr>
        <tr>
          <td colspan="2" >家属或参保人签名：</td>
          <td colspan="2" >收费员签名：</td>
          <td colspan="2" >医院盖章：</td>
        </tr>
        <tr>
          <td colspan="8" style="padding-top: 40px;">医师签名：</td>
        </tr>
      </table>
    </div>
  </div>
</template>
<script>
import { uParseTime } from '@/utils/tools'

export default {
  data() {
    return {
      list: {},
      prescription: [],
      patient: {},
      orgname: '',

      result: {},
      org_code: '',
      patient_name: '',
      doctor_code: '',
      doctor_name: '',

      name_arr: [],
      spec_arr: [],
      count_arr: [],
      price_arr: [],
      total_arr: []

    }
  },
  props: {
    paramsObj: Object,
    info: {
      type: Object,
      default: function() {
        return {}
      }
    },
    balanceAccounts: Object
  },
  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;
    },
    getTime(value, temp) {
      if (value != undefined) {
        return uParseTime(value, temp)
      }
      return ''
    }
  },
  mounted() {


  },
  watch: {
    paramsObj: {//深度监听，可监听到对象、数组的变化
      handler(val, oldVal) {


      },
      deep: true
    }
  }
}
</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%;
  font-size: 14px;
  table tr td{
    padding: 5px;
    line-height: 30px;
    border: none;
  }
}

</style>
