张晓波
2023-09-19 164694c47c35d6654df69b533e8dbf8b5423efc5
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
<template>
  <div class="main">
    <div class="main_header">
      <div class="header_item">
        <span class="header_label">环号:</span>
        <el-input v-model="ringNum" clearable placeholder="请输入环号"></el-input>
      </div>
      <div class="header_item">
        <span class="header_label">块号:</span>
        <el-select v-model="blockNum" clearable placeholder="请选择块号">
          <el-option
            v-for="item in blockData"
            :key="item.dictId"
            :label="item.dictName"
            :value="item.dictId">
          </el-option>
        </el-select>
      </div>
      <div class="header_item">
        <span class="header_label">配筋:</span>
        <el-select v-model="reinforcement" clearable placeholder="请选择配筋">
          <el-option
            v-for="item in reinforcementData"
            :key="item.dictId"
            :label="item.dictName"
            :value="item.dictId">
          </el-option>
        </el-select>
      </div>
      <div class="header_item">
        <span class="header_label">注浆孔:</span>、
        <el-select v-model="groutingHoles" clearable placeholder="请输入注浆孔">
          <el-option
            v-for="item in groutingHolesData"
            :key="item.dictId"
            :label="item.dictName"
            :value="item.dictId">
          </el-option>
        </el-select>
      </div>
      <div class="header_item">
        <span class="header_label">入池时间:</span>
        <el-date-picker 
          v-model="putTime" 
          value-format="yyyy-MM-dd HH:mm:ss"
          type="datetimerange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期">
        </el-date-picker>
      </div>
      <div class="header_item">
        <span class="header_label">出池时间:</span>
        <el-date-picker 
          v-model="outTime" 
          value-format="yyyy-MM-dd HH:mm:ss"
          type="datetimerange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期">
        </el-date-picker>
      </div>
      <div class="header_item">
        <el-button icon="el-icon-search" @click="searchCisternRecordListList(true)">查询</el-button>
      </div>
    </div>
    <div class="main_content">
      <el-table
        v-loading="loading"
        :data="recordList"
        height="100%" >
        <el-table-column label="序号" width="60" align="center">
          <template #default="scope">
            <span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="ringNum" label="环号" align="center"></el-table-column>
        <el-table-column prop="proName" label="项目名称" align="center"></el-table-column>
        <el-table-column prop="sizeName" label="尺寸" align="center"></el-table-column>
        <el-table-column prop="blockNumName" label="块号" align="center"></el-table-column>
        <el-table-column prop="reinforcementName" label="配筋" align="center"></el-table-column>
        <el-table-column prop="turnName" label="转向" align="center"></el-table-column>
        <el-table-column prop="groutingHolesName" label="注浆孔" align="center"></el-table-column>
        <el-table-column prop="outCulTime" label="出池时间" align="center"></el-table-column>
        <el-table-column prop="outCulUser" label="出池操作人" align="center"></el-table-column>
        <el-table-column prop="diffDescript" label="水养时长" align="center"></el-table-column>
        <el-table-column prop="createTime" label="入池时间" align="center"></el-table-column>
        <el-table-column prop="createUser" label="入池操作人" align="center"></el-table-column>
      </el-table>
    </div>
    <div class="main_footer">
      <el-pagination
        background
        @current-change="changePageNum"
        @size-change="changePageSize"
        :current-page="pageNum"
        :page-sizes="[10, 20, 50, 100]"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total">
      </el-pagination>
    </div>
  </div>
</template>
 
<script>
  export default {
    name: 'RecordIndex',
    props: {
      waterId: {
        type: String
      }
    },
    data() {
      return {
        ringNum: '',
        blockNum: '',
        blockData: [],
        reinforcement: '',
        reinforcementData: [],
        groutingHoles: '',
        groutingHolesData: [],
        putTime: '',
        outTime: '',
        pageNum: 1,
        pageSize: 10,
        total: 0,
        loading: false,
        recordList: [],
      }
    },
    mounted() {
      this.searchBlockDictionary();
      this.searchReinforcementDictionary();
      this.searchGroutingHolesDictionary()
      this.searchCisternRecordListList(true);
    },
    methods: {
      // 查询块号信息
      async searchBlockDictionary() {
        const { data } = await this.$api.Dictionary.searchDictionary({
          pageNum: 1,
          pageSize: 1000000,
          dictType: '5',
        })
        this.blockData = data.list;
      },
      // 查询配筋信息
      async searchReinforcementDictionary() {
        const { data } = await this.$api.Dictionary.searchDictionary({
          pageNum: 1,
          pageSize: 1000000,
          dictType: '2',
        })
        this.reinforcementData = data.list;
      },
      // 查询注浆孔信息
      async searchGroutingHolesDictionary() {
        const { data } = await this.$api.Dictionary.searchDictionary({
          pageNum: 1,
          pageSize: 1000000,
          dictType: '4',
        })
        this.groutingHolesData = data.list;
      },
      // 查询水养池实时监控信息
      searchCisternRecordListList(bol) {
        if(bol) {
          this.pageNum = 1;
        }
        this.loading = true;
        this.recordList = [];
        this.$api.DuctpiecePLM.searchCisternRecordListList({
          pageNum: this.pageNum,
          pageSize: this.pageSize,
          ringNum: this.ringNum,
          waterCultivatedId: this.waterId,
          blockNum: this.blockNum,
          reinforcement: this.reinforcement,
          groutingHoles: this.groutingHoles,
          startTime: this.putTime ? this.putTime[0] : '',
          endTime: this.putTime ? this.putTime[1] : '',
          outCulStartTime: this.outTime ? this.outTime[0] : '',
          outCulEndTime: this.outTime ? this.outTime[1] : '',
        }).then((res) => {
          if(res.success) {
            this.total = res.data.total;
            this.recordList = res.data.list;
          }
          this.loading = false;
        }).catch(() => {
          this.loading = false;
        })
      },
      // 切换页数
      changePageNum(page) {
        this.pageNum = page;
        this.searchCisternRecordListList();
      },
      // 切换每页条数
      changePageSize(size) {
        this.pageSize = size;
        this.searchCisternRecordListList();
      },
    }
  }
</script>
 
<style lang="scss" scoped>
@import '@/style/layout-main.scss';
 
.main {
  height: 100% !important;
  background: none !important;
}
 
::v-deep .el-table tr {
  &:nth-of-type(even) {
    background: #082E56 !important;
  }
}
</style>