|
|
@@ -374,6 +374,8 @@
|
|
|
@click="saveReceipt">保存</el-button>
|
|
|
<el-button v-if="!receiptApproving && editing.assets !== '已领用' && $hasPermission('main:hrOnboarding:submit')"
|
|
|
type="primary" :loading="receiptSubmitting" @click="submitReceipt">提交</el-button>
|
|
|
+ <el-button v-if="!receiptApproving && editing.assets !== '已领用' && $hasPermission('main:hrOnboarding:submit')"
|
|
|
+ :loading="receiptSkipping" @click="skipReceiptStep">无需领用,直接完成</el-button>
|
|
|
<el-button v-if="receiptApproving || editing.assets === '已领用'" type="primary" plain icon="el-icon-tickets"
|
|
|
@click="openReceiptApprovalRecord">审批记录</el-button>
|
|
|
</template>
|
|
|
@@ -431,6 +433,7 @@ import ItemReceiptPanel from "./ItemReceiptPanel.vue";
|
|
|
import BpmProcessDetailDialog from "@/views/bpm/processInstance/detailDialog.vue";
|
|
|
import {
|
|
|
RECEIPT_APPROVAL_BUSINESS_KEY,
|
|
|
+ skipItemReceipt,
|
|
|
} from "@/api/hr/onboardingItemReceipt";
|
|
|
|
|
|
const emptyFilters = () => ({
|
|
|
@@ -532,6 +535,7 @@ export default {
|
|
|
saving: false,
|
|
|
receiptSaving: false,
|
|
|
receiptSubmitting: false,
|
|
|
+ receiptSkipping: false,
|
|
|
/** 公共审批弹框来源:onboarding=入职审批,receipt=物品领用审批 */
|
|
|
approvalSource: null,
|
|
|
filters: emptyFilters(),
|
|
|
@@ -1763,6 +1767,42 @@ export default {
|
|
|
this.receiptSubmitting = false;
|
|
|
}
|
|
|
},
|
|
|
+ /** 无需领用物品:二次确认后跳过物品领用环节,直接完成入职流程 */
|
|
|
+ async skipReceiptStep() {
|
|
|
+ const employeeId = this.editing.userId || this.editing.id;
|
|
|
+ if (!employeeId) {
|
|
|
+ this.$message.warning("请先保存员工档案录入信息");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ await this.$confirm(
|
|
|
+ "确认本岗位无需领取任何物品,直接完成入职流程吗?该操作不可回退。",
|
|
|
+ "无需领用确认",
|
|
|
+ {
|
|
|
+ type: "warning",
|
|
|
+ confirmButtonText: "直接完成",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ },
|
|
|
+ );
|
|
|
+ } catch (e) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.receiptSkipping = true;
|
|
|
+ try {
|
|
|
+ await skipItemReceipt(employeeId);
|
|
|
+ // 同步本地进度:锁定领用面板(隐藏保存/提交),列表状态改为已完成
|
|
|
+ this.receiptApprovalStarted = true;
|
|
|
+ this.editing.onboardingProgress = "COMPLETED";
|
|
|
+ this.onReceiptCompleted();
|
|
|
+ this.currentStep = "complete";
|
|
|
+ this.$message.success("入职流程已完成");
|
|
|
+ } catch (error) {
|
|
|
+ // 后端拒绝(如存在未完成草稿或审批中的领用单)时透传错误消息
|
|
|
+ showRequestError(error, "无需领用完成入职失败");
|
|
|
+ } finally {
|
|
|
+ this.receiptSkipping = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
/** 物品领用提交:领用单已先保存/修改完成,这里弹出公共的提交审批弹框 */
|
|
|
openReceiptApproval(receipt) {
|
|
|
const id = receipt?.id;
|