feat: 审批通过按钮增加防重复点击,避免重复提示
This commit is contained in:
@@ -270,6 +270,7 @@ export default {
|
|||||||
rows: [],
|
rows: [],
|
||||||
selection: [],
|
selection: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
|
approveLoading: false,
|
||||||
batchSyncing: false,
|
batchSyncing: false,
|
||||||
page: { current: 1, size: 10, total: 0 },
|
page: { current: 1, size: 10, total: 0 },
|
||||||
mkEnabled: false,
|
mkEnabled: false,
|
||||||
@@ -408,13 +409,17 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
async handleApprove(row) {
|
async handleApprove(row) {
|
||||||
await this.$confirm('确认审批通过该开票申请?', '提示', { type: 'warning' });
|
// 防止重复点击:请求进行中忽略后续点击,避免重复审批和重复提示
|
||||||
const loading = this.$loading({
|
if (this.approveLoading) return;
|
||||||
lock: true,
|
this.approveLoading = true;
|
||||||
text: '审批处理中,请稍候…',
|
let loading = null;
|
||||||
background: 'rgba(255, 255, 255, 0.6)',
|
|
||||||
});
|
|
||||||
try {
|
try {
|
||||||
|
await this.$confirm('确认审批通过该开票申请?', '提示', { type: 'warning' });
|
||||||
|
loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: '审批处理中,请稍候…',
|
||||||
|
background: 'rgba(255, 255, 255, 0.6)',
|
||||||
|
});
|
||||||
const res = await api.approve({ id: row.id });
|
const res = await api.approve({ id: row.id });
|
||||||
// data=false 表示审批已通过但自动同步金蝶失败,msg 带具体原因
|
// data=false 表示审批已通过但自动同步金蝶失败,msg 带具体原因
|
||||||
if (res.data.data === false) {
|
if (res.data.data === false) {
|
||||||
@@ -424,7 +429,8 @@ export default {
|
|||||||
}
|
}
|
||||||
this.loadTable();
|
this.loadTable();
|
||||||
} finally {
|
} finally {
|
||||||
loading.close();
|
loading?.close();
|
||||||
|
this.approveLoading = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async handleReturn(row) {
|
async handleReturn(row) {
|
||||||
|
|||||||
@@ -255,6 +255,7 @@ export default {
|
|||||||
rows: [],
|
rows: [],
|
||||||
selection: [],
|
selection: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
|
approveLoading: false,
|
||||||
pushLoading: false,
|
pushLoading: false,
|
||||||
page: { current: 1, size: 10, total: 0 },
|
page: { current: 1, size: 10, total: 0 },
|
||||||
mkEnabled: false,
|
mkEnabled: false,
|
||||||
@@ -365,13 +366,17 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
async handleApprove(row) {
|
async handleApprove(row) {
|
||||||
await this.$confirm('确认审批通过该收票登记?', '提示', { type: 'warning' });
|
// 防止重复点击:请求进行中忽略后续点击,避免重复审批和重复提示
|
||||||
const loading = this.$loading({
|
if (this.approveLoading) return;
|
||||||
lock: true,
|
this.approveLoading = true;
|
||||||
text: '审批处理中,请稍候…',
|
let loading = null;
|
||||||
background: 'rgba(255, 255, 255, 0.6)',
|
|
||||||
});
|
|
||||||
try {
|
try {
|
||||||
|
await this.$confirm('确认审批通过该收票登记?', '提示', { type: 'warning' });
|
||||||
|
loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: '审批处理中,请稍候…',
|
||||||
|
background: 'rgba(255, 255, 255, 0.6)',
|
||||||
|
});
|
||||||
const res = await api.approve({ id: row.id });
|
const res = await api.approve({ id: row.id });
|
||||||
// data=false 表示审批已通过但自动同步金蝶失败,msg 带具体原因
|
// data=false 表示审批已通过但自动同步金蝶失败,msg 带具体原因
|
||||||
if (res.data.data === false) {
|
if (res.data.data === false) {
|
||||||
@@ -381,7 +386,8 @@ export default {
|
|||||||
}
|
}
|
||||||
this.loadTable();
|
this.loadTable();
|
||||||
} finally {
|
} finally {
|
||||||
loading.close();
|
loading?.close();
|
||||||
|
this.approveLoading = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async handleReturn(row) {
|
async handleReturn(row) {
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ export default {
|
|||||||
rows: [],
|
rows: [],
|
||||||
selection: [],
|
selection: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
|
approveLoading: false,
|
||||||
syncLoading: false,
|
syncLoading: false,
|
||||||
page: { currentPage: 1, pageSize: 10, pageSizes: [10, 20, 50, 100], total: 0 },
|
page: { currentPage: 1, pageSize: 10, pageSizes: [10, 20, 50, 100], total: 0 },
|
||||||
editor: { visible: false, id: null, readonly: false },
|
editor: { visible: false, id: null, readonly: false },
|
||||||
@@ -371,17 +372,21 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
async handleApprove(row) {
|
async handleApprove(row) {
|
||||||
await this.$confirm(
|
// 防止重复点击:请求进行中忽略后续点击,避免重复审批和重复提示
|
||||||
`审核通过后${this.billLabel}生效,金额只能通过结算调整单处理,确认通过?`,
|
if (this.approveLoading) return;
|
||||||
'提示',
|
this.approveLoading = true;
|
||||||
{ type: 'warning' }
|
let loading = null;
|
||||||
);
|
|
||||||
const loading = this.$loading({
|
|
||||||
lock: true,
|
|
||||||
text: '审批处理中,请稍候…',
|
|
||||||
background: 'rgba(255, 255, 255, 0.6)',
|
|
||||||
});
|
|
||||||
try {
|
try {
|
||||||
|
await this.$confirm(
|
||||||
|
`审核通过后${this.billLabel}生效,金额只能通过结算调整单处理,确认通过?`,
|
||||||
|
'提示',
|
||||||
|
{ type: 'warning' }
|
||||||
|
);
|
||||||
|
loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: '审批处理中,请稍候…',
|
||||||
|
background: 'rgba(255, 255, 255, 0.6)',
|
||||||
|
});
|
||||||
const res = await api.approve({ id: row.id });
|
const res = await api.approve({ id: row.id });
|
||||||
// data=false 表示审批已通过但自动同步金蝶失败,msg 带具体原因
|
// data=false 表示审批已通过但自动同步金蝶失败,msg 带具体原因
|
||||||
if (res.data.data === false) {
|
if (res.data.data === false) {
|
||||||
@@ -391,7 +396,8 @@ export default {
|
|||||||
}
|
}
|
||||||
this.onLoad(this.page);
|
this.onLoad(this.page);
|
||||||
} finally {
|
} finally {
|
||||||
loading.close();
|
loading?.close();
|
||||||
|
this.approveLoading = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async handleReturn(row) {
|
async handleReturn(row) {
|
||||||
|
|||||||
@@ -334,6 +334,7 @@ export default {
|
|||||||
ArrowDown,
|
ArrowDown,
|
||||||
ArrowUp,
|
ArrowUp,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
approveLoading: false,
|
||||||
query: emptyQuery(),
|
query: emptyQuery(),
|
||||||
searchFields: preSettlementSearchFields,
|
searchFields: preSettlementSearchFields,
|
||||||
searchExpanded: false,
|
searchExpanded: false,
|
||||||
@@ -691,18 +692,23 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
async handleApprove(row) {
|
async handleApprove(row) {
|
||||||
await this.$confirm('确认审批通过该预付结算单?', '提示', { type: 'warning' });
|
// 防止重复点击:请求进行中忽略后续点击,避免重复审批和重复提示
|
||||||
const loading = this.$loading({
|
if (this.approveLoading) return;
|
||||||
lock: true,
|
this.approveLoading = true;
|
||||||
text: '审批处理中,请稍候…',
|
let loading = null;
|
||||||
background: 'rgba(255, 255, 255, 0.6)',
|
|
||||||
});
|
|
||||||
try {
|
try {
|
||||||
|
await this.$confirm('确认审批通过该预付结算单?', '提示', { type: 'warning' });
|
||||||
|
loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: '审批处理中,请稍候…',
|
||||||
|
background: 'rgba(255, 255, 255, 0.6)',
|
||||||
|
});
|
||||||
await approve({ id: row.id });
|
await approve({ id: row.id });
|
||||||
this.$message.success('审批通过');
|
this.$message.success('审批通过');
|
||||||
this.loadTable();
|
this.loadTable();
|
||||||
} finally {
|
} finally {
|
||||||
loading.close();
|
loading?.close();
|
||||||
|
this.approveLoading = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async handleReturn(row) {
|
async handleReturn(row) {
|
||||||
|
|||||||
Reference in New Issue
Block a user