Browse Source

这个才是录用审批,前面的是岗位申请审批

ZGC4846 6 days ago
parent
commit
4b6d503c49

+ 97 - 0
src/api/bpm/components/offerApproval/index.js

@@ -0,0 +1,97 @@
+import request from '@/utils/request';
+
+function dateOnly(value) {
+  if (!value) return '';
+  return String(value).slice(0, 10);
+}
+
+/** 录用审批状态码 → 中文 */
+export const HIRING_STATUS_LABELS = {
+  DRAFT: '草稿',
+  PENDING_MY_APPROVAL: '待我审批',
+  APPROVING: '审批中',
+  APPROVED: '已通过',
+  REJECTED: '已拒绝'
+};
+
+export function normalizeHiringStatus(raw = {}) {
+  const code = String(
+    raw.approvalStatus || raw.status || raw.statusCode || ''
+  ).toUpperCase();
+  const labelMap = {
+    DRAFT: 'DRAFT',
+    草稿: 'DRAFT',
+    PENDING_MY_APPROVAL: 'PENDING_MY_APPROVAL',
+    WAITING: 'PENDING_MY_APPROVAL',
+    待我审批: 'PENDING_MY_APPROVAL',
+    APPROVING: 'APPROVING',
+    PENDING_APPROVAL: 'APPROVING',
+    审批中: 'APPROVING',
+    APPROVED: 'APPROVED',
+    PASSED: 'APPROVED',
+    已通过: 'APPROVED',
+    REJECTED: 'REJECTED',
+    已拒绝: 'REJECTED',
+    已驳回: 'REJECTED'
+  };
+  return labelMap[code] || labelMap[raw.approvalStatus] || code || 'DRAFT';
+}
+
+/** 录用审批详情字段适配 */
+export function adaptHiringApproval(raw = {}) {
+  const statusCode = normalizeHiringStatus(raw);
+  const hireDate =
+    dateOnly(raw.plannedHireDate || raw.hireDate || raw.onboardingDate) || '';
+  const experienceRaw = raw.experience ?? raw.workYears ?? '';
+  const attachments = Array.isArray(raw.attachments) ? raw.attachments : [];
+  return {
+    id: raw.id,
+    approvalNo: raw.approvalNo || (raw.id ? `HA${raw.id}` : ''),
+    candidateId: raw.candidateId,
+    candidateName: raw.candidateName || raw.name || '',
+    gender: raw.gender || raw.title || '',
+    education: raw.education || '',
+    phone: raw.phone || raw.mobile || raw.candidatePhone || '',
+    experience: experienceRaw,
+    positionId: raw.positionId,
+    positionName: raw.positionName || raw.appliedPosition || '',
+    departmentId: raw.departmentId || raw.recruitmentDeptId || raw.deptId,
+    departmentName:
+      raw.departmentName ||
+      raw.recruitmentDeptName ||
+      raw.deptName ||
+      raw.department ||
+      '',
+    proposedSalary: raw.proposedSalary || raw.salaryAdvice || raw.salary || '',
+    probation: raw.probation || raw.probationPeriod || '',
+    salaryStructure: raw.salaryStructure || '',
+    staffingType:
+      raw.staffingType ||
+      raw.positionNature ||
+      raw.positionType ||
+      '',
+    hireDate,
+    currentNode: raw.currentNode || raw.nodeName || raw.approvalNode || '-',
+    statusCode,
+    status: HIRING_STATUS_LABELS[statusCode] || raw.approvalStatus || '-',
+    remark: raw.remark || raw.approvalComment || '',
+    attachments,
+    attachmentNames: attachments
+      .map((item) => item.fileName || item.name)
+      .filter(Boolean),
+    applicationId: raw.applicationId,
+    offerId: raw.offerId,
+    offerSent: Boolean(raw.offerId || raw.offerSent)
+  };
+}
+
+/** 根据业务主键获取录用审批详情(审批页 businessId) */
+export async function getHiringApprovalById(id) {
+  const res = await request.get(`/recruit/hiring-approvals/${id}`);
+  if (res.data.code == 0) {
+    return adaptHiringApproval(res.data.data || {});
+  }
+  return Promise.reject(
+    new Error(res.data.message || '录用审批详情加载失败')
+  );
+}

+ 167 - 0
src/api/hr/hiringApproval.js

