<template>
  <div>
    <a-table
      class="mar-bottom10"
      :columns="columns"
      :locale="{ emptyText: 'No Data' }"
      :data-source="conditionList"
      row-key="mrnNo"
      :pagination="false"
    ></a-table>
  </div>
</template>

<script>
export default {
  props: {
    formData: {
      default: {},
    },
  },
  data() {
    const columns = [
      { title: "频率", dataIndex: "frequencyCode" },
      { title: "条件", dataIndex: "limitCode" },
      { title: "最小值", dataIndex: "minValue" },
      { title: "最大值", dataIndex: "maxValue" },
      { title: "家庭最大值", dataIndex: "familyMaxValue" },
      {
        title: "操作",
        key: "operation",
        width: "175px",
        fixed: "right",
        scopedSlots: { customRender: "operation" },
      },
    ];
    return {
      columns,
      conditionList: [],
    };
  },
  mounted() {
    this._getConditionList();
  },
  methods: {
    _getConditionList() {
      const {
        planCode,
        payorCode,
        coverageCode,
        corpCode,
        benefitCode,
        conditionType,
      } = this.formData;
      const data = {
        planCode,
        payorCode,
        coverageCode,
        corpCode,
        benefitCode,
        conditionType,
      };
      this.$apis.GETCONDITIONLIST(data).then((res) => {
        this.conditionList = res.content || [];
      });
    },
  },
};
</script>

<style></style>
