hejianhao
2025-04-16 dab2d210ca06c1faa514c6388fbd5de1ab355360
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
<template>
  <div class="page_member">
    <v-header
      :title="labelCheckType == 1 ? pageTitle : workUnitName"
    ></v-header>
    <!-- 统计区 -->
    <div class="fl-fw mr-b-10">
      <div class="fl-f mr-r-30">
        <div class="left-lable-dian"></div>
        <div class="fl-co mr-l-10 fz-7">
          <span>报到党员总数</span>
          <span class="mr-t-10 fc-red">{{
            StatusObject.partyMemberTotal || 0
          }}</span>
        </div>
      </div>
      <div class="fl-fw" v-if="labelCheckType == 1">
        <div class="fl-f mr-r-30">
          <div class="left-lable-dian"></div>
          <div class="fl-co mr-l-10 fz-7">
            <span>机关单位党员</span>
            <span class="mr-t-10 fc-red">{{
              StatusObject.organTotal || 0
            }}</span>
          </div>
        </div>
        <div class="fl-f mr-r-30">
          <div class="left-lable-dian"></div>
          <div class="fl-co mr-l-10 fz-7">
            <span>企事业单位党员</span>
            <span class="mr-t-10 fc-red">{{
              StatusObject.businessTotal || 0
            }}</span>
          </div>
        </div>
      </div>
    </div>
    <!-- 按钮区 -->
    <div class="tool fl-al">
      <el-radio-group
        v-if="labelCheckType == 1"
        v-model="unitCheckType"
        @change="unitCheckHandle"
      >
        <el-radio-button label="全部党员">全部党员</el-radio-button>
        <el-radio-button label="机关单位党员">机关单位党员</el-radio-button>
        <el-radio-button label="企事业单位党员">企事业单位党员</el-radio-button>
      </el-radio-group>
      <el-radio-group
        v-if="labelCheckType == 2"
        v-model="unitCheckType"
        @change="unitCheckHandle"
      >
        <el-radio-button label="全部党员">全部党员</el-radio-button>
        <el-radio-button label="已注册小程序">已注册小程序</el-radio-button>
        <el-radio-button label="未注册小程序">未注册小程序</el-radio-button>
      </el-radio-group>
      <div class="fl-al mr-l-50">
        <span>关键字搜索:</span>
        <el-input
          class="input-width mr-r-10"
          v-model="searchVal"
          placeholder="姓名、手机号、工作单位、常住社区"
        ></el-input>
        <el-button type="primary" @click="searchHandle">查询</el-button>
      </div>
    </div>
    <!-- 正文 -->
    <div class="cen">
      <div class="tab_data">
        <div class="tab">
          <v-tool-table :trs="trs" :tds="tds"> </v-tool-table>
        </div>
        <div class="page">
          <v-tool-page :item="paged" @on-page="onPage"></v-tool-page>
        </div>
      </div>
    </div>
  </div>
</template>
 
