<template>
  <el-dialog title="改造进度" :visible.sync="progressListOpen" width="1200px" append-to-body destroy-on-close :close-on-click-modal="false">
    <el-table v-loading="loading" :data="progressList">
<!--      <el-table-column type="selection" width="55" align="center" />-->
      <el-table-column label="开始时间" align="center" prop="startTime" />
      <el-table-column label="结束时间" align="center" prop="endTime" />
      <el-table-column label="建设内容" align="center" prop="constructionContent" />
      <el-table-column label="创建时间" align="center" prop="createTime" width="200">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="showProgress(scope.row)"
          >查看完成管线</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 详情 -->
    <DetailInfo ref="detail"/>

  </el-dialog>


</template>

<script>
  import { listProgress, getProgress, delProgress, addProgress, updateProgress, exportProgress } from "@/api/oldpipesystem/progress";
  import DetailInfo from "./DetailInfo";
  export default {
    name: "ProgressList",
    components: {DetailInfo},
    data(){
        return{
          // 遮罩层
          loading: true,
          // 导出遮罩层
          exportLoading: false,
          // 选中数组
          ids: [],
          // 非单个禁用
          single: true,
          // 非多个禁用
          multiple: true,
          // 显示搜索条件
          showSearch: true,
          // 总条数
          total: 0,
          // 管线改造进度表格数据
          progressList: [],
          // 弹出层标题
          title: "",
          // 是否显示弹出层
          progressListOpen: false,
          // 查询参数
          queryParams: {
            pageNum: 1,
            pageSize: 10,
            id: null,
            serialNumber: null,
            startTime: null,
            endTime: null,
            createTime: null,
          },
          // 表单参数
          form: {},
          // 表单校验
          rules: {
          }
        }
    },
  created() {

  },
    methods:{
      getList(serialNumber){
        this.progressListOpen = true;
        this.loading = true;
        this.queryParams.serialNumber = serialNumber;
        listProgress(this.queryParams).then(response => {
          this.progressList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
      showProgress(row){
        this.$refs.detail.getDetailInfo(row.id);
      }
    }
  }
</script>

<style scoped>

</style>
