<template>
  <div>
<!--    <p>创建提报中....</p>-->
    <el-button size="small" type="primary"  @click="onshow(drawer=true)">新 建</el-button>
  </div>
</template>

<script>
export default {
  components: {
  },
  data() {
    return {
      drawer:false,
      defaultData: {},
      folderid: JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
      form: {
        "title": "",
        "notes": '初始化数据' + JSON.parse(sessionStorage.getItem('active_account')).userid,
        "istextrequired": 1,
        "isattrequired": 1,
        "onceonly": 1,
        "sat_submiteditmodelid": "0",
        "begdate": (new Date()).toLocaleDateString(),
        "enddate": (new Date()).toLocaleDateString()
      }
    }
  },
  methods: {
    onChecked() { },
    async onSubmit() {
      const res = await this.$api.requested({
        /*"classname": "webmanage.saletool.submitedit.submitedit",
        "method": "insertorupdate",*/
        "id":"20221102093702",
        "content": this.form
      })
      this.$store.dispatch('DrawerShowChange',true)
      res.code === 1 ? this.$router.push({ path: '/submit_add', query: { id: res.data.sat_submiteditmodelid } }) : ''
    },
    onshow(){
      this.drawer = false
      this.onSubmit()
    }

  },
  mounted() {
   /* this.onSubmit()*/
  }
}

</script>
<style>
</style>