<template>
  <div>
    <div class="top_style">
      <span style="color: #000000 !important;margin-left: 10px">工作任务(总分值：{{sumscore}})</span>
    </div>
    <el-table
        :data="workData"
        style="width: 100%">
      <el-table-column
          prop="rowindex"
          label="序号"
          width="60">
      </el-table-column>
      <el-table-column
          prop="taskname"
          label="工作任务"
          width="230"
          >
        <template slot-scope="scope">
          <el-tag v-if="scope.row.important === 1" size="mini" class="inline-16">关键</el-tag>
          <span>{{scope.row.taskname}}</span>
        </template>
      </el-table-column>
      <el-table-column
          label="关联客户对象"
         >
        <template slot-scope="scope">
          <span v-if="scope.row.onparties === 1">
            <span v-for="item in scope.row.partiestype">
               <el-tag style="margin-top: 2px;margin-bottom: 2px"  size="mini" class="inline-16">{{item}}</el-tag>
            </span>

          </span>
          <span v-else>--</span>
        </template>
      </el-table-column>
      <el-table-column
          prop="score"
          label="分值"
          width="60">
      </el-table-column>
      <el-table-column
          prop="address"
          label="操作"
          fixed="right"
          width="180">
        <template slot-scope="scope">
          <edit  class="inline-16" :data="rowData" :rowData="scope.row" @editSuccess="onSuccess" :disabled="rowData.disabled"></edit>
          <evaluationRecord class="inline-16" :data="rowData" :rowData="scope.row" :disabled="rowData.disabled"></evaluationRecord>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import edit from './modules/edit'
import evaluationRecord from './modules/evaluationRecord'
export default {
  props:['rowData'],
  name: '',
  components:{edit,evaluationRecord},
  data() {
    return {
      workData:[],
      sumscore:''
    };
  },
  computed:{
  },
  watch:{

  },
  created () {

  },
  methods: {
    async listData(id){
      const res = await this.$api.requested({
        "id": 20221201140104,
        "content": {
          "pageNumber": 1,
          "pageSize": 90,
          "sa_projectid":id,
          "isAll":0
        }
      })
      console.log(res,"工作任务详情")
      this.workData = res.data.rows
      this.sumscore = res.data.sumscore
    },
    onSuccess(){
      this.listData(this.rowData.sa_projectid)
    }
  },
  mounted() {
    console.log(this.rowData,"工作任务")
    this.listData(this.rowData.sa_projectid)
  }
};
</script>

<style scoped>
  .top_style{
    width: 100%;
    line-height: 35px;
    height: 35px;
    background: rgb(238, 238, 238);
    vertical-align: center;
  }
</style>
