<template>
  <div id="statement-print" class="statement-print">
    <div class="statementTitle">广东省社会医疗保险医疗费用结算单</div>
    <table class="statementTable" border="1">
      <tr>
        <td width="80">机构名称</td>
        <td colspan="4">{{info.fixmedins_name}}</td>
        <td width="80">机构编码</td>
        <td colspan="4">{{info.fixmedins_code}}</td>
        <td width="100">医保结算级别</td>
        <td width="100" v-if="info.hosp_lv == '1'">三级特等</td>
        <td width="100" v-if="info.hosp_lv == '2'">三级甲等</td>
        <td width="100" v-if="info.hosp_lv == '3'">三级乙等</td>
        <td width="100" v-if="info.hosp_lv == '4'">三级丙等</td>
        <td width="100" v-if="info.hosp_lv == '5'">二级甲等</td>
        <td width="100" v-if="info.hosp_lv == '6'">二级乙等</td>
        <td width="100" v-if="info.hosp_lv == '7'">二级丙等</td>
        <td width="100" v-if="info.hosp_lv == '8'">一级甲等</td>
        <td width="100" v-if="info.hosp_lv == '9'">一级乙等</td>
        <td width="100" v-if="info.hosp_lv == '10'">一级丙等</td>
        <td width="100" v-if="info.hosp_lv == '11'">无等级</td>
        <td width="100" v-else></td>

      </tr>
      <tr>
        <td width="90">就医登记号</td>
        <td colspan="11">{{info.mdtrt_id}}</td>
      </tr>
      <tr>
        <td width="80">姓名</td>
        <td width="80">{{info.psn_name}}</td>
        <td width="80">性别</td>
        <td width="50" v-if="info.gend == '1'">男</td>
        <td width="50" v-if="info.gend == '2'">女</td>

        <td width="80">出生日期</td>
        <td width="100">{{info.brdy}}</td>
        <td width="90">个人电脑号</td>
        <td width="110">{{info.psn_no}}</td>
        <td width="80">人员类别</td>
        <td colspan="3" v-if="info.psn_type == '11'">在职</td>
        <td colspan="3" v-if="info.psn_type == '1101'">职工在职</td>
        <td colspan="3" v-if="info.psn_type == '1102'">公务员在职</td>
        <td colspan="3" v-if="info.psn_type == '1103'">灵活就业人员在职</td>
        <td colspan="3" v-if="info.psn_type == '1160'">地方其他扩展人员</td>


        <td colspan="3" v-if="info.psn_type == '12'">退休人员</td>
        <td colspan="3" v-if="info.psn_type == '1201'">职工退休</td>
        <td colspan="3" v-if="info.psn_type == '1202'">公务员退休</td>
        <td colspan="3" v-if="info.psn_type == '1203'">灵活就业人员退休</td>
        <td colspan="3" v-if="info.psn_type == '1260'">地方其他扩展人员</td>


        <td colspan="3" v-if="info.psn_type == '13'">离休</td>
        <td colspan="3" v-if="info.psn_type == '1300'">离休人员</td>
        <td colspan="3" v-if="info.psn_type == '1360'">地方其他扩展人员</td>

        <td colspan="3" v-if="info.psn_type == '14'">居民(未成年)</td>
        <td colspan="3" v-if="info.psn_type == '1401'">新生儿</td>
        <td colspan="3" v-if="info.psn_type == '1402'">学龄前儿童</td>
        <td colspan="3" v-if="info.psn_type == '1403'">中小学生</td>
        <td colspan="3" v-if="info.psn_type == '1404'">大学生</td>
        <td colspan="3" v-if="info.psn_type == '1405'">未成年(未入学)</td>


        <td colspan="3" v-if="info.psn_type == '15'">居民(成年)</td>
        <td colspan="3" v-if="info.psn_type == '1501'">普通居民(成年)</td>
        <td colspan="3" v-if="info.psn_type == '1560'">地方其他扩展身份</td>

        <td colspan="3" v-if="info.psn_type == '16'">居民(老年)</td>



      </tr>
      <tr>
        <td>单位名称</td>
        <td colspan="5">{{info.emp_name}}</td>
        <td width="80">联系电话</td>
        <td width="110"></td>
        <td width="80">身份证号</td>
        <td colspan="3">{{info.certno}}</td>
      </tr>
      <tr>
        <td>住院号</td>
        <td>{{info.number}}</td>
        <td>科别</td>
        <td width="100"></td>
        <td>床号</td>
        <td></td>
        <td>入院日期</td>
        <td>{{info.begndate}}</td>
        <td>出院日期</td>
        <td width="100">{{info.enddate}}</td>
        <td>住院天数</td>
        <td>{{getDay(info.begndate,info.enddate) + 1}}</td>

      </tr>
      <tr>
        <td>险种</td>
        <td colspan="2" v-if="info.insutype == '310'">职工基本医疗保险</td>
        <td colspan="2" v-if="info.insutype == '320'">公务员医疗补助</td>
        <td colspan="2" v-if="info.insutype == '330'">大额医疗费用补助</td>
        <td colspan="2" v-if="info.insutype == '340'">离休人员医疗保障</td>
        <td colspan="2" v-if="info.insutype == '390'">城乡居民基本医疗保险</td>
        <td colspan="2" v-if="info.insutype == '392'">城乡居民大病医疗保险</td>
        <td colspan="2" v-if="info.insutype == '510'">生育保险</td>


        <td>入院第一诊断</td>
        <td colspan="3"></td>
        <td>出院第一诊断</td>
        <td colspan="4"></td>
      </tr>
      <tr>
        <td>业务类别</td>
        <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '11'">普通门诊</td>
        <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '12'">门诊挂号</td>
        <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '13'">急诊</td>
        <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '14'">门诊慢性病</td>
        <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '15'">门诊统筹</td>
        <!--        <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '16'">门诊慢性病</td>-->
        <td colspan="5" style="text-align:left;padding-left:10px;" v-if="info.med_type == '21'">普通住院</td>

        <td>结算时间</td>
        <td colspan="5" style="text-align:left;padding-left:10px;">{{info.setl_time.split(' ')[0]}}</td>
      </tr>
      <tr>
        <td colspan="12" style="text-align:left;padding-left:10px;">
          本次就医：总费用{{info.medfee_sumamt}}元，基金支付{{info.fund_pay_sumamt}}元，个人支付{{info.psn_pay}}元。
          (起付线 {{info.act_pay_dedc}}元, 先自付 {{info.preselfpay_amt}}元, 段内自付 )
        </td>
      </tr>
      <tr>
        <td>费用名称</td>
        <td colspan="2">总费用</td>
        <td>自费</td>
        <td colspan="2">部分项目自付</td>
        <td>费用名称</td>
        <td colspan="2">总费用</td>
        <td>自费</td>
        <td colspan="2">部分项目自付</td>
      </tr>
      <tr>
        <td>床位费</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.bed_cost_total}}</td>
        <td style="text-align:right;padding-right:10px;">{{info.bed_cost_self_total}}</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.bed_cost_part_self_total}}</td>
        <td>西成药</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.western_medicine_cost_total}}</td>
        <td style="text-align:right;padding-right:10px;">{{info.western_medicine_cost_self_total}}</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.western_medicine_cost_part_self_total}}</td>
      </tr>
      <tr>
        <td>中药费</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
        <td style="text-align:right;padding-right:10px;">0</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
        <td>中成药</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.chinese_traditional_medicine_cost_total}}
        </td>
        <td style="text-align:right;padding-right:10px;">{{info.chinese_traditional_medicine_cost_self_total}}</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">
          {{info.chinese_traditional_medicine_cost_part_self_total}}
        </td>
      </tr>
      <tr>
        <td>中草药</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
        <td style="text-align:right;padding-right:10px;">0</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
        <td>检查费</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.check_cost_total}}</td>
        <td style="text-align:right;padding-right:10px;">{{info.check_cost_self_total}}</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.check_cost_part_self_total}}</td>
      </tr>
      <tr>
        <td>治疗费</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.treat_cost_total}}</td>
        <td style="text-align:right;padding-right:10px;">{{info.treat_cost_self_total}}</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.treat_cost_part_self_total}}</td>
        <td>放射费</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
        <td style="text-align:right;padding-right:10px;">0</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
      </tr>
      <tr>
        <td>手术费</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.operation_cost_total}}</td>
        <td style="text-align:right;padding-right:10px;">{{info.operation_cost_self_total}}</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.operation_cost_part_self_total}}</td>
        <td>化验费</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.laboratory_cost_total}}</td>
        <td style="text-align:right;padding-right:10px;">{{info.laboratory_cost_self_total}}</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.laboratory_cost_part_self_total}}</td>
      </tr>
      <tr>
        <td>输血费</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
        <td style="text-align:right;padding-right:10px;">0</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
        <td>输氧费</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
        <td style="text-align:right;padding-right:10px;">0</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
      </tr>
      <tr>
        <td>其他</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.other_cost_total}}</td>
        <td style="text-align:right;padding-right:10px;">{{info.other_cost_self_total}}</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.other_cost_part_self_total}}</td>
        <td>麻醉费</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
        <td style="text-align:right;padding-right:10px;">0</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
      </tr>
      <tr>
        <td>材料费</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.material_cost_total}}</td>
        <td style="text-align:right;padding-right:10px;">{{info.material_cost_self_total}}</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{info.material_cost_part_self_total}}</td>
        <td>特殊检查费</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
        <td style="text-align:right;padding-right:10px;">0</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
      </tr>
      <tr>
        <td>特殊治疗费</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
        <td style="text-align:right;padding-right:10px;">0</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">0</td>
        <td style="text-align:right;padding-right:10px;"></td>
        <td colspan="2" style="text-align:right;padding-right:10px;"></td>
        <td style="text-align:right;padding-right:10px;"></td>
        <td colspan="2" style="text-align:right;padding-right:10px;"></td>
      </tr>
      <tr>
        <td>合计</td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{(parseFloat(info.bed_cost_total) +
            parseFloat(info.operation_cost_total) + parseFloat(info.other_cost_total) +
            parseFloat(info.material_cost_total) + parseFloat(info.western_medicine_cost_total) +
            parseFloat(info.chinese_traditional_medicine_cost_total) + parseFloat(info.check_cost_total) +
            parseFloat(info.laboratory_cost_total) + parseFloat(info.treat_cost_total)).toFixed(2) }}
        </td>
        <td style="text-align:right;padding-right:10px;">{{(parseFloat(info.bed_cost_self_total )+
            parseFloat(info.operation_cost_self_total) + parseFloat(info.other_cost_self_total) +
            parseFloat(info.material_cost_self_total) + parseFloat(info.western_medicine_cost_self_total) +
            parseFloat(info.chinese_traditional_medicine_cost_self_total) + parseFloat(info.check_cost_self_total) +
            parseFloat(info.laboratory_cost_self_total) + parseFloat(info.treat_cost_self_total)).toFixed(2)}}
        </td>
        <td colspan="2" style="text-align:right;padding-right:10px;">{{(parseFloat(info.bed_cost_part_self_total) +
            parseFloat(info.operation_cost_part_self_total) + parseFloat(info.other_cost_part_self_total) +
            parseFloat(info.material_cost_part_self_total) + parseFloat(info.western_medicine_cost_part_self_total) +
            parseFloat(info.chinese_traditional_medicine_cost_part_self_total) +
            parseFloat(info.check_cost_part_self_total) + parseFloat(info.laboratory_cost_part_self_total) +
            parseFloat(info.treat_cost_part_self_total)).toFixed(2)}}
        </td>
        <td style="text-align:right;padding-right:10px;"></td>
        <td colspan="2" style="text-align:right;padding-right:10px;"></td>
        <td style="text-align:right;padding-right:10px;"></td>
        <td colspan="2" style="text-align:right;padding-right:10px;"></td>
      </tr>
      <tr>
        <td colspan="3" style="text-align:left;padding-left:10px;">基本医疗保险统筹基金支付</td>
        <td colspan="3">{{info.hifp_pay}}</td>
        <td colspan="3" style="text-align:left;padding-left:10px;">大额基金支付</td>
        <td colspan="3">{{info.hifob_pay}}</td>
      </tr>
      <tr>
        <td colspan="3" style="text-align:left;padding-left:10px;">大病基金支付</td>
        <td colspan="3">{{info.hifmi_pay}}</td>
        <td colspan="3" style="text-align:left;padding-left:10px;">补充保险基金支付</td>
        <td colspan="3">{{info.hifes_pay}}</td>
      </tr>
      <tr>
        <td colspan="3" style="text-align:left;padding-left:10px;">医疗救助基金支付</td>
        <td colspan="3">{{info.maf_pay}}</td>
        <td colspan="3" style="text-align:left;padding-left:10px;">公务员基金支付</td>
        <td colspan="3">{{info.cvlserv_pay}}</td>
      </tr>
      <tr>
        <td>收款人:</td>
        <td colspan="2">{{info.charge_admin.user_name}}</td>
        <td>审核人:</td>
        <td colspan="2">{{info.p_admin.user_name}}</td>
        <td>制单人:</td>
        <td colspan="2">{{info.p_admin.user_name}}</td>
        <td>打印日期</td>
        <td colspan="2">{{getNowTime()}}</td>
      </tr>
      <tr>
        <td colspan="12" style="text-align:left;padding-left:10px;line-height:20px;">
          注: 1、部分项目自付金额是指基本医疗保险范围内的项目需参保人先按规定比例自付的金额。<br/>
          &ensp;&ensp;&ensp;2、此表由医院打印。<br/>
          &ensp;&ensp;&ensp;3、此表一式两份，医院、参保人各一份。
        </td>
      </tr>
      <tr>
        <td colspan="12" style="text-align:left;padding-left:10px;">
          病人家属签字:
        </td>
      </tr>
    </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 {}
      }
    }
  },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;
  border-color: #000;
}
</style>