@@ -0,0 +1,167 @@
+import request from "@/utils/request";
+
+function unwrap(response) {
+  const result = response?.data || {};
+  if (Number(result.code) === 0) return result.data;
+  const error = new Error(result.message || "服务调用失败");
+  if (response?.__toastShown) error.__toastShown = true;
+  return Promise.reject(error);
+}
+
+function compact(object = {}) {
+  return Object.keys(object).reduce((result, key) => {
+    const value = object[key];
+    if (value !== "" && value !== null && value !== undefined) result[key] = value;
+    return result;
+  }, {});
+}
+
+function dateOnly(value) {
+  if (!value) return undefined;
+  return String(value).slice(0, 10);
+}
+
+/** 录用审批状态码 → 中文 */
+export const HIRING_STATUS_LABELS = {
+  DRAFT: "草稿",
+  PENDING_MY_APPROVAL: "待我审批",
+  APPROVING: "审批中",
+  APPROVED: "已通过",
+  REJECTED: "已拒绝",
+};
+
+/** 已通过:可发起 Offer */
+export const HIRING_APPROVED_STATUS = new Set(["APPROVED", "已通过"]);
+
+export function normalizeHiringStatus(raw = {}) {
+  const code = String(
+    raw.approvalStatus || raw.status || raw.statusCode || "",
+  ).toUpperCase();
+  const labelMap = {
+    DRAFT: "DRAFT",
+    草稿: "DRAFT",
+    PENDING_MY_APPROVAL: "PENDING_MY_APPROVAL",
+    WAITING: "PENDING_MY_APPROVAL",
+    待我审批: "PENDING_MY_APPROVAL",
+    APPROVING: "APPROVING",
+    PENDING_APPROVAL: "APPROVING",
+    审批中: "APPROVING",
+    APPROVED: "APPROVED",
+    PASSED: "APPROVED",
+    已通过: "APPROVED",
+    REJECTED: "REJECTED",
+    已拒绝: "REJECTED",
+    已驳回: "REJECTED",
+  };
+  return labelMap[code] || labelMap[raw.approvalStatus] || code || "DRAFT";
+}
+
+export function adaptHiringApproval(raw = {}) {
+  const statusCode = normalizeHiringStatus(raw);
+  const hireDate =
+    dateOnly(raw.plannedHireDate || raw.hireDate || raw.onboardingDate) || "";
+  const experienceRaw = raw.experience ?? raw.workYears ?? "";
+  return {
+    ...raw,
+    id: raw.id,
+    approvalNo: raw.approvalNo || (raw.id ? `HA${raw.id}` : ""),
+    candidateId: raw.candidateId,
+    candidateName: raw.candidateName || raw.name || "",
+    gender: raw.gender || raw.title || "",
+    education: raw.education || "",
+    phone: raw.phone || raw.mobile || raw.candidatePhone || "",
+    experience: experienceRaw,
+    positionId: raw.positionId,
+    positionName: raw.positionName || raw.appliedPosition || "",
+    departmentId: raw.departmentId || raw.recruitmentDeptId || raw.deptId,
+    departmentName:
+      raw.departmentName ||
+      raw.recruitmentDeptName ||
+      raw.deptName ||
+      raw.department ||
+      "",
+    proposedSalary: raw.proposedSalary || raw.salaryAdvice || raw.salary || "",
+    probation: raw.probation || raw.probationPeriod || "",
+    salaryStructure: raw.salaryStructure || "",
+    staffingType:
+      raw.staffingType ||
+      raw.positionNature ||
+      raw.positionType ||
+      raw.编制类型 ||
+      "",
+    hireDate,
+    currentNode: raw.currentNode || raw.nodeName || raw.approvalNode || "-",
+    statusCode,
+    status: HIRING_STATUS_LABELS[statusCode] || raw.approvalStatus || "-",
+    remark: raw.remark || raw.approvalComment || "",
+    attachments: Array.isArray(raw.attachments) ? raw.attachments : [],
+    applicationId: raw.applicationId,
+    offerId: raw.offerId,
+    offerSent: Boolean(raw.offerId || raw.offerSent),
+  };
+}
+
+export function serializeHiringApproval(form = {}) {
+  const experienceYears =
+    form.experience === null ||
+    form.experience === undefined ||
+    form.experience === ""
+      ? undefined
+      : Number(form.experience);
+  const experience =
+    experienceYears == null || Number.isNaN(experienceYears)
+      ? undefined
+      : `${experienceYears}年`;
+  return compact({
+    id: form.id || undefined,
+    candidateId: form.candidateId || undefined,
+    candidateName: form.candidateName || form.name,
+    gender: form.gender || undefined,
+    education: form.education || undefined,
+    phone: form.phone || undefined,
+    experience,
+    workYears: experienceYears,
+    positionId: form.positionId || undefined,
+    positionName: form.positionName || undefined,
+    departmentId: form.departmentId || undefined,
+    departmentName: form.departmentName || undefined,
+    proposedSalary: form.proposedSalary || undefined,
+    probation: form.probation || undefined,
+    plannedHireDate: dateOnly(form.hireDate),
+    salaryStructure: form.salaryStructure || undefined,
+    staffingType: form.staffingType || undefined,
+    remark: form.remark || undefined,
+    applicationId: form.applicationId || undefined,
+    attachmentFileIds: Array.isArray(form.attachmentFileIds)
+      ? form.attachmentFileIds
+      : undefined,
+  });
+}
+
+export const getHiringApprovalPage = async (params = {}) =>
+  unwrap(
+    await request.get("/recruit/hiring-approvals", { params: compact(params) }),
+  );
+
+export const getHiringApprovalById = async (id) =>
+  adaptHiringApproval(
+    await unwrap(await request.get(`/recruit/hiring-approvals/${id}`)),
+  );
+
+export const createHiringApproval = async (data) =>
+  unwrap(await request.post("/recruit/hiring-approvals", data));
+
+export const updateHiringApproval = async (id, data) =>
+  unwrap(await request.put(`/recruit/hiring-approvals/${id}`, data));
+
+export const submitHiringApproval = async (id, data = {}) =>
+  unwrap(await request.post(`/recruit/hiring-approvals/${id}/submit`, data));
+
+export const approveHiringApproval = async (id, data = {}) =>
+  unwrap(await request.post(`/recruit/hiring-approvals/${id}/approve`, data));
+
+export const rejectHiringApproval = async (id, data = {}) =>
+  unwrap(await request.post(`/recruit/hiring-approvals/${id}/reject`, data));
+
+export const deleteHiringApproval = async (id) =>
+  unwrap(await request.delete(`/recruit/hiring-approvals/${id}`));

