保安监管系统-验收版本
zhengpz
2021-12-07 dbb160f7ce6c334ee561e551930ec72b5f5db899
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<template>
  <avue-crud
    class="company-box"
    :option="punishOption"
    :search.sync="punishSearch"
    :table-loading="punishLoading"
    :data="punishData"
    ref="punishCrud"
    :page.sync="punishPage"
    @on-load="punishOnLoad"
    @selection-change="punishSelectionChange"
    @search-change="punishSearchChange"
    @search-reset="punishSearchReset"
    @current-change="punishCurrentChange"
    @size-change="punishSizeChange"
  >
  </avue-crud>
</template>
 
<script>
import { getListhonor } from "@/api/register/honor";
export default {
  props: ["form", "see"],
  data() {
    return {
      punishOption: {
        // 操作栏多余按钮去除
        delBtn: false,
        editBtn: false,
        addBtn: false,
        // searchShowBtn: 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: "保安员名称",
            prop: "name",
            span: 24,
            search: false,
            searchLabelWidth: 100,
            searchSpan: 4,
            labelWidth: 110,
            disabled: true,
            rules: [
              {
                required: true,
                message: "请输入身份证号码",
                trigger: "blur",
              },
            ],
          },
          {
            label: "身份证号码",
            prop: "cardid",
            span: 24,
            search: false,
            searchSpan: 5,
            labelWidth: 110,
            searchLabelWidth: 100,
            width: 190,
            disabled: true,
            rules: [
              {
                required: true,
                message: "请输入身份证号码",
                trigger: "blur",
              },
            ],
          },
          {
            label: "发证机关",
            prop: "paperUnit",
            span: 24,
            labelWidth: 110,
          },
          {
            label: "荣誉情况",
            prop: "honor",
            search: false,
            searchSpan: 5,
            searchLabelWidth: 90,
            span: 24,
            labelWidth: 110,
          },
          {
            label: "获取时间",
            prop: "honortime",
            span: 24,
            labelWidth: 110,
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
          },
        ],
      },
      punishSearch: {},
      punishLoading: true,
      punishData: [],
      punishPage: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      punishQuery: {},
      punishSelectionList: [],
      i: 1,
    };
  },
  mounted() {
    if (this.see) {
      this.punishOption.height = "615";
      this.punishOption.column[0].search = true;
      this.punishOption.column[1].search = true;
      this.punishOption.column[3].search = true;
    }
  },
  methods: {
    punishOnLoad(page, params = {}) {
      this.punishLoading = true;
      if (this.see) {
        getListhonor(
          page.currentPage,
          page.pageSize,
          Object.assign(params, this.punishQuery)
        ).then((res) => {
          this.i++;
          const data = res.data.data;
 
          this.punishPage.total = data.total;
          this.punishData = data.records;
          console.log(this.punishData);
          this.punishLoading = false;
          this.$refs.punishCrud.refreshTable();
          this.$refs.punishCrud.doLayout();
          if (this.i % 2 != 0) {
            this.punishAngin();
          }
        });
        return;
      }
      getListhonor(
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.punishQuery),
        this.form.cardid
      ).then((res) => {
        this.i++;
        const data = res.data.data;
 
        this.punishPage.total = data.total;
        this.punishData = data.records;
        console.log(this.punishData);
        this.punishLoading = false;
        this.$refs.punishCrud.refreshTable();
        this.$refs.punishCrud.doLayout();
        if (this.i % 2 != 0) {
          this.punishAngin();
        }
      });
    },
    punishSelectionClear() {
      this.punishSelectionList = [];
      this.$refs.punishCrud.toggleSelection();
    },
    punishSelectionChange(list) {
      this.punishSelectionList = list;
    },
    punishSearchChange(params, done) {
      this.punishQuery = params;
      this.punishPage.currentPage = 1;
      this.punishOnLoad(this.punishPage, params);
      done();
    },
    punishAngin() {
      this.punishOnLoad(this.punishPage, this.punishQuery);
    },
    punishSearchReset() {
      this.punishQuery = {};
      this.punishOnLoad(this.punishPage);
    },
    punishCurrentChange(currentPage) {
      this.punishPage.currentPage = currentPage;
    },
    punishSizeChange(pageSize) {
      this.punishPage.pageSize = pageSize;
    },
  },
};
</script>
 
<style>
</style>