Browse Source

粮情分析 根据时间查询的问题

chenghanbin 5 months ago
parent
commit
2d1ecacd8b
1 changed files with 31 additions and 16 deletions
  1. 31 16
      src/views/PGSMSP/lqyfw/grainAnalysis.vue

+ 31 - 16
src/views/PGSMSP/lqyfw/grainAnalysis.vue

@@ -3,21 +3,24 @@
3
 	<div class="pageBox">
3
 	<div class="pageBox">
4
 		<div class="searchBox">
4
 		<div class="searchBox">
5
 			<a-form ref="formRef" :model="pagination">
5
 			<a-form ref="formRef" :model="pagination">
6
-				<a-form-item label="库区名称" name="storehouseName">
7
-					<a-input v-model:value="pagination.storehouseName" placeholder="请输入库区名称" />
8
-				</a-form-item>
9
-				<a-form-item label="预警时间" name="gatherTime">
10
-					<a-date-picker
11
-						show-time
12
-						v-model:value="pagination.gatherTime"
13
-						valueFormat="YYYY-MM-DD HH:mm:ss"
14
-						placeholder="请选择预警时间"
15
-					/>
16
-				</a-form-item>
17
-				<a-form-item>
18
-					<a-button type="primary" @click="getTableData">查询</a-button>
19
-					<a-button @click="resetForm">清空</a-button>
20
-				</a-form-item>
6
+				<a-row>
7
+					<a-col :span="4">
8
+						<a-form-item label="库区名称" name="storehouseName">
9
+							<a-input v-model:value="pagination.storehouseName" placeholder="请输入库区名称" />
10
+						</a-form-item>
11
+					</a-col>
12
+					<a-col :span="7">
13
+						<a-form-item label="采集时间" name="gatherTime">
14
+							<a-range-picker show-time v-model:value="gatherTime" valueFormat="YYYY-MM-DD HH:mm:ss" />
15
+						</a-form-item>
16
+					</a-col>
17
+					<a-col :span="6">
18
+						<a-form-item>
19
+							<a-button type="primary" @click="getTableData">查询</a-button>
20
+							<a-button @click="resetForm">清空</a-button>
21
+						</a-form-item>
22
+					</a-col>
23
+				</a-row>
21
 			</a-form>
24
 			</a-form>
22
 		</div>
25
 		</div>
23
 		<div class="tableBox">
26
 		<div class="tableBox">
@@ -67,6 +70,7 @@
67
 		showDetails: false,
70
 		showDetails: false,
68
 		activeModule: ''
71
 		activeModule: ''
69
 	})
72
 	})
73
+	const gatherTime = ref([])
70
 	const tableData = ref([])
74
 	const tableData = ref([])
71
 	// 分页器的配置
75
 	// 分页器的配置
72
 	const pagination = ref({
76
 	const pagination = ref({
@@ -74,6 +78,8 @@
74
 		current: 1,
78
 		current: 1,
75
 		size: 10,
79
 		size: 10,
76
 		endJysj: '',
80
 		endJysj: '',
81
+		startJysj: '',
82
+		gatherTime: [],
77
 		orgId: orgId
83
 		orgId: orgId
78
 	})
84
 	})
79
 
85
 
@@ -81,7 +87,12 @@
81
 		getTableData()
87
 		getTableData()
82
 	})
88
 	})
83
 	function getTableData() {
89
 	function getTableData() {
84
-		tableData.value = [{}]
90
+		tableData.value = []
91
+		if (gatherTime.value) {
92
+			pagination.value.endJysj = gatherTime.value[1]
93
+			pagination.value.startJysj = gatherTime.value[0]
94
+		}
95
+
85
 		api.collectList(pagination.value).then((res) => {
96
 		api.collectList(pagination.value).then((res) => {
86
 			tableData.value = res.records
97
 			tableData.value = res.records
87
 			pagination.value.size = res.size
98
 			pagination.value.size = res.size
@@ -113,6 +124,7 @@
113
 	// 清空搜索条件
124
 	// 清空搜索条件
114
 	function resetForm() {
125
 	function resetForm() {
115
 		formRef.value.resetFields()
126
 		formRef.value.resetFields()
127
+		gatherTime.value = []
116
 		getTableData()
128
 		getTableData()
117
 	}
129
 	}
118
 
130
 
@@ -161,6 +173,9 @@
161
 					.ant-btn {
173
 					.ant-btn {
162
 						margin: 0 8px;
174
 						margin: 0 8px;
163
 					}
175
 					}
176
+					.ant-picker-range {
177
+						width: 100%;
178
+					}
164
 				}
179
 				}
165
 			}
180
 			}
166
 		}
181
 		}