fix: 审批时剪切板复制移到API调用之前,修复user activation过期问题
This commit is contained in:
parent
b16353ea22
commit
ecb2f69223
@ -303,15 +303,7 @@ async function handleApprove(result) {
|
|||||||
approve_result: result,
|
approve_result: result,
|
||||||
approve_opinion: approveOpinion.value || (result === "pass" ? "审批通过" : "审批驳回"),
|
approve_opinion: approveOpinion.value || (result === "pass" ? "审批通过" : "审批驳回"),
|
||||||
};
|
};
|
||||||
|
// ????????? user activation ?????
|
||||||
if (orderInfo.value.orderStatus === "cancel_pending" || orderInfo.value.orderStatus === "cancel_fulfillment_pending") {
|
|
||||||
await cancelApproveOrder(orderInfo.value.orderId, payload);
|
|
||||||
toast.success(result === "pass" ? "取消审批已通过" : "已驳回取消申请");
|
|
||||||
} else {
|
|
||||||
await approveOrder(orderInfo.value.orderId, payload);
|
|
||||||
toast.success(result === "pass" ? "审批已通过" : "已驳回");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result === "pass" && orderInfo.value.orderStatus !== "cancel_pending" && orderInfo.value.orderStatus !== "cancel_fulfillment_pending") {
|
if (result === "pass" && orderInfo.value.orderStatus !== "cancel_pending" && orderInfo.value.orderStatus !== "cancel_fulfillment_pending") {
|
||||||
const text = buildCopyText();
|
const text = buildCopyText();
|
||||||
if (text) {
|
if (text) {
|
||||||
@ -328,13 +320,21 @@ async function handleApprove(result) {
|
|||||||
document.execCommand("copy");
|
document.execCommand("copy");
|
||||||
document.body.removeChild(ta);
|
document.body.removeChild(ta);
|
||||||
}
|
}
|
||||||
toast.success("采购信息已复制到剪切板");
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn("剪切板写入失败:", e);
|
console.warn("clipboard write failed:", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (orderInfo.value.orderStatus === "cancel_pending" || orderInfo.value.orderStatus === "cancel_fulfillment_pending") {
|
||||||
|
await cancelApproveOrder(orderInfo.value.orderId, payload);
|
||||||
|
toast.success(result === "pass" ? "取消审批已通过" : "已驳回取消申请");
|
||||||
|
} else {
|
||||||
|
await approveOrder(orderInfo.value.orderId, payload);
|
||||||
|
toast.success(result === "pass" ? "审批已通过" : "已驳回");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
await loadDetail();
|
await loadDetail();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toast.error(error.message || "审批操作失败");
|
toast.error(error.message || "审批操作失败");
|
||||||
|
|||||||
@ -2002,6 +2002,8 @@ async function handleApprovalPass() {
|
|||||||
} catch {
|
} catch {
|
||||||
const ta = document.createElement('textarea');
|
const ta = document.createElement('textarea');
|
||||||
ta.value = copyText;
|
ta.value = copyText;
|
||||||
|
ta.style.position = 'fixed';
|
||||||
|
ta.style.left = '-9999px';
|
||||||
document.body.appendChild(ta);
|
document.body.appendChild(ta);
|
||||||
ta.select();
|
ta.select();
|
||||||
document.execCommand('copy');
|
document.execCommand('copy');
|
||||||
@ -2130,6 +2132,8 @@ async function handleCopySupplierText() {
|
|||||||
// 降级方案
|
// 降级方案
|
||||||
const textarea = document.createElement('textarea');
|
const textarea = document.createElement('textarea');
|
||||||
textarea.value = supplierText.value;
|
textarea.value = supplierText.value;
|
||||||
|
textarea.style.position = 'fixed';
|
||||||
|
textarea.style.left = '-9999px';
|
||||||
document.body.appendChild(textarea);
|
document.body.appendChild(textarea);
|
||||||
textarea.select();
|
textarea.select();
|
||||||
document.execCommand('copy');
|
document.execCommand('copy');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user