licp
2024-12-23 f18c78c262089284bf6099b3fc37c61cdfb4cfaf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!-- 人员监督 -->
<template>
  <div>
    <div style="text-align: left; margin-bottom: 15px;">
      <label>关键字</label>
      <el-input placeholder="请输入关键字" style="width: 20vh;" size="small"></el-input>
      <el-button type="primary" size="small">查询</el-button>
      <div style="float: right;">
        <el-button type="primary" size="small">查询</el-button>
        <el-button type="primary" size="small">导出excel</el-button>
      </div>
    </div>
    <div class="table">
      <el-table :data="tableData" style="width: 100%" height="70vh">
        <el-table-column prop="date" label="序号" min-width="120">
        </el-table-column>
        <el-table-column prop="name" label="流程编号" min-width="180">
        </el-table-column>
        <el-table-column prop="address" label="所属年度" min-width="180">
        </el-table-column>
        <el-table-column prop="address" label="编制日期" min-width="180">
        </el-table-column>
        <el-table-column prop="address" label="提交人" min-width="180">
        </el-table-column>
        <el-table-column prop="address" label="当前状态" min-width="120">
        </el-table-column>
        <el-table-column prop="address" label="当前责任人" min-width="180">
        </el-table-column>
        <el-table-column fixed="right" label="操作" width="100">
          <template v-slot="scope">
            <el-button type="text" size="small">查看</el-button>
            <el-button type="text" size="small">编辑</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="1"
        :page-sizes="[10, 20, 30, 50, 100]" :page-size="search.size" layout="->,total, sizes, prev, pager, next, jumper"
        :total="search.total">
      </el-pagination>
    </div>
  </div>
</template>
 
<script>
export default {
  props: {
    clickNodeVal: {
      type: Object,
      default: () => {
        return {};
      }
    }
  },
  data() {
    return {
      tableData: [],
      search: {
        size: 20,
        current: 1,
        total: 0
      }
    };
  },
  created() {
    this.init();
  },
  methods: {
    handleSizeChange(val) {
      this.search.size = val
      this.getPersonnelTraining(this.clickNodeVal.userId);
    },
    handleCurrentChange(val) {
      this.search.current = val
      this.getPersonnelTraining(this.clickNodeVal.userId);
    },
    // 初始化调用
    init() {
      if (this.clickNodeVal.userId) {
        this.getPersonnelTraining(this.clickNodeVal.userId ? this.clickNodeVal.userId : null, null);
      } else {
        this.getPersonnelTraining(null, this.clickNodeVal.id ? this.clickNodeVal.id : null);
      }
    },
    getPersonnelTraining(userId) {
      this.search.userId = userId
      this.$axios.get(this.$api.personnel.personTrainingSelect+"?userId=" + userId + "&size=" + this.search.size + "&current=" + this.search.current).then(res => {
        console.log(`output->res`,res)
      })
    }
  },
  watch: {
    // 监听点击el-tree的数据,进行数据刷新
    clickNodeVal(newVal) {
      if (newVal.userId) {
        this.getPersonnelTraining(newVal.userId);
      }
    }
  }
};
</script>