<template>
  <el-form
    label-width="160px"
    :model="form"
    ref="form"
    label-suffix=": "
  >
    <el-form-item
      label="缴费类型"
      prop="leixing"
      :rules="[{required: true, message: '请选择缴费类型', trigger: 'change'}]"
      v-if="typeof paymentType === 'undefined'&&courseViewType != 1"
    >
      <el-radio-group style="width: 100%" v-model="form.leixing">
        <el-radio label="1">乐团续费</el-radio>
        <el-radio label="2">临时加课</el-radio>
      </el-radio-group>
    </el-form-item>
    <!-- !this.rowDetail&& -->
    <el-form-item
      label="收费标准"
      prop="musicGroupOrganizationCourseSettingId"
      v-if="isCommon && form.musicGroupOrganizationCourseSettingId != 0 && courseViewType != 1"
      :rules="[{required: true, message: '请选择收费标准', trigger: 'change'}]"
    >
      <el-select style="width: 100%!important;" v-model="form.musicGroupOrganizationCourseSettingId" placeholder="请选择收费标准">
        <el-option
          v-for="item in charges"
          :key="item.id"
          :label="item.name"
          :value="item.id">
        </el-option>
      </el-select>
    </el-form-item>
    <!-- && !rowDetail -->
    <el-alert
      :closable="false"
      style="margin-left: 160px;width: auto; margin-bottom:20px;"
      v-if="paymentType != 0 && isCommon &&courseViewType != 1"
      type="warning">
      <template #title>
        <p>该乐团为{{chargeTypeName}}模式，若需创建其他模式的收费标准，请先修改乐团基本信息中的乐团模式
          <strong style="font-weight: 600;margin-left: 10px;cursor: pointer;" @click="changeActive">立即修改>></strong>
      </p>
      </template>
    </el-alert>
  </el-form>
</template>
<script>
export default {
  props: ['form', 'isCommon', 'isUserType', 'typeList', 'charges', 'paymentType', 'chargeTypeName', 'rowDetail','courseViewType'],
  mounted() {

  },
  watch: {
    paymentType() {
      console.log(this.paymentType)
    }
  },
  methods:{
    changeActive(){
      this.$listeners.changeActive({name: '1'})
    }
  }
}
</script>
<style lang="less" scoped>
.number-input{
  /deep/ .el-input__inner {
    text-align: left;
  }

  width: 100%;
}
</style>
