Blame view

src/views/inspection/adminInspectionTaskList.vue 7.99 KB
b25b036d   wuxw   v1.9 优化日期
1
  <template>
e0196f8a   wuxw   开发完成admin下巡检任务
2
3
4
5
6
7
8
9
10
11
12
13
14
15
    <div class="admin-inspection-task-container">
      <el-row class="flex justify-start">
        <el-col :span="4" class="room-floor-unit-tree">
          <community-inspection-tree ref="communityTree" @notifyQuery="handleTreeQuery"></community-inspection-tree>
        </el-col>
        <el-col :span="20" class=" margin-left-sm">
          <el-card class="box-card">
            <div slot="header" class="clearfix flex justify-between">
              <span>{{ $t('adminInspectionTask.search.title') }}</span>
            </div>
            <el-row :gutter="20">
              <el-col :span="6">
                <el-date-picker
                  v-model="searchForm.startTime"
b25b036d   wuxw   v1.9 优化日期
16
                  type="datetime" value-format="yyyy-MM-dd HH:mm:ss"                :placeholder="$t('adminInspectionTask.search.startTime')"
e0196f8a   wuxw   开发完成admin下巡检任务
17
                  style="width: 100%"
b25b036d   wuxw   v1.9 优化日期
18
                  
e0196f8a   wuxw   开发完成admin下巡检任务
19
20
21
22
23
                ></el-date-picker>
              </el-col>
              <el-col :span="6">
                <el-date-picker
                  v-model="searchForm.endTime"
b25b036d   wuxw   v1.9 优化日期
24
                  type="datetime" value-format="yyyy-MM-dd HH:mm:ss"                :placeholder="$t('adminInspectionTask.search.endTime')"
e0196f8a   wuxw   开发完成admin下巡检任务
25
                  style="width: 100%"
b25b036d   wuxw   v1.9 优化日期
26
                  
