 
<template>
  <q-dialog v-model="persistent" content-class="bg-grey-1" persistent transition-show="scale">
    <q-card style="width: 600px;max-width:900px;" class="CLM-Form">
      <q-card-section>
        <div class="text-h6">员工建议</div>
      </q-card-section>
      <q-card-section class="q-pt-none scroll" style="max-height: 70vh">
 
        <div class="row wrap">
          <div class="col-12">
            <q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.Help"
              class="col-12 q-pr-lg q-pb-lg" label="您的上级怎样帮助你，将使你未来的工作绩效更高" />
          </div>
        </div>
        <div class="row wrap">
          <div class="col-12">
            <q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.Suggest"
              class="col-12 q-pr-lg q-pb-lg" label="对公司的发展有什么建议" />
          </div>
        </div>
 
        <div class="row wrap">
          <div class="col-12">
            <q-input filled stack-label maxlength="20" :dense="false" v-model="objOption.Other"
              class="col-12 q-pr-lg q-pb-lg" label="其他意见" />
          </div>
        </div>
      </q-card-section>
      <q-separator />
      <q-card-actions align="right" class="bg-white">
        <q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="closeHelpForm" />
        <q-btn label="提交" color="accent q-px-md" style="font-weight:400 !important" :loading="saveHelpLoading"  @click="saveHelp">
        </q-btn>
      </q-card-actions>
    </q-card>
  </q-dialog>
</template>
<script>
  import {
    setTeacherHelp
  } from '../../api/teacher/index';
  export default {
    components: {},
    props: {
      saveObj: {
        type: Object,
        default: null
      }
    },
    data() {
      return {
        persistent: true,
        saveHelpLoading: false,   
        objOption: {
          Id: 0,
          Help: "",
          Suggest: "",
          Other: "",
        },
      }
    },
    created() {

    },
    mounted() {
      this.initData();
    },
    methods: {
      initData() {
        this.objOption.Id = this.saveObj.Id;
        this.objOption.Help=this.saveObj.Help;
        this.objOption.Suggest=this.saveObj.Suggest;
        this.objOption.Other=this.saveObj.Other;
      },
      //关闭弹窗
      closeHelpForm() {
        this.$emit('close')
        this.persistent = false
      },
      //保存信息
      saveHelp() {
        this.saveHelpLoading = true;
        setTeacherHelp(this.objOption).then(res => {
          this.saveHelpLoading = false;
          if (res.Code == 1) {
            this.$q.notify({
              icon: 'iconfont icon-chenggong',
              color: 'accent',
              timeout: 2000,
              message: '数据保存成功！',
              position: 'top'
            })
            this.$emit('success');
            this.$emit('close');
          }
        });
      },
    },
  }
</script>