|
|
@@ -906,17 +906,31 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
lock(e) {
|
|
|
+ this.$toast.loading({
|
|
|
+ message: '加载中...',
|
|
|
+ forbidClick: true
|
|
|
+ });
|
|
|
let date = e.replace(/月/, '');
|
|
|
let date2 = this.dayjs().add(date, 'month');
|
|
|
let date3 = date2.diff(this.dayjs(), 'day');
|
|
|
- this.$http.post('/asset/lockAsset?assetId=' + this.assetId + '&duration=' + 'P' + date3 + 'D').then(() => {
|
|
|
- this.$toast.success('上锁成功');
|
|
|
- this.showLock = false;
|
|
|
- this.showAction = false;
|
|
|
- setTimeout(() => {
|
|
|
- this.getProduct(true);
|
|
|
- }, 1000);
|
|
|
- });
|
|
|
+ this.$http
|
|
|
+ .post('/asset/lockAsset?assetId=' + this.assetId + '&duration=' + 'P' + date3 + 'D')
|
|
|
+ .then(() => {
|
|
|
+ this.$toast.success('上锁成功');
|
|
|
+ this.showLock = false;
|
|
|
+ this.showAction = false;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.getProduct(true);
|
|
|
+ }, 1000);
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.showLock = false;
|
|
|
+ this.showAction = false;
|
|
|
+ this.$toast.clear();
|
|
|
+ if (e && e.error) {
|
|
|
+ this.$toast(e.error);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
beforeRouteLeave(from, to, next) {
|