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
<template>
  <div class='man_face'>
    <v-header
      title="人脸管理"
      :bar="bar"
      search
      @on-search="onSearch"
    ></v-header>
    <div class="tab">
      <v-tool-table
        :trs="trs"
        :tds="tds"
      >
        <template v-slot:btn="item">
          <div class="table_flex">
            <!-- {{item.scope.id}} -->
            <span
              class="col_primary"
              v-if="item.scope.faceState===0"
              @click="onEvent(1,item.scope)"
            >通过</span>
            <span
              class="col_primary"
              v-else
              @click="onEvent(3,item.scope)"
            >删除</span>
            <span
              class="col_primary"
              @click="onFace(2,item.scope)"
              v-if="item.scope.faceState===0"
            >驳回</span>
          </div>
        </template>
        <template v-slot:pic="item">
          <img
            :src="item.scope.faceUrl"
            @click="onScaleUploadImage(item.scope)"
            alt=""
          >
        </template>
        <template v-slot:status="item">
          <b>{{['待审核','已通过','驳回'][item.scope.faceState] || item.scope.faceState}}</b>
        </template>
        <template v-slot:time="item">
          <b>{{is_time(item.scope.createAt)}}</b>
        </template>
        <template v-slot:indent="item">
          <b>{{+(item.scope.comMngStructHouseVOS || {}).identity === 1 ? '是' : '否'}}</b>
        </template>
      </v-tool-table>
    </div>
    <v-tool-page
      :item="paged"
      @on-page="onPage"
    ></v-tool-page>
  </div>
</template>
 
<script>
import { mapState } from "vuex";
export default {
  props: {},
  components: {},
  data() {
    return {
      bar: [
        { title: "姓名", name: "name" },
        { title: "居民手机号", name: "phone" },
        { title: "所在小区", name: "communityName" },
      ],
      trs: [
        { text: "序号", val: "userId", width: "50px" },
        { text: "照片", val: "btn", slot: "pic" },
        { text: "用户名", val: "nickName" },
        { text: "姓名", val: "name" },
        { text: "居民手机号", val: "phone" },
        { text: "身份证号", val: "idCard" },
        { text: "状态", val: "btn", slot: "status" },
        { text: "居住小区", val: "communityName" },
        { text: "是否为租户", val: "btn", slot: "indent" },
        { text: "创建时间", val: "btn", slot: "time" },
        { text: "操作", val: "btn" },
      ],
      tds: [],
      paged: { page: 0, total: 0, r: 0, limit: 10 },
      os: {},
      search: {},
    };
  },
  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: {
    // 查看上传大图
    onScaleUploadImage(j) {
      this.$store.dispatch("setImage", {
        time: Date.now(),
        pic: j.faceUrl,
        tool: true,
        foot: 1,
        title: j.name,
        list: [
          {
            desc: j.communityName + "-" + j.nickName,
            img: j.faceUrl,
            title: j.name,
          },
        ],
      });
    },
    is_time(v) {
      return demo.timeout(new Date(v).getTime(), "alls", "-");
    },
    onSearch(v) {
      // if (v.time && v.time.length && v.time[1]) {
      //   v.createBegin = v.time[0];
      //   v.createEnd = v.time[1];
      // }
      this.search = demo.copy(v);
      // delete this.search.time;
      this.paged.page = 1;
      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();
    },
    // 获取数据
    init() {
      let v = demo.copy(
        Object.assign(this.os, this.search, {
          pageNum: this.paged.page,
          pageSize: this.paged.limit,
        })
      );
      this.$api.post("communitymanager/pageuserface", v, (e) => {
        this.paged.total = e.total;
        this.paged.r++;
        this.tds = e.records || [];
      });
    },
    onFace(id, item) {
      this.$store.dispatch("setFixed", {
        event: "add",
        data: {
          type: "face-cancel",
          data: {
            operationType: id,
            userId: item.userId,
            communityId: item.communityId,
            areaId: item.areaId,
            account: item.account,
            rejectReson: "",
          },
        },
        time: Date.now(),
      });
    },
    onEvent(id, item) {
      let os = {
        operationType: id,
        userId: item.userId,
        communityId: item.communityId,
        areaId: item.areaId,
        account: item.account,
      };
      let go = () => {
        this.$api.put("communitymanager/putuserface", os, () => {
          demo.toast("操作成功");
          this.init();
        });
      };
      if (id === 3) {
        this.$js.model("", "是否删除", (res) => {
          if (res) {
            go();
          }
        });
      } else {
        go();
      }
    },
  },
  mounted() {},
};
</script>
<style lang='less' scoped>
.man_face {
  overflow-y: auto;
  .tab {
    margin-bottom: 10px;
  }
}
</style>