fix
13404089107
2025-04-11 eb296bfbd3f18dff5a2ee60b42f8415d51c897b9
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
<template>
  <div class="app-container" v-loading="loading" element-loading-text="加载中...">
    <!-- 头部信息卡片 -->
    <div class="batch-info">
      <div class="header">
        <div class="batch-title">批次号:{{ batchInfo.batchNumber }}</div>
        <div class="back-btn">
          <el-button type="primary" size="small" icon="el-icon-back" @click="goBack">返回</el-button>
        </div>
      </div>
      <div class="info-cards">
        <el-card class="box-card">
          <div class="card-title">{{ batchInfo.personNum || 0 }}</div>
          <div class="card-desc">申请总人数</div>
        </el-card>
        <el-card class="box-card">
          <div class="card-title">{{ batchInfo.totalAmount || 0 }} 万元</div>
          <div class="card-desc">申请总金额</div>
        </el-card>
        <el-card class="box-card">
          <div class="card-title">{{ batchInfo.waitFamilyArea || 0 }}㎡</div>
          <div class="card-desc">应安置总面积</div>
        </el-card>
      </div>
    </div>
 
    <!-- 搜索表单 -->
    <el-form :inline="true" :model="queryParams" class="search-form">
      <el-form-item label="镇街">
        <el-select v-model="queryParams.street" placeholder="请选择镇街" clearable filterable size="small">
          <el-option v-for="item in streetOptions" :key="item.dictCode" :label="item.dictLabel"
            :value="item.dictLabel" />
        </el-select>
      </el-form-item>
      <el-form-item label="拆迁项目">
        <el-input v-model="queryParams.projectName" placeholder="请输入" clearable size="small" />
      </el-form-item>
      <el-form-item label="所在村(社区)">
        <el-input v-model="queryParams.community" placeholder="请输入" clearable size="small" />
      </el-form-item>
      <el-form-item label="户主姓名/身份证号">
        <el-input v-model="queryParams.headOrIdCard" placeholder="请输入" clearable size="small" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button>
        <el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
 
    <!-- 操作按钮区域 -->
    <el-row :gutter="10" class="mb8" v-if="batchInfo.status == '0'">
      <el-col :span="1.5">
        <el-button type="primary" size="small" @click="handleAddHousehold">新增安置户信息</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="success" size="small" @click="handleDownloadTemplate">下载导入模板</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="warning" size="small" @click="handleBatchImport">批量导入</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" size="small" @click="handleExportIssueData">问题数据导出</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" size="small" @click="autoAudit">自动纠错</el-button>
      </el-col>
    </el-row>
 
    <el-row :gutter="10" class="mb8" v-else>
      <el-col :span="1.5">
        <el-button type="primary" size="small" @click="handleExportAll">全部导出为Excel</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" size="small" @click="handleExportIssueData">问题数据导出</el-button>
      </el-col>
    </el-row>
 
    <!-- 表格区域 -->
    <el-table :data="tableData" border style="width: 100%" :row-class-name="tableRowClassName">
      <el-table-column type="index" label="序号" width="50" align="center" />
      <el-table-column prop="street" label="镇(街道)" align="center" width="80">
        <template slot-scope="scope">
          {{ scope.row.street }}
        </template>
      </el-table-column>
      <el-table-column prop="projectName" label="拆迁项目名称" align="center" width="150">
        <template slot-scope="scope">
          {{ scope.row.projectName }}
        </template>
      </el-table-column>
      <el-table-column prop="community" label="所在村(社区)" align="center" width="100">
        <template slot-scope="scope">
          {{ scope.row.community }}
        </template>
      </el-table-column>
      <el-table-column prop="demolitionTime" label="拆迁时间" align="center" width="100">
        <template slot-scope="scope">
          {{ scope.row.demolitionTime }}
        </template>
      </el-table-column>
      <el-table-column prop="householdHead" label="户主名称" align="center" width="80">
        <template slot-scope="scope">
          {{ scope.row.householdHead }}
        </template>
      </el-table-column>
      <el-table-column prop="idCard" label="身份证号" align="center" width="180">
        <template slot-scope="scope">
          {{ scope.row.idCard }}
          <el-tooltip v-if="scope.row.idCardExistsWarn == 1" placement="top">
            <div slot="content">{{ "身份证不在安置库" }}</div>
            <el-image style="width: 12px; height: 12px;margin-left:5px" :src="require('../../assets/logo/warning.png')"
              fit="fit"></el-image>
          </el-tooltip>
          <el-tooltip v-if="scope.row.idCardNoWarn == 1" placement="top">
            <div slot="content">{{ "身份证重复" }}</div>
            <el-image style="width: 12px; height: 12px;margin-left:5px" :src="require('../../assets/logo/warning.png')"
              fit="fit"></el-image>
          </el-tooltip>
        </template>
      </el-table-column>
      <el-table-column prop="mobile" label="联系电话" align="center" width="120">
        <template slot-scope="scope">
          {{ scope.row.mobile }}
        </template>
      </el-table-column>
      <el-table-column label="本次安置人数(人)" align="center">
        <el-table-column prop="currentCollectiveNum" label="集体经济组织成员" align="center" width="120">
          <template slot-scope="scope">
            {{ scope.row.currentCollectiveNum }}
          </template>
        </el-table-column>
        <el-table-column prop="currentNoCollectiveNum" label="非集体经济组织成员" align="center" width="120">
          <template slot-scope="scope">
            {{ scope.row.currentNoCollectiveNum }}
          </template>
        </el-table-column>
        <el-table-column prop="currentCount" label="合计" align="center" width="60">
          <template slot-scope="scope">
            {{ scope.row.currentCount }}
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column prop="waitFamilyNames" label="待安置家庭成员姓名" align="center" width="120">
        <template slot-scope="scope">
          {{ scope.row.waitFamilyNames }}
          <el-tooltip v-if="scope.row.waitFamilyNamesWarn == 1" placement="top">
            <div slot="content">{{ "身份信息存在重复数据" }}</div>
            <el-image style="width: 12px; height: 12px;margin-left:5px" :src="require('../../assets/logo/warning.png')"
              fit="fit"></el-image>
          </el-tooltip>
        </template>
      </el-table-column>
 
      <el-table-column prop="orgArea" label="集体成员面积" align="center" width="150">
        <template slot-scope="scope">
          {{ scope.row.orgArea }}
        </template>
      </el-table-column>
      <el-table-column prop="noOrgArea" label="非集体成员面积" align="center" width="150">
        <template slot-scope="scope">
          {{ scope.row.noOrgArea }}
        </template>
      </el-table-column>
 
      <el-table-column prop="waitFamilyArea" label="待安置人员应安置面积合计(㎡)" align="center" width="120">
        <template slot-scope="scope">
          {{ scope.row.waitFamilyArea }}
          <el-tooltip v-if="scope.row.waitFamilyAreaWarn == 1" placement="top">
            <div slot="content">{{ "应补偿面积数据异常" }}</div>
            <el-image style="width: 12px; height: 12px;margin-left:5px" :src="require('../../assets/logo/warning.png')"
              fit="fit"></el-image>
          </el-tooltip>
        </template>
      </el-table-column>
      <el-table-column label="补偿金额(万元)" align="center">
        <el-table-column prop="compensationNewAmount" label="新建商品住房、商业用房、停车位" align="center" width="100">
          <template slot-scope="scope">
            {{ scope.row.compensationNewAmount }}
            <!-- 重新对接字段 -->
            <el-tooltip v-if="scope.row.compensationAmountWarn == 1" placement="top">
              <div slot="content">{{ "检测到多个购房情况,请人工核对" }}</div>
              <el-image style="width: 12px; height: 12px;margin-left:5px"
                :src="require('../../assets/logo/warning.png')" fit="fit"></el-image>
            </el-tooltip>
          </template>
        </el-table-column>
        <el-table-column prop="compensationOldAmount" label="二手住房" align="center" width="80">
          <template slot-scope="scope">
            {{ scope.row.compensationOldAmount }}
          </template>
        </el-table-column>
        <el-table-column prop="compensationSum" label="合计" align="center" width="60">
          <template slot-scope="scope">
            {{ scope.row.compensationSum }}
            <el-tooltip v-if="scope.row.compensationSumWarn == 1" placement="top">
              <div slot="content">{{ "补偿标准金额异常" }}</div>
              <!-- <i
                class="el-icon-warning-outline"
                style="color: #e6a23c; margin-left: 5px"
              ></i> -->
              <el-image style="width: 12px; height: 12px;margin-left:5px"
                :src="require('../../assets/logo/warning.png')" fit="fit"></el-image>
            </el-tooltip>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column prop="downPaymentAmount" label="25%首付款(万元)" align="center" width="130">
        <template slot-scope="scope">
          {{ scope.row.downPaymentAmount }}  <el-tooltip v-if="scope.row.downPaymentAmountWarn == 1" placement="top">
            <div slot="content">
              {{ "首付款金额异常" }}
            </div>
            <el-image style="width: 12px; height: 12px;margin-left:5px" :src="require('../../assets/logo/warning.png')"
              fit="fit"></el-image>
          </el-tooltip>
        </template>
      </el-table-column>
      <el-table-column prop="quarterPayAmount" label="每季度需支付款项(万元)" align="center" width="120">
        <template slot-scope="scope">
          {{ scope.row.quarterPayAmount }}
          <el-tooltip v-if="scope.row.quarterPayAmountWarn == 1" placement="top">
            <div slot="content">
              {{ "季度款金额异常" }}
            </div>
            <el-image style="width: 12px; height: 12px;margin-left:5px" :src="require('../../assets/logo/warning.png')"
              fit="fit"></el-image>
          </el-tooltip>
        </template>
      </el-table-column>
      <el-table-column prop="subsidyAmount" label="过渡补贴(万元)" align="center" width="60">
        <template slot-scope="scope">
          {{ scope.row.subsidyAmount }}
          <el-tooltip v-if="scope.row.subsidyAmountWarn == 1" placement="top">
            <div slot="content">{{ "过度补贴数据异常" }}</div>
            <el-image style="width: 12px; height: 12px;margin-left:5px" :src="require('../../assets/logo/warning.png')"
              fit="fit"></el-image>
          </el-tooltip>
        </template>
      </el-table-column>
      <el-table-column prop="remark" label="备注" align="center" width="60">
        <template slot-scope="scope">
          {{ scope.row.remark }}
        </template>
      </el-table-column>
      <el-table-column prop="situation" label="购房差异情况" align="center" width="60">
        <template slot-scope="scope">
          {{ scope.row.situation }}
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" width="200" fixed="right">
        <template slot-scope="scope">
          <el-button size="mini" type="text" @click="handleHouseholdDetail(scope.row)">详情</el-button>
          <template v-if="batchInfo.status == '0'">
            <el-button size="mini" type="text" @click="handleHouseholdEdit(scope.row)">编辑</el-button>
            <el-button size="mini" type="text" @click="handleHouseholdDelete(scope.row)">删除</el-button>
            <el-button size="mini" type="text" @click="handleCheck(scope.row)">已核对</el-button>
          </template>
        </template>
      </el-table-column>
    </el-table>
 
    <!-- 分页 -->
    <div class="pagination-container">
      <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
        :current-page="queryParams.pageNum" :page-sizes="[10, 20, 30, 50]" :page-size="queryParams.pageSize"
        layout="total, sizes, prev, pager, next, jumper" :total="total" />
    </div>
 
    <!-- 上传组件 -->
    <upload-dialog ref="uploadDialog" :info="batchInfo" :visible.sync="uploadDialogVisible"
      @success="handleUploadSuccess" />
 
    <!-- 详情弹窗 -->
    <DetailDialog :visible.sync="detailDialogVisible" :id="currentId" />
  </div>
