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
<template>
  <div class="page_member">
    <v-header :title="pageTitle"></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.unitTotal || 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.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 class="fl-f mr-r-30" v-if="isZuZhibuUser">
        <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>
    <!-- 按钮区 -->
    <div class="tool fl-al">
      <el-radio-group 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: "natureName" },
        { text: "单位归属", val: "belongTo" },
        { text: "服务社区", val: "helpCommunityName" },
        { text: "下沉服务小区(网格)院落", val: "villageName" },
        { text: "社区联系人", val: "helpCommunityContactsName" },
        { text: "社区联系人电话", val: "helpCommunityContacts" },
        { text: "党组织负责人", val: "contacts" },
        { text: "党组织负责人电话", val: "phone" },
        { text: "职能特长及服务意愿", val: "specialtyName" },
        { text: "单位管理员", val: "adminName" },
        { text: "管理员手机号", val: "adminPhone" },
      ],
      tds: [],
      isZuZhibuUser: false,
      StatusObject: {},
      unitCheckType: "全部单位",
    };
  },
  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: {
    natureNameReturnText(text) {
      let label = "";
      switch (text) {
        case "全部单位": {
          label = null;
          break;
        }
        case "机关单位": {
          label = "机关单位";
          break;
        }
        case "企事业单位": {
          label = "企事业单位";
          break;
        }
        default: {
          label = null;
          break;
        }
      }
      return label;
    },
    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() {
      this.paged.page = 1;
      this.paged.limit = 10;
      this.init();
    },
    // 获取数据
    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,
        })
      );
      if (!this.isZuZhibuUser&&demo.$session.get("user").communityId != 0) {
        v.communityId = demo.$session.get("user").communityId;
      }
      this.$api.post("checkUnit/page", 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;
      this.$api.get("checkUnit/statistics/top", obj, (e) => {
        this.StatusObject = e;
      });
    },
  },
  mounted() {
    const ROUTE_VALUE = this.$route.query;
    this.pageTitle = ROUTE_VALUE.belongTo;
    this.unitCheckType = ROUTE_VALUE.name;
    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>