Quellcode durchsuchen

1.出库加载优化,防连点启动

dw vor 5 Tagen
Ursprung
Commit
a6b0998707
1 geänderte Dateien mit 16 neuen und 3 gelöschten Zeilen
  1. 16
    3
      src/components/PopupOut.vue

+ 16
- 3
src/components/PopupOut.vue Datei anzeigen

@@ -1,8 +1,12 @@
1 1
 <template>
2
-	<div>
3
-		<el-dialog title="出库" :visible.sync="dialogVisible" width="1000px" height="400px" @close="close">
2
+	<div  >
3
+		<el-dialog title="出库"
4
+               :visible.sync="dialogVisible" width="1000px" height="400px" @close="close">
4 5
 
5
-			<el-form :model="distribution" label-width="100px" inline="">
6
+			<el-form :model="distribution" v-loading="loading"
7
+               element-loading-text="拼命加载中"
8
+               element-loading-spinner="el-icon-loading"
9
+               label-width="100px" inline="">
6 10
 				<el-form-item label="车号">
7 11
 					<el-select v-model="truckNo" clearable filterable default-first-option @change="change" @clear="clear" style="width: 200px;">
8 12
 						<el-option v-for="item in trucks" :key="item.id" :label="item.truckNo" :value="item.truckNo">
@@ -114,6 +118,7 @@
114 118
 		},
115 119
 		data() {
116 120
 			return {
121
+        loading:false,
117 122
 				trucks: [],
118 123
 				truckNo: '',
119 124
 				customerTableData: [],
@@ -230,6 +235,7 @@
230 235
 				}
231 236
 			},
232 237
 			handleOut() {
238
+        this.loading = true;
233 239
 				this.distribution.truckNo = this.truckNo
234 240
 				var url = 'WareOut/outByDistribution.do'
235 241
 				var param = {
@@ -244,6 +250,9 @@
244 250
 							message: '失败!' + response.data.msg,
245 251
 						});
246 252
 					}
253
+          this.loading = false;
254
+          this.close()
255
+          this.dialogVisible = false
247 256
 				});
248 257
 			},
249 258
 			close() {
@@ -322,4 +331,8 @@
322 331
 	.el-table .success-row {
323 332
 		background: #f0f9eb;
324 333
 	}
334
+  .form-container {
335
+    position: relative; /* 确保loading遮罩定位正确 */
336
+    min-height: 200px; /* 给一个最小高度,避免表单内容太少时遮罩不明显 */
337
+  }
325 338
 </style>

Laden…
Abbrechen
Speichern