张庆宇 преди 1 седмица
родител
ревизия
c44b98eadd
променени са 2 файла, в които са добавени 36 реда и са изтрити 28 реда
  1. 28
    22
      src/components/PopupOut.vue
  2. 8
    6
      src/view/record/outrecord.vue

+ 28
- 22
src/components/PopupOut.vue Целия файл

@@ -31,7 +31,7 @@
31 31
 					</el-select>
32 32
 				</el-form-item>
33 33
 				<el-form-item label="">
34
-					<el-button style="margin-left: 25px" size="medium" type="success" @click="handleOut">出库</el-button>
34
+					<el-button style="margin-left: 25px" size="medium" type="success" :disabled="outLoading"  :loading="outLoading" @click="handleOut">出库</el-button>
35 35
 				</el-form-item>
36 36
 				<el-form-item label="是否打印地址">
37 37
 					<el-switch v-model="addressYN" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
@@ -145,7 +145,8 @@
145 145
 				addressYN: true,
146 146
 				teleYN:true,
147 147
 				time: '',
148
-				tallyPeopleOption:[]
148
+				tallyPeopleOption:[],
149
+				outLoading: false,//控制按钮是否可用的控制变量
149 150
 			};
150 151
 		},
151 152
 		methods: {
@@ -238,32 +239,37 @@
238 239
 				}
239 240
 			},
240 241
 			handleOut() {
241
-				this.distribution.truckNo = this.truckNo
242
-				var url = 'WareOut/outByDistribution.do'
243
-				var param = {
244
-					json: JSON.stringify(this.distribution),
242
+				if (this.outLoading) {
243
+					return;
245 244
 				}
246
-				axios.post(url, param).then(response => {
245
+				try {
246
+					this.outLoading = true;
247
+					this.distribution.truckNo = this.truckNo;
248
+					const response = axios.post('WareOut/outByDistribution.do', {
249
+						json: JSON.stringify(this.distribution),
250
+					});
251
+
247 252
 					if (response.data.code == 0) {
248
-						if(response.data.payWay == '现金'){
249
-							this.$alert('存在支付方式为现金的材料,价格为'+response.data.InvoicePrice+',请在出库界面确认价格', '警告', {
250
-								confirmButtonText: '确定',
251
-								callback: action => {
252
-									this.$message({
253
-									type: 'info',
254
-									message: `已确认`
255
-									});
253
+						if (response.data.payWay == '现金') {
254
+							this.$alert(
255
+								`存在支付方式为现金的材料,价格为${response.data.InvoicePrice},请在出库界面确认价格`,
256
+								'警告',
257
+								{
258
+									confirmButtonText: '确定',
256 259
 								}
257
-							});
260
+							);
261
+							this.$message.info('已确认');
258 262
 						}
259
-						this.showCustomerTable()
263
+						this.showCustomerTable();
260 264
 					} else {
261
-						this.$message({
262
-							type: 'error',
263
-							message: '失败!' + response.data.msg,
264
-						});
265
+						this.$message.error('失败!' + response.data.msg);
265 266
 					}
266
-				});
267
+				} catch (error){
268
+					this.$message.error('请求失败!' + (error.message || ''));
269
+				}finally {
270
+        			this.outLoading = false;
271
+      			}
272
+				
267 273
 			},
268 274
 			close() {
269 275
 				this.distribution = {

+ 8
- 6
src/view/record/outrecord.vue Целия файл

@@ -70,11 +70,11 @@
70 70
 							    </el-date-picker>
71 71
 							</el-form-item>
72 72
 						<el-form-item label=" " style="margin-top: -15px;margin-left: -60px">
73
-							<el-button @click="handleSearch" type="primary" size="small">查询</el-button>
74
-							<el-button @click="handlePrintOut" type="primary" size="small" style="width:90px;text-align: left">打印出库单</el-button>
75
-							<el-button @click="handleOutBack" type="danger" size="small">取消出库</el-button>
76
-							<el-button @click="handleVerifyAcc" type="primary" size="small" style="width:70px">对账</el-button>
77
-							<el-button @click="handleModifyPrice" type="primary" size="small" >批量改价</el-button>
73
+							<el-button :disabled="outLoading" :loading="outLoading" @click="handleSearch" type="primary" size="small">查询</el-button>
74
+							<el-button :disabled="outLoading" :loading="outLoading" @click="handlePrintOut" type="primary" size="small" style="width:90px;text-align: left">打印出库单</el-button>
75
+							<el-button :disabled="outLoading" :loading="outLoading" @click="handleOutBack" type="danger" size="small">取消出库</el-button>
76
+							<el-button :disabled="outLoading" :loading="outLoading" @click="handleVerifyAcc" type="primary" size="small" style="width:70px">对账</el-button>
77
+							<el-button :disabled="outLoading" :loading="outLoading" @click="handleModifyPrice" type="primary" size="small" >批量改价</el-button>
78 78
 						</el-form-item>
79 79
 						<el-form-item label="" style="margin-top: -15px">
80 80
 							<el-upload class="upload-demo" action="" 
@@ -361,6 +361,7 @@
361 361
 				optionsCust:[],
362 362
 				addressYN: true,
363 363
 				teleYN:true,
364
+				outLoading:false,
364 365
 			};
365 366
 		},
366 367
 		//页面加载完成渲染
@@ -630,6 +631,7 @@
630 631
 				this.selectRows = val
631 632
 			},
632 633
 			handleOutBack() {
634
+				this.outLoading = true;
633 635
 				this.$confirm('该操作将取消出库, 是否继续?', '提示', {
634 636
 					confirmButtonText: '确定',
635 637
 					cancelButtonText: '取消',
@@ -656,7 +658,7 @@
656 658
 							message: '已取消删除'
657 659
 						});          
658 660
 					});
659
-
661
+				this.outLoading = false;
660 662
 			},
661 663
 			receviceFromWareStack(stack) {
662 664
 				var url = 'WareOut/back.do'

Loading…
Отказ
Запис