<template>
  <div>
    <el-button type="default" size="mini" @click="dialogFormVisible = true">新 建</el-button>
    <el-dialog title="创建跟进日志" width="600px" append-to-body :visible.sync="dialogFormVisible">
      <el-form :model="form" label-position="top" label-width="80px">
        <el-form-item label="跟进日志">
          <el-input type="textarea" :rows="3" v-model="form.content" placeholder="请输入跟进日志" autocomplete="off"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="small" @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="warning" size="small" @click="ssubmitLog">保 存</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>

export default {
  props:['ownertable'],
  data () {
    return {
      dialogFormVisible:false,
      form:{
        content:''
      }
    }
  },
  methods:{
    async ssubmitLog () {
      const res = await this.$api.requested({
        "id": 20220930121601,
        "content": {
          "sys_datafollowupid":0,
            "ownertable":this.ownertable,
            "ownerid":this.$route.query.id,
            "type":"",
            "content":this.form.content
        }
      })
      this.tool.showMessage(res,()=>{
        this.$emit('onSuccess')
        this.dialogFormVisible = false
      })
    }
  }
}

</script>
<style>
</style>