|
|
@@ -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 = {
|