|
@@ -241,32 +241,34 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="drawer-footer">
|
|
<div class="drawer-footer">
|
|
|
- <span
|
|
|
|
|
- ><i class="el-icon-lock"></i>
|
|
|
|
|
- 保存走新建 Offer;提交审批会先保存再发起流程</span
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <span><i class="el-icon-lock"></i> 保存走新建 / 更新 Offer</span>
|
|
|
<div>
|
|
<div>
|
|
|
- <el-button :loading="saving" :disabled="sending" @click="save"
|
|
|
|
|
|
|
+ <el-button @click="visibleProxy = false">取消</el-button>
|
|
|
|
|
+ <el-button type="primary" :loading="saving" @click="save"
|
|
|
>保存</el-button
|
|
>保存</el-button
|
|
|
>
|
|
>
|
|
|
|
|
+ <!-- 暂时不发送 / 不提交审批
|
|
|
<el-button
|
|
<el-button
|
|
|
type="primary"
|
|
type="primary"
|
|
|
:loading="sending"
|
|
:loading="sending"
|
|
|
:disabled="saving"
|
|
:disabled="saving"
|
|
|
@click="submit"
|
|
@click="submit"
|
|
|
>
|
|
>
|
|
|
- {{ form.online === 1 ? "提交审批" : "确认线下通知" }}
|
|
|
|
|
|
|
+ {{ form.online === 1 ? "发送通知" : "确认线下通知" }}
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
+ -->
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</el-drawer>
|
|
</el-drawer>
|
|
|
|
|
|
|
|
|
|
+ <!-- 暂时不走 Offer 审批流程
|
|
|
<processSubmitDialog
|
|
<processSubmitDialog
|
|
|
:processSubmitDialogFlag.sync="processSubmitDialogFlag"
|
|
:processSubmitDialogFlag.sync="processSubmitDialogFlag"
|
|
|
v-if="processSubmitDialogFlag"
|
|
v-if="processSubmitDialogFlag"
|
|
|
ref="processSubmitDialogRef"
|
|
ref="processSubmitDialogRef"
|
|
|
@reload="onProcessSubmitReload"
|
|
@reload="onProcessSubmitReload"
|
|
|
/>
|
|
/>
|
|
|
|
|
+ -->
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -275,19 +277,20 @@ import {
|
|
|
adaptHiringApproval,
|
|
adaptHiringApproval,
|
|
|
getHiringApprovalById,
|
|
getHiringApprovalById,
|
|
|
} from "@/api/hr/hiringApproval";
|
|
} from "@/api/hr/hiringApproval";
|
|
|
-import processSubmitDialog from "@/BIZComponents/processSubmitDialog/processSubmitDialog.vue";
|
|
|
|
|
|
|
+// import processSubmitDialog from "@/BIZComponents/processSubmitDialog/processSubmitDialog.vue";
|
|
|
import {
|
|
import {
|
|
|
bindOfferAttachment,
|
|
bindOfferAttachment,
|
|
|
- confirmOfflineOffer,
|
|
|
|
|
|
|
+ // confirmOfflineOffer,
|
|
|
createOffer,
|
|
createOffer,
|
|
|
getCandidateById,
|
|
getCandidateById,
|
|
|
getHiringApprovalPage,
|
|
getHiringApprovalPage,
|
|
|
getOfferById,
|
|
getOfferById,
|
|
|
- OFFER_NOTIFY_BUSINESS_KEY,
|
|
|
|
|
|
|
+ // OFFER_NOTIFY_BUSINESS_KEY,
|
|
|
|
|
+ // sendOffer,
|
|
|
updateOffer,
|
|
updateOffer,
|
|
|
} from "@/api/hr/offer";
|
|
} from "@/api/hr/offer";
|
|
|
import { showRequestError } from "@/utils/message";
|
|
import { showRequestError } from "@/utils/message";
|
|
|
-import { getCurrentUser } from "@/utils/token-util";
|
|
|
|
|
|
|
+// import { getCurrentUser } from "@/utils/token-util";
|
|
|
import {
|
|
import {
|
|
|
notifyTypes,
|
|
notifyTypes,
|
|
|
presetRemark,
|
|
presetRemark,
|
|
@@ -336,7 +339,7 @@ const emptyForm = () => ({
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: "OfferLaunchDialog",
|
|
name: "OfferLaunchDialog",
|
|
|
- components: { processSubmitDialog },
|
|
|
|
|
|
|
+ // components: { processSubmitDialog },
|
|
|
props: {
|
|
props: {
|
|
|
visible: { type: Boolean, default: false },
|
|
visible: { type: Boolean, default: false },
|
|
|
/** 从录用审批列表带入,锁定审批单 */
|
|
/** 从录用审批列表带入,锁定审批单 */
|
|
@@ -350,7 +353,7 @@ export default {
|
|
|
saving: false,
|
|
saving: false,
|
|
|
sending: false,
|
|
sending: false,
|
|
|
approvalLoading: false,
|
|
approvalLoading: false,
|
|
|
- processSubmitDialogFlag: false,
|
|
|
|
|
|
|
+ // processSubmitDialogFlag: false, // 暂时不走审批
|
|
|
approvalOptions: [],
|
|
approvalOptions: [],
|
|
|
notifyTypes,
|
|
notifyTypes,
|
|
|
signingMethods,
|
|
signingMethods,
|
|
@@ -675,7 +678,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
async save() {
|
|
async save() {
|
|
|
const valid = await this.$refs.form.validate().catch(() => false);
|
|
const valid = await this.$refs.form.validate().catch(() => false);
|
|
|
- if (!valid || this.saving || this.sending) return;
|
|
|
|
|
|
|
+ if (!valid || this.saving) return;
|
|
|
if (!this.hasOfferCandidate()) {
|
|
if (!this.hasOfferCandidate()) {
|
|
|
this.$message.warning("录用审批未带出候选人姓名,请重新选择审批单");
|
|
this.$message.warning("录用审批未带出候选人姓名,请重新选择审批单");
|
|
|
return;
|
|
return;
|
|
@@ -684,6 +687,7 @@ export default {
|
|
|
try {
|
|
try {
|
|
|
await this.persistOffer();
|
|
await this.persistOffer();
|
|
|
this.$message.success("Offer 已保存");
|
|
this.$message.success("Offer 已保存");
|
|
|
|
|
+ this.visibleProxy = false;
|
|
|
this.$emit("success", { action: "save", id: this.form.id });
|
|
this.$emit("success", { action: "save", id: this.form.id });
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
showRequestError(error, "保存 Offer 失败");
|
|
showRequestError(error, "保存 Offer 失败");
|
|
@@ -691,71 +695,71 @@ export default {
|
|
|
this.saving = false;
|
|
this.saving = false;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- launchOfferApproval(row) {
|
|
|
|
|
- if (!row?.id) {
|
|
|
|
|
- this.$message.warning("请先保存 Offer 后再提交审批");
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- this.processSubmitDialogFlag = true;
|
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
|
- const currentUser = getCurrentUser() || {};
|
|
|
|
|
- const params = {
|
|
|
|
|
- businessId: row.id,
|
|
|
|
|
- businessKey: OFFER_NOTIFY_BUSINESS_KEY,
|
|
|
|
|
- formCreateUserId:
|
|
|
|
|
- row.createUserId || currentUser.id || currentUser.userId || "",
|
|
|
|
|
- variables: {
|
|
|
|
|
- businessCode: row.offerNo || "",
|
|
|
|
|
- businessName: row.name || row.candidateName || "",
|
|
|
|
|
- businessType: "Offer通知",
|
|
|
|
|
- positionName: row.positionName || "",
|
|
|
|
|
- approvalId: row.approvalId || "",
|
|
|
|
|
- },
|
|
|
|
|
- };
|
|
|
|
|
- this.$refs.processSubmitDialogRef?.init(params);
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- onProcessSubmitReload() {
|
|
|
|
|
- this.visibleProxy = false;
|
|
|
|
|
- this.$emit("success", { action: "submit", id: this.form.id });
|
|
|
|
|
- },
|
|
|
|
|
- async submit() {
|
|
|
|
|
- const valid = await this.$refs.form.validate().catch(() => false);
|
|
|
|
|
- if (!valid || this.sending || this.saving) return;
|
|
|
|
|
- if (!this.hasOfferCandidate()) {
|
|
|
|
|
- this.$message.warning("录用审批未带出候选人姓名,请重新选择审批单");
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- this.sending = true;
|
|
|
|
|
- try {
|
|
|
|
|
- const offerId = await this.persistOffer();
|
|
|
|
|
- if (Number(this.form.online) === 1) {
|
|
|
|
|
- this.launchOfferApproval({
|
|
|
|
|
- id: offerId,
|
|
|
|
|
- offerNo: this.form.offerNo,
|
|
|
|
|
- name: this.form.name,
|
|
|
|
|
- candidateName: this.form.name,
|
|
|
|
|
- positionName: this.form.positionName,
|
|
|
|
|
- approvalId: this.form.approvalId,
|
|
|
|
|
- });
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- const detail = await getOfferById(offerId);
|
|
|
|
|
- const code = String(detail.statusCode || "").toUpperCase();
|
|
|
|
|
- if (code !== "OFFLINE_CONFIRMED") {
|
|
|
|
|
- await confirmOfflineOffer(offerId);
|
|
|
|
|
- this.$message.success("已确认线下 Offer 通知");
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.success("线下 Offer 已确认");
|
|
|
|
|
- }
|
|
|
|
|
- this.visibleProxy = false;
|
|
|
|
|
- this.$emit("success", { action: "offline", id: offerId });
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- showRequestError(error, "Offer 通知失败");
|
|
|
|
|
- } finally {
|
|
|
|
|
- this.sending = false;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // 暂时不走 Offer 审批 / 发送流程,保留便于后续恢复
|
|
|
|
|
+ // launchOfferApproval(row) {
|
|
|
|
|
+ // if (!row?.id) {
|
|
|
|
|
+ // this.$message.warning("请先保存 Offer 后再提交审批");
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // this.processSubmitDialogFlag = true;
|
|
|
|
|
+ // this.$nextTick(() => {
|
|
|
|
|
+ // const currentUser = getCurrentUser() || {};
|
|
|
|
|
+ // const params = {
|
|
|
|
|
+ // businessId: row.id,
|
|
|
|
|
+ // businessKey: OFFER_NOTIFY_BUSINESS_KEY,
|
|
|
|
|
+ // formCreateUserId:
|
|
|
|
|
+ // row.createUserId || currentUser.id || currentUser.userId || "",
|
|
|
|
|
+ // variables: {
|
|
|
|
|
+ // businessCode: row.offerNo || "",
|
|
|
|
|
+ // businessName: row.name || row.candidateName || "",
|
|
|
|
|
+ // businessType: "Offer通知",
|
|
|
|
|
+ // positionName: row.positionName || "",
|
|
|
|
|
+ // approvalId: row.approvalId || "",
|
|
|
|
|
+ // },
|
|
|
|
|
+ // };
|
|
|
|
|
+ // this.$refs.processSubmitDialogRef?.init(params);
|
|
|
|
|
+ // });
|
|
|
|
|
+ // },
|
|
|
|
|
+ // onProcessSubmitReload() {
|
|
|
|
|
+ // this.visibleProxy = false;
|
|
|
|
|
+ // this.$emit("success", { action: "submit", id: this.form.id });
|
|
|
|
|
+ // },
|
|
|
|
|
+ // async submit() {
|
|
|
|
|
+ // const valid = await this.$refs.form.validate().catch(() => false);
|
|
|
|
|
+ // if (!valid || this.sending || this.saving) return;
|
|
|
|
|
+ // if (!this.hasOfferCandidate()) {
|
|
|
|
|
+ // this.$message.warning("录用审批未带出候选人姓名,请重新选择审批单");
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // this.sending = true;
|
|
|
|
|
+ // try {
|
|
|
|
|
+ // const offerId = await this.persistOffer();
|
|
|
|
|
+ // if (Number(this.form.online) === 1) {
|
|
|
|
|
+ // // this.launchOfferApproval({ ... });
|
|
|
|
|
+ // await sendOffer(offerId);
|
|
|
|
|
+ // this.$message.success(
|
|
|
|
|
+ // `已发起 Offer 发送至 ${this.form.email || "候选人邮箱"}`,
|
|
|
|
|
+ // );
|
|
|
|
|
+ // this.visibleProxy = false;
|
|
|
|
|
+ // this.$emit("success", { action: "send", id: offerId });
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // const detail = await getOfferById(offerId);
|
|
|
|
|
+ // const code = String(detail.statusCode || "").toUpperCase();
|
|
|
|
|
+ // if (code !== "OFFLINE_CONFIRMED") {
|
|
|
|
|
+ // await confirmOfflineOffer(offerId);
|
|
|
|
|
+ // this.$message.success("已确认线下 Offer 通知");
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // this.$message.success("线下 Offer 已确认");
|
|
|
|
|
+ // }
|
|
|
|
|
+ // this.visibleProxy = false;
|
|
|
|
|
+ // this.$emit("success", { action: "offline", id: offerId });
|
|
|
|
|
+ // } catch (error) {
|
|
|
|
|
+ // showRequestError(error, "Offer 通知失败");
|
|
|
|
|
+ // } finally {
|
|
|
|
|
+ // this.sending = false;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // },
|
|
|
handleBeforeClose(done) {
|
|
handleBeforeClose(done) {
|
|
|
this.visibleProxy = false;
|
|
this.visibleProxy = false;
|
|
|
if (typeof done === "function") done();
|
|
if (typeof done === "function") done();
|