<template>
  <div class="page">
    <LayoutTable :data="tableData" :config="tableConfig" notDel notSearch />
  </div>
</template>

<script>
import table from "@/assets/mixins/table";

export default {
  mixins: [table],
  created() {
    const { matterId } = this.$route.query;
    this.config.addQuery = { matterId: matterId };
  },
  data() {
    return {
      config: {
        columns: [
          { label: "事项名称", prop: "matterName", tooltip: true },
          { label: "材料名", prop: "materialName" },
          { label: "材料必要性", prop: "isMust", formatter: this.formatter },
          {
            label: "材料类型",
            prop: "materialType",
            formatter: this.formatter,
          },
          {
            label: "材料形式",
            prop: "materialProperty",
            formatter: this.formatter,
          },
          { label: "纸质材料份数", prop: "paperNum" },

          {
            label: "操作",
            width: 180,
            formatter: (row) => {
              return (
                <div>
                  <el-button
                    type="primary"
                    icon="el-icon-edit"
                    round
                    size="mini"
                    onClick={() => {
                      this.toEdit(row);
                    }}
                  >
                    编辑
                  </el-button>
                  {row.source == 1 ? (
                    <Confirm
                      onConfirm={() => {
                        this.toDel(row.id, 0);
                      }}
                      message="是否删除当前办理流程？"
                    >
                      <span>&nbsp;&nbsp;</span>
                      <el-button
                        size="mini"
                        type="warning"
                        icon="el-icon-delete"
                       round
                        title="删除"
                      >删除</el-button>{" "}
                    </Confirm>
                  ) : (
                    ""
                  )}
                </div>
              );
            },
          },
        ],
      },
    };
  },
};
</script>