<template>
  <el-form
    ref="ruleForm"
    :loading="loading"
    :model="ruleForm"
    label-width="100px"
    style="width: 100%"
    class="demo-ruleForm"
  >
    <el-row v-if="ruleForm">
      <el-col :span="12" v-for="item in columnsForm" :key="item.label">
        <el-form-item :label="item.label">
          <el-input
            disabled
            v-model="ruleForm[item.prop]"
            :placeholder="item.label"
          ></el-input>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>
<script>
import resToken from "@/mixins/resToken";
import columnsForm from "./columnsForm";
export default {
  name: "handover",
  props: ["id", "sitem", "newTime"],
  mixins: [resToken],
  data() {
    return {
      columnsForm: columnsForm,
      loading: false,
      ruleForm: null,
      code: "",
    };
  },
  watch: {
    newTime: function (val) {
      if (val) {
        this.initForm();
      }
    },
  },
  mounted() {
    this.initForm();
  },
  methods: {
    async initForm() {
      this.loading = true;
      this.ruleForm = this.sitem;
      this.loading = false;
    },
  },
};
</script>

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