</template>
 
<script>
import {
  geDetailTabletList,
  delDetail,
  getDictList,
  autoApprove,
  dataCheck
} from "@/api/application-batch";
import { downLoad, exportExcell } from "@/utils";
import UploadDialog from "./components/UploadDialog.vue";
import DetailDialog from "./components/DetailDialog.vue";
 
export default {
  name: "ApplicationBatchDetail",
  components: {
    UploadDialog,
    DetailDialog,
  },
  data() {
    return {
      batchInfo: {
        // 批次id
        id: "",
        // 批次号
        batchNumber: "",
        // 批次状态
        status: "",
        // 安置总户数
        waitFamilyArea: "",
        // 安置总人数
        personNum: "",
        // 补偿资金总额
        totalAmount: "",
      },
      // 加载状态
      loading: false,
      // 上传组件
      uploadDialogVisible: false,
      // 总条数
      total: 0,
      // 表格数据
      tableData: [],
      // 镇街选项
      streetOptions: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        street: undefined,
        projectName: undefined,
        community: undefined,
        headOrIdCard: undefined,
      },
      // 详情弹窗
      detailDialogVisible: false,
      // 当前记录的ID
      currentId: "",
    };
  },
  created() {
    // 从路由获取批次号和状态
    const { id } = this.$route.query;
    this.batchInfo = {
      ...this.batchInfo,
      id: id || "",
    };
    this.getList();
    this.getStreetOptions();
  },
  methods: {
    /**自动审核*/
    autoAudit() {
      this.$confirm('是否确认自动纠错', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        autoApprove({ id: this.batchInfo.id }).then((res) => {
          this.getList();
        })
      })
    },
 
    handleCheck(row) {
      this.$confirm('是否确认已核对', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        dataCheck({ id: row.id }).then((res) => {
          this.getList(); 
        })
      }) 
    },
 
    /** 获取镇街选项 */
    getStreetOptions() {
      getDictList().then((res) => {
        this.streetOptions = res.data;
      });
    },
    /** 查询列表 */
    getList() {
      this.loading = true;
      geDetailTabletList({
        ...this.queryParams,
        applyId: this.batchInfo.id,
      })
        .then((res) => {
          this.tableData = res.data.records;
          this.total = res.data.total;
          this.batchInfo = {
            ...res.data.placementApply,
          };
        })
        .finally(() => {
          this.loading = false;
        });
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.queryParams = {
        pageNum: 1,
        pageSize: 10,
        street: undefined,
        projectName: undefined,
        community: undefined,
        headOrIdCard: undefined,
      };
      this.getList();
    },
    /** 返回按钮操作 */
    goBack() {
      this.$router.go(-1);
    },
    /** 新增安置户信息 */
    handleAddHousehold() {
      // 实现新增安置户逻辑
      this.$router.push({
        path: "/applicationBatchList/detailInfo",
        query: {
          parentId: this.batchInfo.id,
          type: "add",
        },
      });
    },
    /** 下载导入模板 */
    handleDownloadTemplate() {
      // 实现下载模板逻辑
      downLoad("/placement-apply/download-template", "安置申请表.xlsx");
    },
    /** 批量导入 */
    handleBatchImport() {
      // 实现批量导入逻辑
      this.uploadDialogVisible = true;
    },
    /** 全部导出 */
    async handleExportAll() {
      // 实现全部导出逻辑  /api/placement-apply/problem-export
      let res = await exportExcell(
        "安置数据表.xlsx",
        { ...this.queryParams, applyId: this.batchInfo.id },
        "/placement-apply/exports"
      );
      if (res) {
        this.$message.success("全部数据导出成功");
      }
    },
    /** 问题数据导出 */
    async handleExportIssueData() {
      // 实现问题数据导出逻辑
      let res = await exportExcell(
        "安置数据表.xlsx",
        { ...this.queryParams, applyId: this.batchInfo.id },
        "/placement-apply/problem-export"
      );
      if (res) {
        this.$message.success("问题数据导出成功");
      }
    },
    /** 安置户详情 */
    handleHouseholdDetail(row) {
      if (this.batchInfo.status == "0") {
        this.$router.push({
          path: "/applicationBatchList/detailInfo",
          query: {
            parentId: this.batchInfo.id,
            type: "detail",
            id: row.id,
          },
        });
      } else {
        this.currentId = row.id;
        this.detailDialogVisible = true;
      }
    },
    /** 安置户编辑 */
    handleHouseholdEdit(row) {
      // 实现安置户编辑逻辑
      this.$router.push({
        path: "/applicationBatchList/detailInfo",
        query: {
          parentId: this.batchInfo.id,
          type: "edit",
          id: row.id,
        },
      });
    },
    /** 安置户删除 */
    handleHouseholdDelete(row) {
      this.$confirm("确认删除该安置户信息吗?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          // 实现删除逻辑
          delDetail({ id: row.id }).then((res) => {
            if (res) {
              this.$message.success("删除成功");
              this.getList();
            }
          });
        })
        .catch(() => { });
    },
    /** 每页显示条数变化 */
    handleSizeChange(val) {
      this.queryParams.pageSize = val;
      this.getList();
    },
    /** 当前页变化 */
    handleCurrentChange(val) {
      this.queryParams.pageNum = val;
      this.getList();
    },
    /** 设置行的className */
    tableRowClassName({ row }) {
      console.log(row, "11111111111");
      if (
        row.compensationAmountWarn == 1 ||
        row.waitFamilyNamesWarn == 1 ||
        row.waitFamilyAreaWarn == 1 ||
        row.subsidyAmountWarn == 1 ||
        row.quarterPayAmountWarn == 1 ||
        row.idCardNoWarn == 1 ||
        row.idCardExistsWarn == 1 ||
        row.compensationSumWarn == 1 || 
        row.downPaymentAmountWarn == 1
      ) {
        return "warning-row";
      }
      return "";
    },
    /** 上传成功 */
    handleUploadSuccess() {
      this.uploadDialogVisible = false;
      this.getList();
      this.$message({
        type: "success",
        message: "导入成功!",
      });
    },
  },
};
</script>
 
<style scoped>
.app-container {
  padding: 20px;
}
 
.batch-info {
  margin-bottom: 20px;
}
 
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
 
.batch-title {
  font-size: 18px;
  font-weight: bold;
}
 
.info-cards {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}
 
.box-card {
  width: 32%;
  background-color: #6f82fb;
  color: white;
  text-align: center;
  border-radius: 5px;
}
 
.card-title {
  font-size: 22px;
  margin: 10px 0;
}
 
.card-desc {
  font-size: 14px;
  margin-bottom: 10px;
}
 
.search-form {
  margin-bottom: 20px;
  background-color: #fff;
  padding: 20px;
  border-radius: 4px;
}
 
.mb8 {
  margin-bottom: 15px;
}
 
.pagination-container {
  margin-top: 15px;
  text-align: right;
}
 
::v-deep .warning-row {
  background: #de868f !important;
}
 
/* ::v-deep .warning-row:hover > td {
  background-color: #faa2a2 !important;
}
 
::v-deep .warning-row .el-button--text {
  color: #000 !important;
}
 
::v-deep .warning-row .el-button--text:hover {
  color: #000 !important;
  background-color: #faa2a2 !important;
} */
</style>