<template>
  <basic-container>
    <avue-form :option="option" v-model="form" @submit="handleSubmit"/>
  </basic-container>
</template>

<script>
  import { examineApproveSubmit } from "@/api/examineApprove/interface";
    export default {
        name: "start",
      props:{
        processDefinitionId:{
          type:String
        }
      },
      data(){
        return {
          form: {},
          option: {
            group: [
              {
                column: [
                  {
                    label: '第一级审批人',
                    prop: 'checkUser',
                    type: 'select',
                    dicUrl: `/api/blade-user/user-list`,
                    props: {
                      label: "account",
                      value: "id"
                    },
                    span: 6,
                    rules: [
                      {
                        required: true,
                        message: '请选择第一级审批人',
                        trigger: 'blur'
                      }
                    ]
                  },
                  {
                    label: '第二级审批人',
                    prop: 'checkSecondsUser',
                    type: 'select',
                    dicUrl: `/api/blade-user/user-list`,
                    props: {
                      label: "account",
                      value: "id"
                    },
                    span: 6,
                    rules: [
                      {
                        required: true,
                        message: '请选择第二级审批人',
                        trigger: 'blur'
                      }
                    ]
                  },
                  {
                    label: '备注',
                    prop: 'reason',
                    type: 'textarea',
                    span: 6,
                    rules: [
                      {
                        required: true,
                        message: '请输入请假理由',
                        trigger: 'blur'
                      }
                    ]
                  },
                ]
              },
            ],
          }
        }
      },
      methods:{
        handleSubmit(){
          this.form.processDefinitionId = this.processDefinitionId
          examineApproveSubmit(this.form).then(res =>{
            console.log(res)
          })
        }
      }
    }
</script>

<style scoped>
  .startFrom-input{
    display:flex;
    justify-content:center;
  }
</style>