e0196f8a   wuxw   开发完成admin下巡检任务
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
                ></el-date-picker>
              </el-col>
              <el-col :span="6">
                <el-select
                  v-model="searchForm.state"
                  :placeholder="$t('adminInspectionTask.search.state')"
                  style="width: 100%"
                >
                  <el-option
                    v-for="item in stateTypes"
                    :key="item.statusCd"
                    :label="item.name"
                    :value="item.statusCd"
                  ></el-option>
                </el-select>
              </el-col>
              <el-col :span="6">
                <el-button type="primary" @click="handleSearch">{{ $t('adminInspectionTask.search.button') }}</el-button>
              </el-col>
            </el-row>
          </el-card>
  
          <el-card class="box-card margin-top">
            <div slot="header" class="clearfix flex justify-between">
              <span>{{ $t('adminInspectionTask.list.title') }}</span>
            </div>
            <el-table :data="tableData" border style="width: 100%">
              <el-table-column prop="taskId" :label="$t('adminInspectionTask.table.taskId')" align="center"></el-table-column>
              <el-table-column prop="communityName" :label="$t('adminInspectionTask.table.communityName')" align="center"></el-table-column>
              <el-table-column prop="inspectionPlanName" :label="$t('adminInspectionTask.table.inspectionPlanName')" align="center"></el-table-column>
              <el-table-column :label="$t('adminInspectionTask.table.planTime')" align="center">
                <template slot-scope="scope">
                  <div>{{ scope.row.planInsTime }}</div>
                  <div>{{ scope.row.planEndTime }}</div>
                </template>
              </el-table-column>
              <el-table-column prop="actInsTime" :label="$t('adminInspectionTask.table.actInsTime')" align="center">
                <template slot-scope="scope">
                  {{ scope.row.actInsTime || '-' }}
                </template>
              </el-table-column>
              <el-table-column prop="originalPlanUserName" :label="$t('adminInspectionTask.table.originalPlanUserName')" align="center">
                <template slot-scope="scope">
                  {{ scope.row.originalPlanUserName || '-' }}
                </template>
              </el-table-column>
              <el-table-column prop="planUserName" :label="$t('adminInspectionTask.table.planUserName')" align="center"></el-table-column>
              <el-table-column prop="transferDesc" :label="$t('adminInspectionTask.table.transferDesc')" align="center">
                <template slot-scope="scope">
                  {{ scope.row.transferDesc || '-' }}
                </template>
              </el-table-column>
              <el-table-column prop="signTypeName" :label="$t('adminInspectionTask.table.signTypeName')" align="center"></el-table-column>
              <el-table-column prop="stateName" :label="$t('adminInspectionTask.table.stateName')" align="center">
                <template slot-scope="scope">
                  <span v-if="scope.row.state === '20200408'" class="text-danger">{{ scope.row.stateName }}</span>
                  <span v-else>{{ scope.row.stateName }}</span>
                </template>
              </el-table-column>
              <el-table-column :label="$t('adminInspectionTask.table.operation')" align="center" width="120">
                <template slot-scope="scope">
                  <el-button size="mini" @click="handleDetail(scope.row)">{{ $t('adminInspectionTask.table.detail') }}</el-button>
                </template>
              </el-table-column>
            </el-table>
  
            <el-row class="margin-top">
              <el-col :span="18">
                <div class="tip-text">
                  {{ $t('adminInspectionTask.list.tip') }}
                </div>
              </el-col>
              <el-col :span="6">
                <el-pagination
                  :current-page.sync="pagination.current"
                  :page-sizes="[10, 20, 30, 50]"
                  :page-size="pagination.size"
                  :total="pagination.total"
                  layout="total, sizes, prev, pager, next, jumper"
                  @size-change="handleSizeChange"
                  @current-change="handleCurrentChange"
                ></el-pagination>
              </el-col>
            </el-row>
          </el-card>
        </el-col>
      </el-row>
    </div>
  </template>
  
  <script>
  import { listAdminInspectionTasks } from '@/api/inspection/adminInspectionTaskApi'
  import CommunityInspectionTree from '@/components/inspection/communityInspectionTree'
  import {getDict} from '@/api/community/communityApi'
  
  export default {
    name: 'AdminInspectionTaskList',
    components: {
      CommunityInspectionTree
    },
    data() {
      return {
        searchForm: {
          startTime: '',
          endTime: '',
          state: '',
          communityId: '',
          inspectionPlanId: '',
          staffId: '',
          orderByDesc: 'desc'
        },
        stateTypes: [],
        tableData: [],
        pagination: {
          current: 1,
          size: 10,
          total: 0
        },
        loading: false
      }
    },
    created() {
      this.getDictData()
      this.getList()
    },
    methods: {
      async getDictData() {
        try {
          const response = await getDict('inspection_task', 'state')
          this.stateTypes = response || []
        } catch (error) {
          console.error('Failed to get dict data:', error)
        }
      },
      async getList() {
        this.loading = true
        try {
          const params = {
            ...this.searchForm,
            page: this.pagination.current,
            row: this.pagination.size
          }
          const response = await listAdminInspectionTasks(params)
          this.tableData = response.inspectionTasks || []
48ea9c43   wuxw   巡检开发完成
171
          this.pagination.total = response.total || 0
e0196f8a   wuxw   开发完成admin下巡检任务
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
        } catch (error) {
          console.error('Failed to get inspection tasks:', error)
        } finally {
          this.loading = false
        }
      },
      handleTreeQuery(params) {
        this.searchForm.communityId = params.communityId
        this.searchForm.inspectionPlanId = params.inspectionPlanId
        this.searchForm.staffId = params.staffId
        this.getList()
      },
      handleSearch() {
        this.pagination.current = 1
        this.getList()
      },
      handleDetail(row) {
        window.open(`/#/views/inspection/adminInspectionTaskDetail?taskId=${row.taskId}`)
      },
      handleSizeChange(val) {
        this.pagination.size = val
        this.getList()
      },
      handleCurrentChange(val) {
        this.pagination.current = val
        this.getList()
      }
    }
  }
  </script>
  
  <style lang="scss" scoped>
  .admin-inspection-task-container {
    padding: 20px;
  
    .margin-top {
      margin-top: 20px;
    }
  
    .margin-top-xs {
      margin-top: 10px;
    }
  
    .margin-left-sm {
      margin-left: 10px;
    }
  
    .room-floor-unit-tree {
      padding-right: 0;
    }
  
    .tip-text {
      padding: 10px;
      color: #666;
      font-size: 14px;
    }
  
    .text-danger {
      color: #f56c6c;
      font-weight: bold;
    }
  }
  </style>