task#6524 报备防重复点击
This commit is contained in:
@ -21,7 +21,7 @@ service.interceptors.request.use(
|
|||||||
}
|
}
|
||||||
config.headers['Content-Type'] = config.contentType || 'application/x-www-form-urlencoded'
|
config.headers['Content-Type'] = config.contentType || 'application/x-www-form-urlencoded'
|
||||||
let token = localStorage.getItem('token');
|
let token = localStorage.getItem('token');
|
||||||
// let token='4099761587129c46b03c9316c9e866c9'
|
// let token='eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBTkNIQU5HIiwidXNlcklkIjo0NTY3MSwibmFtZSI6IuWuieeVhSIsInVzZXJOYW1lIjoiQU5DSEFORyIsInN1cHBsaWVySWQiOjExMjgsImlzWmQiOjAsImV4cCI6MTc1MjEzNDc2M30.q1O7C8thZzEMVKYDhBQ-N_14Fh9Bqejj7j11EKLF5Aw'
|
||||||
// let token='eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJTSEhQWEIiLCJ1c2VySWQiOjU0NzI2LCJuYW1lIjoiI-a1i-ivleWwj-eZveeZvSIsInVzZXJOYW1lIjoiU0hIUFhCIiwic3VwcGxpZXJJZCI6MTAwMDE2NSwiZXhwIjoxNzQ0NTEwNzkwfQ.JPk0OA7slYJN3FIi_uhW4Y0CiWRvl6R1dK8MRTbyhD8'
|
// let token='eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJTSEhQWEIiLCJ1c2VySWQiOjU0NzI2LCJuYW1lIjoiI-a1i-ivleWwj-eZveeZvSIsInVzZXJOYW1lIjoiU0hIUFhCIiwic3VwcGxpZXJJZCI6MTAwMDE2NSwiZXhwIjoxNzQ0NTEwNzkwfQ.JPk0OA7slYJN3FIi_uhW4Y0CiWRvl6R1dK8MRTbyhD8'
|
||||||
if(!(reqUrl=='/supplier/supplierTraining/trainingTask' || reqUrl=='/supplier/supplierTraining/normalList' || reqUrl=='/supplier/supplierTraining/trainingList')){
|
if(!(reqUrl=='/supplier/supplierTraining/trainingTask' || reqUrl=='/supplier/supplierTraining/normalList' || reqUrl=='/supplier/supplierTraining/trainingList')){
|
||||||
config.headers['Authorization'] = `${token}`;
|
config.headers['Authorization'] = `${token}`;
|
||||||
|
@ -150,6 +150,7 @@
|
|||||||
userOrderId: '',
|
userOrderId: '',
|
||||||
userOrderCode: '',
|
userOrderCode: '',
|
||||||
driverId: '',
|
driverId: '',
|
||||||
|
clickFlag: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
@ -191,48 +192,56 @@
|
|||||||
this.recordList = recordList.data;
|
this.recordList = recordList.data;
|
||||||
},
|
},
|
||||||
async saveHandler() {
|
async saveHandler() {
|
||||||
let data = {
|
if( this.clickFlag ) {
|
||||||
source: Number(this.type),
|
this.clickFlag = false;
|
||||||
reportContent: this.remark,
|
let data = {
|
||||||
userOrderId: Number(this.userOrderId),
|
source: Number(this.type),
|
||||||
reportConfigId: this.currentInfo.id,
|
reportContent: this.remark,
|
||||||
userOrderCode: this.userOrderCode,
|
userOrderId: Number(this.userOrderId),
|
||||||
driverId: this.driverId,
|
reportConfigId: this.currentInfo.id,
|
||||||
}
|
userOrderCode: this.userOrderCode,
|
||||||
if(this.currentInfo.component == 'time') {
|
driverId: this.driverId,
|
||||||
if( !this.appointTime ) {
|
}
|
||||||
Toast('预约时间不能为空')
|
if(this.currentInfo.component == 'time') {
|
||||||
|
if( !this.appointTime ) {
|
||||||
|
Toast('预约时间不能为空')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if( new Date(this.appointTime).getTime() <= new Date().getTime() ) {
|
||||||
|
Toast('预约时间不能小于当前时间')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
data.time = this.appointTime
|
||||||
|
}
|
||||||
|
if(this.currentInfo.component == 'address') {
|
||||||
|
if( !this.address ) {
|
||||||
|
Toast('地址不能为空')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
data.address = this.address
|
||||||
|
data.lat = this.lat;
|
||||||
|
data.lng = this.lng;
|
||||||
|
}
|
||||||
|
if( !this.remark ) {
|
||||||
|
Toast('备注内容不能为空')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if( new Date(this.appointTime).getTime() <= new Date().getTime() ) {
|
try {
|
||||||
Toast('预约时间不能小于当前时间')
|
await newOrderReporting(data)
|
||||||
return
|
Dialog.alert({
|
||||||
|
title: '提示',
|
||||||
|
message: "报备添加成功"
|
||||||
|
}).then(async () => {
|
||||||
|
await this.getRecordList()
|
||||||
|
this.addReportShow = false
|
||||||
|
this.scrollToBottom();
|
||||||
|
this.initDialogData();
|
||||||
|
this.clickFlag = true
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
this.clickFlag = true
|
||||||
}
|
}
|
||||||
data.time = this.appointTime
|
|
||||||
}
|
}
|
||||||
if(this.currentInfo.component == 'address') {
|
|
||||||
if( !this.address ) {
|
|
||||||
Toast('地址不能为空')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
data.address = this.address
|
|
||||||
data.lat = this.lat;
|
|
||||||
data.lng = this.lng;
|
|
||||||
}
|
|
||||||
if( !this.remark ) {
|
|
||||||
Toast('备注内容不能为空')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
await newOrderReporting(data)
|
|
||||||
Dialog.alert({
|
|
||||||
title: '提示',
|
|
||||||
message: "报备添加成功"
|
|
||||||
}).then(async () => {
|
|
||||||
await this.getRecordList()
|
|
||||||
this.addReportShow = false
|
|
||||||
this.scrollToBottom();
|
|
||||||
this.initDialogData();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
initDialogData() {
|
initDialogData() {
|
||||||
this.appointTime = '';
|
this.appointTime = '';
|
||||||
|
Reference in New Issue
Block a user