<!--
  @description: 标段（包）信息-已选计划弹框
  @Modifier:肖文龙
  @routerPath:
  @date:2019-12-24 13:19:05
-->
<template>
  <!--选择物料弹框-->
  <el-dialog
    v-dialogDrag
    :visible.sync="dialogData.dialog"
    :close-on-click-modal="false"
    title="标段（包）已关联计划"
    width="840px"
    custom-class="el-dialog__body-p8 el-dialog_table"
  >
    <div>
      <el-table
        :data="dialogData.taskPlanList"
        size="mini"
      >
        <el-table-column
          label="序号"
          type="index"
          width="50"
          align="center"
        />
        <el-table-column
          prop="schemeNo"
          label="招标汇总号"
          min-width="160"
        />
        <el-table-column

          prop="schemeName"
          label="招标汇总名称"
          min-width="230"
        />
        <el-table-column
          v-if="dialogData.isShowRemoveBtn === true"
          label="操作"
          align="center"
          width="70"
        >
          <template slot-scope="scope">
            <el-link
              type="primary"
              @click="deleteRow(scope.$index)"
            >
              [移除]
            </el-link>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="dialogData.dialog = false">
        关闭
      </el-button>
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: 'MaterielListDialog',
  props: {
    dialogData: {
      type: Object,
      default: function() {
        return {
          dialog: false, // 弹框展示状态
          taskPlanList: []// 计划列表
        }
      }
    }
  },
  methods: {
    // 计划信息删除
    deleteRow(index) {
      this.$confirm('确认移除该标段（包）的计划，是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        confirmButtonClass: 'confirmBtn',
        cancelButtonClass: 'cancelBtn',
        type: 'warning'
      }).then(() => {
        // 删除
        this.dialogData.taskPlanList.splice(index, 1)
        this.$emit('relevanceTenderPlanSelect', this.dialogData.taskPlanList, this.dialogData.packIndex, '02')
      }).catch(() => {
      })
    }
  }
}
</script>

<style scoped lang="less">

</style>
