|
|
@@ -906,30 +906,45 @@ 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')
|
|
|
+ this.$dialog
|
|
|
+ .confirm({
|
|
|
+ title: '上锁操作确认',
|
|
|
+ message:
|
|
|
+ '本人确认将藏品上锁<span style="color:#FF4F50">' +
|
|
|
+ date +
|
|
|
+ '个月</span>,上锁期间藏品不可进行任何操作,时间到后将自动解锁,此操作一旦确认将不可修改,请谨慎选择!',
|
|
|
+ allowHtml: true
|
|
|
+ })
|
|
|
.then(() => {
|
|
|
- this.$toast.success('上锁成功');
|
|
|
- this.showLock = false;
|
|
|
- this.showAction = false;
|
|
|
- setTimeout(() => {
|
|
|
- this.getProduct(true);
|
|
|
- }, 1000);
|
|
|
+ this.$toast.loading({
|
|
|
+ message: '加载中...',
|
|
|
+ forbidClick: true
|
|
|
+ });
|
|
|
+
|
|
|
+ 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);
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.showLock = false;
|
|
|
+ this.showAction = false;
|
|
|
+ this.$toast.clear();
|
|
|
+ if (e && e.error) {
|
|
|
+ this.$toast(e.error);
|
|
|
+ }
|
|
|
+ });
|
|
|
})
|
|
|
- .catch(e => {
|
|
|
- this.showLock = false;
|
|
|
- this.showAction = false;
|
|
|
- this.$toast.clear();
|
|
|
- if (e && e.error) {
|
|
|
- this.$toast(e.error);
|
|
|
- }
|
|
|
+ .catch(() => {
|
|
|
+ // on cancel
|
|
|
});
|
|
|
}
|
|
|
},
|