<template>
  <div>
    <!-- 选择仲裁方式页面 -->
    <el-dialog
      title="开庭方式"
      :visible="showchoosetrialmethod"
      width="500px"
      @close="cancel"
      :destroy-on-close="true"
    >
      <div class="radiobox">
        <el-radio-group v-model="radio">
          <el-radio :label="2">书面审理</el-radio>
          <el-radio :label="1">开庭审理</el-radio>
        </el-radio-group>
      </div>

      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">提 交</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { arbitrateMethod } from "@/api/caseManagement/caseManagement.js";
export default {
  name: "showchoosetrialmethodDialog",
  props: ["showchoosetrialmethod", "choosetrialmethodata"],
  data() {
    return {
      radio: 2,
    };
  },
  methods: {
    // 提交开庭方式 arbitrateMethod
    submitForm() {
      let paramsdata = {
        arbitratMethod: this.radio,
      };
      let id = {
        id: this.choosetrialmethodata.id,
      };
      arbitrateMethod(paramsdata, id)
        .then((res) => {
          this.$modal.msgSuccess("提交成功");
          this.cancel();
          this.$emit("getcaseApply");
        })
        .catch((err) => {});
    },
    cancel() {
      this.$emit("cancelshowchoosetrialMethod");
    },
  },
};
</script>

<style lang="scss" scoped>
.radiobox {
  margin-left: 5%;
}
</style>