riku
2025-07-23 fe7fd6e4b1450c01faba724bb22b1d050e896c92
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
<template>
  <FYTable @search="onSearch">
    <template #options> </template>
 
    <template #buttons> </template>
 
    <template #table-column>
      <el-table-column
        fixed="left"
        sortable
        prop="ncNum"
        label="编号"
        width="100"
      >
      </el-table-column>
      <el-table-column
        fixed="left"
        prop="ncItemName"
        label="项目名称"
        :show-overflow-tooltip="true"
        width="400"
      >
      </el-table-column>
      <!-- <el-table-column prop="ncItemUnit" label="业主单位" width="130" /> -->
      <!-- <el-table-column prop="ncProvinceName" label="省" width="90" />
      <el-table-column prop="ncCityName" label="市" width="90" /> -->
      <!-- <el-table-column prop="ncDistrictName" label="区县" width="90" /> -->
      <!-- <el-table-column prop="townname" label="街道" width="110" /> -->
      <el-table-column
        prop="ncConstructionUnit"
        label="施工单位"
        min-width="100"
      />
      <el-table-column prop="ncPerson" label="申请人" width="110" />
      <el-table-column prop="ncApplyContent" label="申请内容" width="110" />
      <el-table-column prop="ncStartDate" label="工期开始" width="110">
        <template #default="{ row }">
          {{ $fm.formatYMD(row.ncStartDate) }}
        </template>
      </el-table-column>
      <el-table-column prop="ncEndDate" label="工期结束" width="110">
        <template #default="{ row }">
          {{ $fm.formatYMD(row.ncEndDate) }}
        </template>
      </el-table-column>
      <!-- <el-table-column prop="ncCreateTime" label="申请时间" width="110" >
        <template #default="{row}">
          {{ $fm.formatYMD(row.ncCreateTime) }}
        </template>
      </el-table-column> -->
      <el-table-column prop="ncUserId" label="匹配用户" width="110">
        <template #default="{ row }">
          <el-text v-loading="row._loading">{{
            row._user ? row._user.realName : '未匹配'
          }}</el-text>
        </template>
      </el-table-column>
      <el-table-column fixed="right" label="操作" width="160">
        <template #default="scope">
          <el-button
            :loading="scope.row.loading1"
            type="default"
            size="small"
            @click="itemEdit(scope)"
            >编辑</el-button
          >
          <el-button
            :loading="scope.row.loading2"
            :type="scope.row.extension1 != '0' ? 'danger' : 'primary'"
            size="small"
            @click="itemActive(scope)"
            >{{ scope.row.extension1 != '0' ? '下线' : '上线' }}</el-button
          >
        </template>
      </el-table-column>
    </template>
  </FYTable>
</template>
<script setup>
import { ref } from 'vue';
import nightConstructionApi from '@/api/fysp/nightConstructionApi';
import userApi from '@/api/fysp/userApi';
 
const data = ref([]);
 
function onSearch(page, callback) {
  return nightConstructionApi
    .fetchRecord({
      cityCode: '3100',
      districtCode: '310106',
      page: page.currentPage,
      perPage: page.pageSize
    })
    .then((res) => {
      if (res.success) {
        res.data.forEach((d) => {
          res.data._loading = true;
          userApi.getUserById(d.ncUserId).then((res1) => {
            res.data._user = res1;
          });
        });
        callback({
          data: res.data,
          total: res.head.totalCount
        });
      }
    });
}
</script>