<template>
  <div>
    <el-form ref="ruleForm" :model="ruleForm" label-width="80px">
      <el-form-item label="状态" prop="state">
        <el-select v-model="ruleForm.state" clearable placeholder="请选择状态" class="form_select">
          <el-option label="有异议" :value="1"></el-option>
          <el-option label="最终已确认" :value="5"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="备注">
        <el-input v-model="ruleForm.remark" type="textarea" placeholder="有异议叙述,20字以内"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="submitForm()">提交</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>

import { appealStaffPerformance } from "@/api/reportFormManagement/staffPerformance/staffPerformance";

export default {
  props: {
    rowid: {
      type: String,
      default: "",
    },
    layerid: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      ruleForm: {
        id: "", //订单编号
        state: "", //绩效状态
        remark: "", //备注
      },
    };
  },
  created() {
    if (this.rowid) {
      this.ruleForm.id = this.rowid;
    }
  },
  methods: {
    submitForm() {
      appealStaffPerformance(this.ruleForm)
        .then((response) => {
          if (response.state.toLowerCase() === "success") {
            this.$parent.$layer.close(this.layerid);
            this.$parent.getList(); // 重新加载父级数据
            this.$message.success("恭喜你，申诉成功!");
          }
        })
        .catch(() => {
          this.loading = false;
        });
    },
  },
};
</script>
<style lang="scss" scoped>
.form_select {
  width: 100%;
}
</style>