<template>
  <div>
    基本信息
    <br />
    <span>
      编号:{{setingObj.BackNum}}
    </span>
    <br />
    <span>
      申请人:{{setingObj.CreateByName}}
    </span>
    <br />
    <span>
      学员姓名:{{setingObj.GuestName}}
    </span>
    <br />
    <span>
      申请时间:{{setingObj.CreateTimeStr}}
    </span>

    <br />
    <br />
    教学信息
    <br />
    <span>
      校区:{{setingObj.SchoolName}}
    </span>
    <br />
    <span>
      班级名称:{{setingObj.ClassName}}
    </span>
    <br />
    <span>
      代课老师:{{setingObj.TeacherName}}
    </span>
    <br />
    <span>
      学习课程:{{setingObj.CourseName}}
    </span>

    <br />
    <br />学习信息
    <br />
    <span>
      学习课时:{{setingObj.FinishHours}} 课时
    </span>
    <br />
    <span>
      缺勤次数:暂无
    </span>
    <br />
    <span>
      考试评分:暂无
    </span>

    <br />
    <br />
    其他信息
    <br />
    <span>
      关联订单号:{{setingObj.OrderId}}
    </span>
    <br />
    <span>
      关联销售:{{setingObj.EnterName}}
    </span>
    <br />
    <span>
      语句退课费用:{{setingObj.BackMoney}}
    </span>
    <br />

    <span>
      申请原因:{{setingObj.ApplyReason}}
    </span>

    <br />
    <template v-if="showType==1">
      <span>
        退课金额: {{setingObj.BackMoney}}
      </span>
    </template>
    <template v-if="showType==2">
      <span>
        <q-input filled stack-label :dense="false" v-model="backBillMsg.BackMoney" class="col-12" label="退课金额"
          :rules="[val => !!val || '请填退课金额']" />
      </span>
    </template>

    <br />
    <div>
      抄送:
      RecipientIds
      <q-btn class="q-mr-md" label="取消" @click="closeBackInfo" />
      <q-btn v-if="showType==2" label="确认" @click="saveBackClassInfo()" />
    </div>
    <span v-if="showType==2">
      审批意见:
      <q-radio v-model="backBillMsg.AuditStatus" :val="2" label="通过" />
      <q-radio v-model="backBillMsg.AuditStatus" :val="3" label="驳回" />
      <q-input filled stack-label :dense="false" v-model="backBillMsg.Description" type="textarea" label="审批意见" />
    </span>
  </div>
</template>

<script>
  import {
    saveBackBillAduit
  } from '../../api/sale/bill'
  export default {
    props: {
      setingObj: {
        type: Object,
        default: null
      },
      showType: {
        type: Number,
        default: 1
      }
    },
    components: {

    },
    data() {
      return {
        persistent: true,
        backBillMsg: {
          BackId: 0,
          BackMoney: 0, //实际退款金额
          Description: "", //审批意见
          AuditStatus: 0, //审核状态
        },
      }
    },
    created() {},
    mounted() {
      this.backBillMsg.BackId = this.setingObj.BackId;
      console.log("setingObj", this.setingObj);
    },
    methods: {
      closeBackInfo() {
        this.persistent = false;
        this.$emit('close');
      },
      //退课单据审核
      saveBackClassInfo() {
        saveBackBillAduit(this.backBillMsg).then(res => {
          console.log("res", res);
        })
      }
    },
  }

</script>
