<template>
  <div>
    <el-form ref="bargeForm" :model="bargeObj" label-width="80px">
      <el-form-item label="驳船">
        <el-radio-group v-model="bargeObj.status">
          <el-radio v-for="item in bargeStatus" :key="item.value" :label="item.value">{{item.label}}</el-radio>
        </el-radio-group>
      </el-form-item>

      <div v-show="bargeObj.status === '2'">
        <el-row>
          <el-col :span="12">
            <el-form-item label="驳船预计开船时间" label-width="130px">
              <el-date-picker type="date" placeholder="请选择日期" v-model="bargeObj.expectedTime"></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="通知人" label-width="80px">
              <el-select v-model="bargeObj.feedTimePerson" placeholder="请选择通知人">
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="驳船实际开船时间" label-width="130px">
          <el-date-picker type="date" placeholder="请选择日期" v-model="bargeObj.actualTime"></el-date-picker>
        </el-form-item>
      </div>
    </el-form>

    <el-row class="operate-button">
      <el-button type="primary">保存</el-button>
      <el-button type="success" @click="onSubmit">提交</el-button>
      <el-button @click="cancel">关闭</el-button>
    </el-row>
  </div>
</template>

<script>
/**
 * 驳船
 */
export default {
  name: "barge",
  data() {
    return {
      // 驳船对象
      bargeObj: {},
      // 驳船
      bargeStatus: [
        {
          value: "1",
          label: "无驳船",
        },
        {
          value: "2",
          label: "有驳船",
        },
      ],
    };
  },
  methods: {
    /** 提交 */
    onSubmit() {
      this.$refs["bargeForm"].validate((valid) => {
        if (valid) {
          alert("submit!");
        }
      });
    },
    /** 取消 */
    cancel() {
      this.$emit("closeDialog");
    },
  },
};
</script>

<style lang="scss" scoped>
</style>
