Commit b76dfb0c by cen

fix: 添加审批按钮加载状态

- 在定金和尾款审批按钮中添加加载状态,以提升用户体验
- 更新审批逻辑,确保在请求期间按钮状态正确显示
1 parent ee440928
......@@ -12,6 +12,7 @@
type="primary"
size="small"
v-preventReClick
:loading="approveLoading.deposit"
v-if="item.infoData && detailInfo.paymentType == 1 && activeStep == 0"
@click="approve(1)">
发起定金审批
......@@ -21,6 +22,7 @@
type="primary"
size="small"
v-preventReClick
:loading="approveLoading.final"
v-if="item.infoData && detailInfo.paymentType == 1 && activeStep == 2"
@click="approve(2)">
发起尾款审批
......@@ -30,6 +32,7 @@
type="primary"
size="small"
v-preventReClick
:loading="approveLoading.final"
v-if="item.infoData && detailInfo.paymentType == 2 && activeStep == 2"
@click="approve(2)">
发起全款审批
......@@ -401,6 +404,10 @@ export default {
videoStr: "?x-oss-process=video/snapshot,t_7000,f_jpg,w_800,h_600,m_fast",
btnLoding: false,
loading: false,
approveLoading: {
deposit: false, // 定金审批loading
final: false // 尾款/全款审批loading
},
id: this.$route.query.id,
rules: {
description: [
......@@ -1065,21 +1072,35 @@ export default {
if (res.data.code == 0 && res.data.data == 2) {
const params = { contractNo: this.detailInfo.contractNo, evalOrderNo: this.detailInfo.evalOrderNo }
if (type == 1) {
const res1 = await webPayDepositApplication(params)
console.log(res1, '78787')
if (res1.data.code == 0) {
this.handleCancel()
this.$message.success("操作成功")
} else {
this.$message.error(res1.data.msg)
this.approveLoading.deposit = true
try {
const res1 = await webPayDepositApplication(params)
console.log(res1, '78787')
if (res1.data.code == 0) {
this.handleCancel()
this.$message.success("操作成功")
} else {
this.$message.error(res1.data.msg)
}
} catch (error) {
this.$message.error("操作失败")
} finally {
this.approveLoading.deposit = false
}
} else if (type == 2) {
const res2 = await webPayFinalApplication(params)
if (res2.data.code == 0) {
this.handleCancel()
this.$message.success("操作成功")
} else {
this.$message.error(res2.data.msg)
this.approveLoading.final = true
try {
const res2 = await webPayFinalApplication(params)
if (res2.data.code == 0) {
this.handleCancel()
this.$message.success("操作成功")
} else {
this.$message.error(res2.data.msg)
}
} catch (error) {
this.$message.error("操作失败")
} finally {
this.approveLoading.final = false
}
}
} else {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!