<template>
  <el-form :model="form" ref="form">
        <el-form-item
          label="发生时间"
          prop="happenTime"
          :label-width="formLabelWidth"
          :rules="[{ required: true, message: '名称不能为空'}]"
        >
          <!--<el-input v-model="form.happenTime" autocomplete="off" placeholder="请输入格式2019/00/00"></el-input>-->
          <el-date-picker v-model="form.happenTime" type="date" placeholder="选择日期"></el-date-picker>
        </el-form-item>
        <el-form-item
          label="金额"
          prop="amount"
          :label-width="formLabelWidth"
          :rules="[
          { required: true, message: '编码不能为空'}, 
          // { type: 'float', message: '金额必须为数字值'}
        ]"
        >
          <el-input style="width: 35%;" v-model="form.amount" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item
          label="收入状态"
          prop="incomeStatus"
          :label-width="formLabelWidth"
          :rules="[{ required: true, message: '状态不能为空'}]"
        >
          <el-select v-model="form.incomeStatus" placeholder="请选择状态值">
            <el-option key label="无" value></el-option>
            <el-option label="开票/应收" value="INVOICE"></el-option>
            <el-option label="到账" value="ARRIVAL"></el-option>
            <el-option label="内部核算" value="INTERNAL"></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="归属产品" prop="productId" :label-width="formLabelWidth">
          <el-select v-model="form.productId" placeholder="请选择产品">
            <el-option key label="无" value></el-option>
            <el-option
              v-for="item in productSelectData"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="归属项目" prop="projectId" :label-width="formLabelWidth">
          <el-select v-model="form.projectId" placeholder="请选择项目">
            <el-option key label="无" value></el-option>
            <el-option
              v-for="item in projectSelectData"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="来源部门" prop="toDeptId" :label-width="formLabelWidth">
          <el-select v-model="form.toDeptId" placeholder="请选择部门">
            <el-option key label="无" value></el-option>
            <el-option
              v-for="item in teamSelectData"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="来源项目" prop="toProjectId" :label-width="formLabelWidth">
          <el-select v-model="form.toProjectId" placeholder="请选择项目">
            <el-option key label="无" value></el-option>
            <el-option
              v-for="item in projectSelectData"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="归属部门" prop="deptId" :label-width="formLabelWidth">
          <el-select v-model="form.deptId" placeholder="请选择部门" ref="select" @change="getName">
            <el-option key label="无" value></el-option>
            <el-option
              v-for="item in teamSelectData"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="添加备注" prop="remark" :label-width="formLabelWidth">
          <el-input type="textarea" :rows="2" v-model="form.remark" autocomplete="off"></el-input>
        </el-form-item>
      </el-form>
</template>
