diff --git a/src/views/system/order/index.vue b/src/views/system/order/index.vue index cf96d20..456afea 100644 --- a/src/views/system/order/index.vue +++ b/src/views/system/order/index.vue @@ -702,12 +702,25 @@ export default { }, returnVehicle(row){ // console.log('returnVehicle--------------'+JSON.stringify(row)) - this.$modal.confirm('是否确认辅助还车MAC为:' + row.sn + '"的设备吗?').then(function() { - return returnVehicle({orderNo:row.orderNo,returnType:"2"}); - }).then(() => { - this.getList(); - this.$modal.msgSuccess("操作成功"); + this.$modal.confirm('是否确认辅助还车MAC为:' + row.sn + '的设备吗?').then(() => { + // 显示加载中状态 + const loading = this.$loading({ + lock: true, + text: '加载中...', + spinner: 'custom-loading-spinner', + background: 'rgba(0, 0, 0, 0.7)' + }); + + return returnVehicle({ orderNo: row.orderNo, returnType: "2" }) + .then(() => { + this.getList(); + this.$modal.msgSuccess("操作成功"); + }).finally(() => { + // 关闭加载中状态 + loading.close(); + }); }).catch(() => { + // 如果用户取消了确认框 }); }, formatDistance(row){ @@ -979,4 +992,24 @@ export default { padding: 10px !important; } + .custom-loading-spinner { + border: 6px solid rgba(0, 0, 0, 0.1); + border-left-color: #409EFF; + border-radius: 50%; + display: inline-block; + width: 40px; + height: 40px; + animation: spin 1s linear infinite; + } + + @keyframes spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } + } + +