Procházet zdrojové kódy

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

chenghanbin před 5 měsíci
rodič
revize
2d1ecacd8b
1 změnil soubory, kde provedl 31 přidání a 16 odebrání
  1. 31 16
      src/views/PGSMSP/lqyfw/grainAnalysis.vue

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

@@ -3,21 +3,24 @@
3 3
 	<div class="pageBox">
4 4
 		<div class="searchBox">
5 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 24
 			</a-form>
22 25
 		</div>
23 26
 		<div class="tableBox">
@@ -67,6 +70,7 @@
67 70
 		showDetails: false,
68 71
 		activeModule: ''
69 72
 	})
73
+	const gatherTime = ref([])
70 74
 	const tableData = ref([])
71 75
 	// 分页器的配置
72 76
 	const pagination = ref({
@@ -74,6 +78,8 @@
74 78
 		current: 1,
75 79
 		size: 10,
76 80
 		endJysj: '',
81
+		startJysj: '',
82
+		gatherTime: [],
77 83
 		orgId: orgId
78 84
 	})
79 85
 
@@ -81,7 +87,12 @@
81 87
 		getTableData()
82 88
 	})
83 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 96
 		api.collectList(pagination.value).then((res) => {
86 97
 			tableData.value = res.records
87 98
 			pagination.value.size = res.size
@@ -113,6 +124,7 @@
113 124
 	// 清空搜索条件
114 125
 	function resetForm() {
115 126
 		formRef.value.resetFields()
127
+		gatherTime.value = []
116 128
 		getTableData()
117 129
 	}
118 130
 
@@ -161,6 +173,9 @@
161 173
 					.ant-btn {
162 174
 						margin: 0 8px;
163 175
 					}
176
+					.ant-picker-range {
177
+						width: 100%;
178
+					}
164 179
 				}
165 180
 			}
166 181
 		}