Browse Source

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

dw 5 days ago
parent
commit
a6b0998707
1 changed files with 16 additions and 3 deletions
  1. 16
    3
      src/components/PopupOut.vue

+ 16
- 3
src/components/PopupOut.vue View File

1
 <template>
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
 				<el-form-item label="车号">
10
 				<el-form-item label="车号">
7
 					<el-select v-model="truckNo" clearable filterable default-first-option @change="change" @clear="clear" style="width: 200px;">
11
 					<el-select v-model="truckNo" clearable filterable default-first-option @change="change" @clear="clear" style="width: 200px;">
8
 						<el-option v-for="item in trucks" :key="item.id" :label="item.truckNo" :value="item.truckNo">
12
 						<el-option v-for="item in trucks" :key="item.id" :label="item.truckNo" :value="item.truckNo">
114
 		},
118
 		},
115
 		data() {
119
 		data() {
116
 			return {
120
 			return {
121
+        loading:false,
117
 				trucks: [],
122
 				trucks: [],
118
 				truckNo: '',
123
 				truckNo: '',
119
 				customerTableData: [],
124
 				customerTableData: [],
230
 				}
235
 				}
231
 			},
236
 			},
232
 			handleOut() {
237
 			handleOut() {
238
+        this.loading = true;
233
 				this.distribution.truckNo = this.truckNo
239
 				this.distribution.truckNo = this.truckNo
234
 				var url = 'WareOut/outByDistribution.do'
240
 				var url = 'WareOut/outByDistribution.do'
235
 				var param = {
241
 				var param = {
244
 							message: '失败!' + response.data.msg,
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
 			close() {
258
 			close() {
322
 	.el-table .success-row {
331
 	.el-table .success-row {
323
 		background: #f0f9eb;
332
 		background: #f0f9eb;
324
 	}
333
 	}
334
+  .form-container {
335
+    position: relative; /* 确保loading遮罩定位正确 */
336
+    min-height: 200px; /* 给一个最小高度,避免表单内容太少时遮罩不明显 */
337
+  }
325
 </style>
338
 </style>

Loading…
Cancel
Save