<!--
 * @Author: zwq
 * @Date: 2021-11-18 14:16:25
 * @LastEditors: zwq
 * @LastEditTime: 2023-07-03 10:38:52
 * @Description:
-->
<template>
    <base-table border :table-props="tableProps" :table-data="tableData" />
</template>

<script>
import i18n from "@/i18n";
import codeFilter from "@/filters/code-filter";
import { timeFormatter } from "@/filters/code-filter";
const tableProps = [
  {
    prop: "containmentLocale",
    label: "遏制区域设置",
    align: "center",
    filter: codeFilter('containmentLocaleName'),
  },
  {
    prop: "developCountermeasures",
    label: "拟定对策",
    align: "center",
    filter: codeFilter('developCountermeasuresName'),
  },
  {
    prop: "controlleQuantity",
    label: "应受控数量",
    align: "center",
  },
  {
    prop: "actualQuantity",
    label: "实际数量",
    align: "center",
  },
  {
    prop: "defectQuantity",
    label: "不良数量",
    align: "center",
  },
  {
    prop: "userName",
    label: "负责人",
    align: "center",
  },
  {
    prop: "completionDate",
    label: "完成日期",
    align: "center",
    filter: timeFormatter,
  },
];
export default {
  data() {
    return {
      dataInfo: "",
      tableProps,
      tableData:[]
    };
  },
  methods: {
    init(id) {
      const param = {
        startEightDisciplineId: id,
        limit: 10,
        page: 1,
      };
      this.$nextTick(() => {
        this.$http
          .get("/code/startEightDisciplineTemporaryTreatmentMeasures/page", {
            params: param,
          })
          .then(({ data: res }) => {
            this.dataListLoading = false;
            if (res.code !== 0) {
              this.tableData = [];
              return this.$message.error(res.msg);
            }
            this.tableData = res.data.list;
          })
          .catch(() => {});
      });
    },
  },
};
</script>