+ 214 - 0
src/styles/views/offerApproval/index.scss

@@ -0,0 +1,214 @@
+.offer-approval-page {
+  --primary: #1768e5;
+  --ink: #203047;
+  min-height: 100%;
+  padding: 22px;
+  color: var(--ink);
+  background: radial-gradient(circle at 7% 0, rgba(32, 183, 216, 0.08), transparent 24%),
+    radial-gradient(circle at 94% 3%, rgba(23, 104, 229, 0.08), transparent 22%), #f3f6fb;
+}
+
+.detail-page-header {
+  margin-bottom: 16px;
+  padding: 16px 18px;
+  border: 1px solid #e0e7f1;
+  border-radius: 9px;
+  background: #fff;
+  box-shadow: 0 8px 24px rgba(40, 67, 106, 0.055);
+}
+
+.drawer-title {
+  min-width: 0;
+  display: flex;
+  align-items: center;
+  gap: 10px;
+}
+.drawer-title > span {
+  width: 38px;
+  height: 38px;
+  flex: 0 0 38px;
+  display: grid;
+  place-items: center;
+  border-radius: 8px;
+  color: #1768e5;
+  background: #eaf2ff;
+  font-size: 17px;
+}
+.drawer-title > div {
+  min-width: 0;
+  flex: 1;
+}
+.drawer-title h2 {
+  margin: 0;
+  color: #1f2e43;
+  font-size: 16px;
+}
+.drawer-title p {
+  margin: 4px 0 0;
+  color: #8b97a7;
+  font-size: 12px;
+}
+.drawer-title > em {
+  display: inline-flex;
+  align-items: center;
+  gap: 6px;
+  padding: 5px 9px;
+  border-radius: 12px;
+  font-size: 12px;
+  font-style: normal;
+  white-space: nowrap;
+}
+.drawer-title > em i {
+  width: 6px;
+  height: 6px;
+  border-radius: 50%;
+  background: currentColor;
+}
+.drawer-title > em.is-success {
+  color: #118969;
+  background: #e8f8f3;
+}
+.drawer-title > em.is-danger {
+  color: #d45454;
+  background: #ffecec;
+}
+.drawer-title > em.is-primary {
+  color: #1768e5;
+  background: #eaf2ff;
+}
+.drawer-title > em.is-warning {
+  color: #c46f11;
+  background: #fff4e5;
+}
+
+.detail-overview {
+  margin-bottom: 15px;
+  padding: 16px;
+  display: flex;
+  align-items: center;
+  gap: 12px;
+  border: 1px solid #dce8f6;
+  border-radius: 8px;
+  background: linear-gradient(110deg, #f6f9ff, #fbfdff);
+}
+.candidate-avatar {
+  width: 46px;
+  height: 46px;
+  flex: 0 0 46px;
+  display: grid;
+  place-items: center;
+  border-radius: 9px;
+  color: #1768e5;
+  background: #eaf2ff;
+  font-size: 20px;
+}
+.detail-overview h3 {
+  margin: 0;
+  color: #26364c;
+  font-size: 17px;
+}
+.detail-overview h3 small {
+  margin-left: 4px;
+  color: #8290a3;
+  font-size: 12px;
+  font-weight: 500;
+}
+.detail-overview p {
+  margin: 5px 0 0;
+  color: #8290a3;
+  font-size: 12px;
+}
+
+.detail-section {
+  padding: 18px;
+  border: 1px solid #e3eaf4;
+  border-radius: 12px;
+  background: #fff;
+  box-shadow: 0 6px 18px rgba(30, 64, 110, 0.05);
+}
+.detail-section + .detail-section {
+  margin-top: 16px;
+}
+.detail-heading {
+  margin-bottom: 16px;
+  display: flex;
+  align-items: center;
+  gap: 10px;
+}
+.detail-heading > span {
+  width: 34px;
+  height: 34px;
+  flex: 0 0 34px;
+  display: grid;
+  place-items: center;
+  border-radius: 9px;
+  color: #1677e8;
+  background: #eaf4ff;
+  font-size: 17px;
+}
+.detail-heading h3 {
+  margin: 0;
+  color: #20304a;
+  font-size: 15px;
+}
+.detail-heading p {
+  margin: 3px 0 0;
+  color: #8b98aa;
+  font-size: 12px;
+}
+.detail-grid {
+  display: grid;
+  grid-template-columns: repeat(2, minmax(0, 1fr));
+  gap: 16px 24px;
+}
+.detail-grid span,
+.detail-block > span {
+  display: block;
+  color: #8a96a7;
+  font-size: 12px;
+}
+.detail-grid strong {
+  margin-top: 5px;
+  display: block;
+  color: #3d4d64;
+  font-size: 13px;
+  font-weight: 600;
+}
+.detail-block {
+  margin-top: 14px;
+}
+.file-tags {
+  margin-top: 10px;
+  display: flex;
+  flex-wrap: wrap;
+  gap: 8px;
+}
+.file-tag {
+  padding: 5px 10px;
+  border: 1px solid #d7e3f4;
+  border-radius: 5px;
+  color: #4d7fc4;
+  background: #f7fbff;
+  font-size: 12px;
+  font-style: normal;
+}
+.detail-muted {
+  margin: 8px 0 0;
+  color: #9aa5b4;
+  font-size: 12px;
+}
+.review-opinion {
+  margin: 7px 0 0;
+  color: #59677b;
+  font-size: 13px;
+  line-height: 1.65;
+}
+
+@media (max-width: 760px) {
+  .offer-approval-page {
+    padding: 14px;
+  }
+  .detail-grid {
+    grid-template-columns: 1fr;
+  }
+}

+ 210 - 0
src/views/bpm/handleTask/components/offerApproval/offerApprovalDetail.vue

@@ -0,0 +1,210 @@
+<template>
+  <main class="offer-approval-page" v-loading="loading">
+    <header class="detail-page-header">
+      <div class="drawer-title">
+        <span><i class="el-icon-view"></i></span>
+        <div>
+          <h2>录用审批详情</h2>
+          <p>{{ form.approvalNo || '—' }}</p>
+        </div>
+        <em v-if="form.status" :class="statusTone(form.statusCode)"
+          ><i></i>{{ form.status }}</em
+        >
+      </div>
+    </header>
+
+    <section class="detail-overview">
+      <span class="candidate-avatar"
+        ><i class="el-icon-user-solid"></i
+      ></span>
+      <div>
+        <h3>
+          {{ form.candidateName || '—'
+          }}<small v-if="form.gender">({{ form.gender }})</small>
+        </h3>
+        <p>
+          {{ form.positionName || '未指定岗位' }} ·
+          {{ form.departmentName || '未指定部门' }} · 拟入职
+          {{ form.hireDate || '—' }}
+        </p>
+      </div>
+    </section>
+
+    <section class="detail-section">
+      <div class="detail-heading">
+        <span><i class="el-icon-user"></i></span>
+        <div>
+          <h3>候选人基本信息</h3>
+          <p>姓名、联系方式与应聘岗位</p>
+        </div>
+      </div>
+      <div class="detail-grid">
+        <div>
+          <span>姓名</span><strong>{{ form.candidateName || '-' }}</strong>
+        </div>
+        <div>
+          <span>称谓</span><strong>{{ form.gender || '-' }}</strong>
+        </div>
+        <div>
+          <span>应聘岗位</span><strong>{{ form.positionName || '-' }}</strong>
+        </div>
+        <div>
+          <span>联系电话</span><strong>{{ form.phone || '-' }}</strong>
+        </div>
+        <div>
+          <span>工作经验</span
+          ><strong>{{ experienceText(form.experience) }}</strong>
+        </div>
+        <div>
+          <span>入职部门</span
+          ><strong>{{ form.departmentName || '-' }}</strong>
+        </div>
+        <div>
+          <span>学历</span><strong>{{ form.education || '-' }}</strong>
+        </div>
+        <div>
+          <span>当前节点</span><strong>{{ form.currentNode || '-' }}</strong>
+        </div>
+      </div>
+    </section>
+
+    <section class="detail-section">
+      <div class="detail-heading">
+        <span><i class="el-icon-s-finance"></i></span>
+        <div>
+          <h3>录用信息</h3>
+          <p>薪资、试用期与岗位性质</p>
+        </div>
+      </div>
+      <div class="detail-grid">
+        <div>
+          <span>拟定薪资</span
+          ><strong>{{ form.proposedSalary || '-' }}</strong>
+        </div>
+        <div>
+          <span>试用期</span><strong>{{ form.probation || '-' }}</strong>
+        </div>
+        <div>
+          <span>拟入职日期</span><strong>{{ form.hireDate || '-' }}</strong>
+        </div>
+        <div>
+          <span>薪资结构</span
+          ><strong>{{ form.salaryStructure || '-' }}</strong>
+        </div>
+        <div>
+          <span>岗位性质</span><strong>{{ form.staffingType || '-' }}</strong>
+        </div>
+      </div>
+    </section>
+
+    <section class="detail-section">
+      <div class="detail-heading">
+        <span><i class="el-icon-paperclip"></i></span>
+        <div>
+          <h3>附件与说明</h3>
+          <p>简历、面试评价表、Offer 扫描件</p>
+        </div>
+      </div>
+      <div class="detail-block">
+        <span>附件</span>
+        <div
+          class="file-tags"
+          v-if="form.attachmentNames && form.attachmentNames.length"
+        >
+          <em
+            v-for="(name, index) in form.attachmentNames"
+            :key="name + index"
+            class="file-tag"
+            >{{ name }}</em
+          >
+        </div>
+        <p v-else class="detail-muted">暂无附件</p>
+      </div>
+      <div class="detail-block" v-if="form.remark">
+        <span>备注说明</span>
+        <p class="review-opinion">{{ form.remark }}</p>
+      </div>
+    </section>
+  </main>
+</template>
+
+<script>
+import { getHiringApprovalById } from '@/api/bpm/components/offerApproval';
+
+const emptyForm = () => ({
+  id: null,
+  approvalNo: '',
+  candidateName: '',
+  gender: '',
+  education: '',
+  phone: '',
+  experience: '',
+  positionName: '',
+  departmentName: '',
+  proposedSalary: '',
+  probation: '',
+  hireDate: '',
+  salaryStructure: '',
+  staffingType: '',
+  remark: '',
+  status: '',
+  statusCode: '',
+  currentNode: '',
+  attachmentNames: []
+});
+
+export default {
+  name: 'OfferApprovalDetail',
+  props: {
+    businessId: {
+      default: ''
+    }
+  },
+  data() {
+    return {
+      loading: false,
+      form: emptyForm()
+    };
+  },
+  watch: {
+    businessId: {
+      immediate: true,
+      handler(id) {
+        if (id) this.getInfo(id);
+      }
+    }
+  },
+  methods: {
+    async getInfo(id) {
+      if (!id) return;
+      this.loading = true;
+      try {
+        this.form = {
+          ...emptyForm(),
+          ...(await getHiringApprovalById(id))
+        };
+      } catch (error) {
+        this.form = emptyForm();
+        this.$message.error(error.message || '录用审批详情加载失败');
+      } finally {
+        this.loading = false;
+      }
+    },
+    experienceText(value) {
+      if (value === null || value === undefined || value === '') return '-';
+      if (typeof value === 'number' && Number.isFinite(value)) {
+        return `${value}年`;
+      }
+      return String(value);
+    },
+    statusTone(code) {
+      if (code === 'APPROVED') return 'is-success';
+      if (code === 'REJECTED') return 'is-danger';
+      if (code === 'PENDING_MY_APPROVAL') return 'is-primary';
+      return 'is-warning';
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped src="@/styles/views/offerApproval/index.scss"></style>

+ 134 - 0
src/views/bpm/handleTask/components/offerApproval/submit.vue

@@ -0,0 +1,134 @@
+<template>
+  <el-col :span="16" :offset="6">
+    <el-form label-width="100px" ref="formRef" :model="form">
+      <el-form-item
+        label="审批建议"
+        style="margin-bottom: 20px"
+        :rules="{
+          required: true,
+          message: '请选择',
+          trigger: 'change'
+        }"
+      >
+        <el-input
+          type="textarea"
+          v-model="form.reason"
+          placeholder="请输入审批建议"
+        />
+      </el-form-item>
+    </el-form>
+    <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        v-click-once
+        @click="handleAudit(1)"
+        >通过
+      </el-button>
+
+      <el-button
+        icon="el-icon-circle-close"
+        type="danger"
+        size="mini"
+        v-click-once
+        @click="handleAudit(0)"
+        >驳回
+      </el-button>
+      <el-dropdown
+        @command="(command) => handleCommand(command)"
+        style="margin-left: 30px"
+      >
+        <span class="el-dropdown-link">
+          更多<i class="el-icon-arrow-down el-icon--right"></i>
+        </span>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item command="cancel">作废</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+    </div>
+  </el-col>
+</template>
+
+<script>
+  import { approveTaskWithVariables, rejectTask,cancelTask } from '@/api/bpm/task';
+
+  export default {
+    name: '',
+
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
+      },
+      id: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
+      }
+    },
+    data() {
+      return {
+        visible: false,
+        form: {
+          reason: '同意'
+        },
+       
+      };
+    },
+    created() {},
+    methods: {
+      async handleAudit(status) {
+        await this._approveTaskWithVariables(status);
+      },
+      //更多
+      handleCommand(command) {
+        if (command === 'cancel') {
+          this.$confirm('是否确认作废?', {
+            type: 'warning',
+            cancelButtonText: '取消',
+            confirmButtonText: '确定'
+          })
+            .then(() => {
+              cancelTask({
+                id: this.id,
+                taskId: this.taskId,
+                reason: this.form.reason,
+                businessId: this.businessId
+              })
+                .then(() => {
+                  this.$emit('handleClose');
+                })
+                .catch(() => {
+                  this.$message.error('流程作废失败');
+                });
+            })
+            .catch(() => {});
+        }
+      },
+      async _approveTaskWithVariables(status) {
+        let variables = {
+          pass: !!status
+        };
+        let API = !!status ? approveTaskWithVariables : rejectTask;
+        API({
+          id: this.taskId,
+          reason: this.form.reason,
+          variables
+        }).then((res) => {
+          if (res.data.code != '-1') {
+            this.$emit('handleAudit', {
+              status,
+              title: status === 0 ? '驳回' : ''
+            });
+          }
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss"></style>