<script>
import { mapState } from "vuex";
export default {
  props: {},
  components: {},
  data() {
    return {
      searchVal: "",
      pageTitle: "",
      os: {},
      total: 0,
      paged: { page: 0, total: 0, r: 0, limit: 10 },
      trs: [
        { text: "序号", val: "index" },
        { text: "党员姓名", val: "name" },
        { text: "单位归属", val: "belongTo" },
        { text: "手机号", val: "phone" },
        { text: "微信昵称", val: "nickName" },
        { text: "常住社区", val: "communityName" },
        { text: "小区院落", val: "villageName" },
        { text: "职能特长及服务意愿", val: "specialtyName" },
        { text: "工作单位", val: "checkUnitName" },
      ],
      tds: [],
      isZuZhibuUser: false,
      StatusObject: {},
      unitCheckType: "全部党员",
      labelCheckType: 1,
      workUnitName: "",
      checkUnitId: "",
    };
  },
  computed: {
    ...mapState({ vuex_page: "pageReset" }),
  },
  watch: {
    vuex_page: {
      handler(n) {
        if (n.page === this.$route.path) {
          this.paged.page = 1;
          this.init();
        }
      },
      deep: true,
    },
  },
  methods: {
    searchHandle() {
      this.paged.page = 1;
      this.paged.limit = 10;
      this.init();
    },
    // 分页点击
    onPage(v) {
      if (v.page === this.paged.page && v.page && !v.reset) {
        return 0;
      }
      this.paged.page = v.page;
      this.paged.limit = v.limit;
      this.init();
    },
    unitCheckHandle(val) {
      this.paged.page = 1;
      this.paged.limit = 10;
      if (val === "已注册小程序") {
        this.isRegister = 1;
      } else if (val === "未注册小程序") {
        this.isRegister = 0;
      } else {
        this.isRegister = null;
      }
      this.init();
    },
    natureNameReturnText(text) {
      let label = "";
      switch (text) {
        case "全部党员": {
          label = null;
          break;
        }
        case "机关单位党员": {
          label = "机关单位";
          break;
        }
        case "企事业单位党员": {
          label = "企事业单位";
          break;
        }
        case "已注册小程序": {
          this.isRegister = 1;
          label = null;
          break;
        }
        case "未注册小程序": {
          this.isRegister = 0;
          label = null;
          break;
        }
        default: {
          label = null;
          break;
        }
      }
      return label;
    },
    // 获取数据
    init() {
      let v = demo.copy(
        Object.assign(this.os, {
          pageNum: this.paged.page,
          pageSize: this.paged.limit,
          natureName: this.natureNameReturnText(this.unitCheckType),
          belongTo: this.pageTitle,
          keyWord: this.searchVal,
          checkUnitId: this.checkUnitId,
          isRegister: this.isRegister,
        })
      );
      if (!this.isZuZhibuUser && demo.$session.get("user").communityId != 0) {
        v.communityId = demo.$session.get("user").communityId;
      }
      this.$api.post("communitypartybuilding/pagepartyorganization", v, (e) => {
        this.paged.total = e.total;
        e.records.map((item, index) => {
          item.index = (this.paged.page - 1) * this.paged.limit + index + 1;
        });
        this.paged.r++;
        this.tds = e.records || [];
      });
    },
    getTopData() {
      let obj = {};
      if (demo.$session.get("user").communityId != 0) {
        obj.communityId = demo.$session.get("user").communityId;
      }
      obj.choice = this.pageTitle;
      if (this.labelCheckType == 2) {
        obj.checkUnitId = this.checkUnitId;
      }
      this.$api.get("checkUnit/pbStatistics/top", obj, (e) => {
        this.StatusObject = e;
      });
    },
  },
  mounted() {
    const ROUTE_VALUE = this.$route.query;
    this.pageTitle = ROUTE_VALUE.belongTo;
    this.unitCheckType = ROUTE_VALUE.name;
    this.labelCheckType = ROUTE_VALUE.labelCheckType;
    this.workUnitName = ROUTE_VALUE.workUnitName;
    this.checkUnitId = ROUTE_VALUE.checkUnitId;
    this.isZuZhibuUser = demo.$session.get("user").account == "zuzhibu";
    this.getTopData();
  },
};
</script>
<style lang='less' scoped>
.page_member {
  overflow-y: auto;
  .tool {
    margin: 5px 0 15px;
  }
  .cen {
    display: flex;
    height: 500px;
    > div {
      height: 100%;
      position: relative;
    }
    .list {
      width: 160px;
      p {
        background-color: #f2f2f2;
        font-size: 14px;
        font-weight: 650;
      }
      .lists {
        height: calc(~"100% - 40px");
      }
      p,
      li {
        height: 40px;
        line-height: 40px;
      }
      li {
        cursor: pointer;
        transition: all 0.2s;
        font-size: 13px;
        text-indent: 5px;
      }
      li.active {
        background-color: #1890ff;
        color: #fff;
      }
    }
    .tab_data {
      .page {
        height: 50px;
        box-sizing: border-box;
        padding-top: 10px;
      }
    }
  }
}
.left-lable-dian {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgb(24, 135, 240);
}
.input-width {
  width: 300px;
}
</style>