Переглянути джерело

添加退款提现操作二次确认

zuypeng 1 рік тому
батько
коміт
2cc748dc80

+ 24 - 20
admin-web/src/views/admin/account/index.vue

@@ -120,7 +120,7 @@
               </div>
             </template>
             <template v-else-if="'action'===field.prop">
-             <el-text type="primary" @click="handleUserRefundApply(row)">申请退款</el-text>
+             <el-text class="cursor-pointer" type="primary" @click="handleUserRefundApply(row)">申请退款</el-text>
             </template>
             <template v-else>
               <div>{{ row[field.prop] }}</div>
@@ -291,26 +291,30 @@ const handleTableSortChange = (column, prop, order) => {
 
 
 const handleUserRefundApply = (row:any) => {
-  Msg.prompt(`请输入退款申请原因`, '退款申请',
-      {
-        draggable: true,
-        type: 'primary',
-      }
-  ).then((res: any) => {
-    let {value, action} = res;
-    if (action === 'confirm') {
-      if(!value){
-        Msg.message("请明确退款原因,否则无法发起本操作",'error')
-        return
+  Msg.confirm(`确认执行本操作吗?`,'退款申请').then(()=>{
+    Msg.prompt(`请输入退款申请原因`, '退款申请',
+        {
+          draggable: true,
+          type: 'primary',
+        }
+    ).then((res: any) => {
+      let {value, action} = res;
+      if (action === 'confirm') {
+        if(!value){
+          Msg.message("请明确退款原因,否则无法发起本操作",'error')
+          return
+        }
+        Msg.showLoading(`请等待`);
+        $body(`finance/applyRefund`,{userId:row.userId,reason:value}).then(()=>{
+          Msg.message("退款已发起")
+          Msg.hideLoading()
+          loadData(true)
+        }).catch(e=>{
+          Msg.hideLoading()
+        })
       }
-      Msg.showLoading(`请等待`);
-      $body(`finance/applyRefund`,{userId:row.userId,reason:value}).then(()=>{
-        Msg.message("退款已发起")
-        Msg.hideLoading()
-      }).catch(e=>{
-        Msg.hideLoading()
-      })
-    }
+    })
+
   })
 
 }

+ 8 - 16
admin-web/src/views/admin/finance/refund.vue

@@ -220,23 +220,15 @@ const loadData = (refresh: boolean = false) => {
 
 // 退款处理
 const handleRefundDealClick = (row: any) => {
-  Msg.showLoading("退款处理中")
-  $get(`finance/customWxRefund/${row.refundLogId}`).then(res => {
-    Msg.message('退款系统处理中,请稍后查看结果')
-    loadData(true)
-  }).catch(e => {
-    Msg.message(`退款处理错误,请联系管理员`, 'error')
-  })
-};
-// 删除点击
-const handleRowDelete = (row: any) => {
-  Msg.confirm(`此操作将永久删除:『${row.name}』,是否继续?`).then(() => {
-    $get(`/refundLog/delete/${row.id}`).then(() => {
-      Msg.message("删除成功", 'success')
-    }).catch(() => {
-      Msg.message("删除失败", 'error')
+  Msg.confirm(`确认执行本操作吗?`,'退款处理').then(()=>{
+    Msg.showLoading("退款处理中")
+    $get(`finance/customWxRefund/${row.refundLogId}`).then(res => {
+      Msg.message('退款系统处理中,请稍后查看结果')
+      loadData(true)
+    }).catch(e => {
+      Msg.message(`退款处理错误,请联系管理员`, 'error')
     })
-  });
+  })
 };
 
 //endregion

+ 21 - 25
admin-web/src/views/admin/finance/withdraw.vue

@@ -225,40 +225,36 @@ const loadData = (refresh: boolean = false) => {
 
 // 打开详情页弹窗
 const handleRowClick = (type: string, row: any) => {
-  withdrawnRecordDialogRef.value.open(type, row);
-};
-// 删除点击
-const handleRowDelete = (row: any) => {
-  Msg.confirm(`此操作将永久删除:『${row.name}』,是否继续?`).then(() => {
-    $get(`/withdrawnRecord/delete/${row.id}`).then(() => {
-      Msg.message("删除成功", 'success')
-    }).catch(() => {
-      Msg.message("删除失败", 'error')
-    })
-  });
+  // withdrawnRecordDialogRef.value.open(type, row);
 };
 
 
 const handleWithdrawAudit = (withdraw:any) => {
-  Msg.showLoading('操作中')
-  $body(`finance/reviewWithdrawn`,{id:withdraw.id,status:1}).then(res=>{
-    Msg.message(`提现审核通过`)
-    Msg.hideLoading();
-    loadData(true)
-  }).catch(()=>{
-    Msg.hideLoading();
+  Msg.confirm(`确认执行本操作吗?`,'提现审核').then(()=>{
+    Msg.showLoading('操作中')
+    $body(`finance/reviewWithdrawn`,{id:withdraw.id,status:1}).then(res=>{
+      Msg.message(`提现审核通过`)
+      Msg.hideLoading();
+      loadData(true)
+    }).catch(()=>{
+      Msg.hideLoading();
+    })
   })
+
 }
 
 const handleWithdrawConfirm = (withdraw:any) => {
-  Msg.showLoading('操作中')
-  $body(`finance/confirmWithdrawnPayment`,{id:withdraw.id,paymentStatus:1}).then(res=>{
-    Msg.message(`提现打款已确认`)
-    Msg.hideLoading();
-    loadData(true)
-  }).catch(()=>{
-    Msg.hideLoading();
+  Msg.confirm(`确认执行本操作吗?`,'打款确认').then(()=>{
+    Msg.showLoading('操作中')
+    $body(`finance/confirmWithdrawnPayment`,{id:withdraw.id,paymentStatus:1}).then(res=>{
+      Msg.message(`提现打款已确认`)
+      Msg.hideLoading();
+      loadData(true)
+    }).catch(()=>{
+      Msg.hideLoading();
+    })
   })
+
 }
 
 

+ 24 - 22
admin-web/src/views/admin/station/account/index.vue

@@ -104,7 +104,7 @@
               {{ u.fmt.fmtDateTime(row[field.prop]) }}
             </template>
             <template v-else-if="field.prop=='action'">
-             <el-text type="primary" @click="handleWithdrawApplyClick(row)">提现申请</el-text>
+             <el-text class="cursor-pointer" type="primary" @click="handleWithdrawApplyClick(row)">提现申请</el-text>
             </template>
             <template v-else>
               <div>{{ row[field.prop] }}</div>
@@ -230,29 +230,31 @@ const loadData = (refresh: boolean = false) => {
 
 // 打开详情页弹窗
 const handleWithdrawApplyClick = ( row: any) => {
-  // stationAccountDialogRef.value.open(type, row);
-  Msg.prompt(`请输入提现金额(单位分)`, '提现申请',
-      {
-        draggable: true,
-        type: 'primary',
+  Msg.confirm(`确认执行本操作吗?`,'提现申请').then(()=>{
+    Msg.prompt(`请输入提现金额(单位分)`, '提现申请',
+        {
+          draggable: true,
+          type: 'primary',
+        }
+    ).then((res: any) => {
+      let {value, action} = res;
+      if (action === 'confirm') {
+        if(!value|| !Number.isInteger(value)){
+          Msg.message("请输入有效的提现金额,否则无法发起本操作",'error')
+          return
+        }
+        Msg.showLoading(`请等待`);
+        $body(`finance/applyWithdrawn`,{stationId:row.stationId,amount:Number(value)}).then(()=>{
+          Msg.message("提现已发起")
+          Msg.hideLoading()
+          loadData(true)
+        }).catch(e=>{
+          Msg.hideLoading()
+        })
       }
-  ).then((res: any) => {
-    let {value, action} = res;
-    if (action === 'confirm') {
-      if(!value|| !Number.isInteger(value)){
-        Msg.message("请输入有效的提现金额,否则无法发起本操作",'error')
-        return
-      }
-      Msg.showLoading(`请等待`);
-      $body(`finance/applyWithdrawn`,{stationId:row.stationId,amount:Number(value)}).then(()=>{
-        Msg.message("提现已发起")
-        Msg.hideLoading()
-        loadData(true)
-      }).catch(e=>{
-        Msg.hideLoading()
-      })
-    }
+    })
   })
+
 };
 // 删除点击
 const handleRowDelete = (row: any) => {