zhongrj
2024-03-27 cc1c0a396698648256c350f6f0fe2cb2f0b02c7e
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<template>
  <avue-crud
    class="company-box"
    :option="staffOption"
    :search.sync="staffSearch"
    :table-loading="staffLoading"
    :data="staffData"
    ref="staffCrud"
    :page.sync="staffPage"
    @on-load="staffOnLoad"
    @selection-change="staffSelectionChange"
    @search-change="staffSearchChange"
    @search-reset="staffSearchReset"
    @current-change="staffCurrentChange"
    @size-change="staffSizeChange"
    @refresh-change="refreshchange"
  >
  </avue-crud>
</template>
 
<script>
import { getLisperformance } from "@/api/register/honor";
export default {
  props: ["form"],
  data() {
    return {
      staffOption: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        searchShowBtn: false,
        addBtn: false,
        selection: true,
        menu: false,
 
        align: "center",
        height: "auto",
        calcHeight: 270,
        tip: false,
        searchShow: false,
        searchMenuSpan: 4,
        index: false,
        viewBtn: true,
        //dialogType: 'drawer',
        dialogClickModal: false,
        // 操作栏宽度
        menuWidth: 156,
 
        column: [
          {
            label: "id",
            prop: "id",
            hide: true,
            editDisplay: false,
            addDisplay: false,
          },
          {
            label: "时间",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            prop: "time",
            formslot: true,
          },
          // {
          //     label: '工作态度',
          //     prop: "workingattitude",
          //     formslot: true,
          // },
          {
            label: "工作表现",
            prop: "achievements",
            formslot: true,
          },
          {
            label: "表现评定",
            prop: "score",
            type: "select",
            // dicUrl: "/api/blade-system/dict-biz/dictionary?code=scoreType",
            // props: {
            //     label: "dictValue",
            //     value: "dictKey"
            // },
            dicData: [
              {
                label: "优秀",
                value: 0,
              },
              {
                label: "良好",
                value: 1,
              },
              {
                label: "一般",
                value: 2,
              },
              {
                label: "差",
                value: 3,
              },
            ],
            dataType: "number",
            slot: true,
            rules: [
              {
                required: true,
                message: "请选择表现",
                trigger: "blur",
              },
            ],
          },
          // {
          //     label: '服务公司',
          //     prop: "departmentName",
          //     formslot: true,
          // }
        ],
      },
      staffSearch: {},
      staffLoading: true,
      staffData: [],
      staffPage: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      staffQuery: {},
      staffSelectionList: [],
    };
  },
  methods: {
    refreshchange() {
      this.staffOnLoad(this.staffPage, this.staffQuery);
    },
    staffOnLoad(page, params = {}) {
      // console.log(this.form, 111);
      this.staffLoading = true;
      getLisperformance(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.staffQuery),
        this.form.id
      ).then((res) => {
        const data = res.data.data;
 
        this.staffPage.total = data.total;
        this.staffData = data.records;
        for (var k in this.staffData) {
          this.staffData[k]["name"] = this.form.realName;
        }
        // console.log(this.staffData, "staffData");
        this.staffLoading = false;
        this.$refs.staffCrud.refreshTable();
        this.$refs.staffCrud.doLayout();
        this.staffSelectionClear();
      });
    },
    staffSelectionClear() {
      this.staffSelectionList = [];
      this.$refs.staffCrud.toggleSelection();
    },
    staffSelectionChange(list) {
      this.staffSelectionList = list;
    },
    staffSearchChange(params, done) {
      this.staffQuery = params;
      this.staffPage.currentPage = 1;
      this.staffOnLoad(this.staffPage, params);
      done();
    },
    staffSearchReset() {
      this.staffQuery = {};
      this.staffOnLoad(this.staffPage);
    },
    staffCurrentChange(currentPage) {
      this.staffPage.currentPage = currentPage;
    },
    staffSizeChange(pageSize) {
      this.staffPage.pageSize = pageSize;
    },
  },
};
</script>
 
<style>
</style>