zhengyiming
6 天以前 9373e192d80ba82036929de1904f7fadb515bfd5
src/views/FlexJobManage/FlexJobManage.vue
@@ -138,7 +138,7 @@
import { ModelValueType } from 'element-plus';
defineOptions({
  name: 'EnterpriseManageList',
  name: 'FlexJobManageList',
});
const operationBtns = defineOperationBtns([
@@ -162,17 +162,33 @@
  },
  {
    data: {
      enCode: 'signBtn',
      name: '签约',
      enCode: 'enterpriseSignBtn',
      name: '企业签约',
    },
    emits: {
      onClick: (role) => handleSign(role),
      onClick: (role) => handleEnterpriseSign(role),
    },
    extraProps: {
      hide: (row: API.GetEnterpriseEmployeesQueryResultItem) =>
        !(
          row.userSignContractStatus === EnumTaskUserSignContractStatus.Pass &&
          row.enterpriseSignContractStatus === EnumTaskUserSignContractStatus.Wait
        ),
    },
  },
  {
    data: {
      enCode: 'inviteSignBtn',
      name: '邀请签约',
    },
    emits: {
      onClick: (role) => handleInviteSign(role),
    },
    extraProps: {
      hide: (row: API.GetEnterpriseEmployeesQueryResultItem) =>
        !(
          row.userSignContractStatus !== EnumTaskUserSignContractStatus.Pass &&
          row.hireStatus === EnumTaskUserHireStatus.Pass
        ),
    },
  },
@@ -192,16 +208,16 @@
        ),
    },
  },
  {
    data: {
      enCode: 'delBtn',
      name: '删除',
    },
    props: { type: 'danger' },
    emits: {
      onClick: (role) => handleDelete(role),
    },
  },
  // {
  //   data: {
  //     enCode: 'delBtn',
  //     name: '删除',
  //   },
  //   props: { type: 'danger' },
  //   emits: {
  //     onClick: (role) => handleDelete(role),
  //   },
  // },
]);
const router = useRouter();
@@ -419,17 +435,18 @@
async function handleSendShotMessage() {
  try {
    Message.warnMessage('功能开发中');
    // const selectionRows = getSelectionRows();
    // if (selectionRows) {
    //   if (selectionRows.some((x) => x.status === 10)) {
    //     await Message.tipMessage('勾选人员中包含已签约完成人员,确认要继续发送短信通知吗?');
    //   }
    //   handleShotMessageAdd({
    //     ids: selectionRows.map((x) => x.id),
    //     name: '人员签约通道短信',
    //   });
    // }
    const selectionRows = getSelectionRows();
    if (selectionRows) {
      if (
        selectionRows.some((x) => x.userSignContractStatus === EnumTaskUserSignContractStatus.Pass)
      ) {
        await Message.tipMessage('勾选人员中包含已签约完成人员,确认要继续发送短信通知吗?');
      }
      handleShotMessageAdd({
        ids: selectionRows.map((x) => x.id),
        name: '人员签约通道短信',
      });
    }
  } catch (error) {}
}
@@ -445,50 +462,88 @@
const {
  dialogProps: dialogSignProps,
  handleAdd: handleSignAdd,
  handleEdit: handleSignEdit,
  editForm: signEditForm,
} = useFormDialog({
  onConfirm: signContract,
  defaultFormParams: {
    url: [] as UploadUserFile[],
    ids: [] as string[],
    contractTemplateId: '',
  },
});
function handleSign(row: API.GetEnterpriseEmployeesQueryResultItem) {
  handleSignAdd();
function handleInviteSign(row: API.GetEnterpriseEmployeesQueryResultItem) {
  if (row) {
    handleSignEdit({
      ids: [row.id],
      contractTemplateId: '',
    });
  }
}
function handleBatchSign() {
  const selectionRows = getSelectionRows();
  if (selectionRows) {
    const hasSigned = selectionRows?.some(
      (x) =>
        !(
          x.userSignContractStatus === EnumTaskUserSignContractStatus.Pass &&
          x.enterpriseSignContractStatus === EnumTaskUserSignContractStatus.Wait
        )
        x.userSignContractStatus === EnumTaskUserSignContractStatus.Pass ||
        x.enterpriseSignContractStatus === EnumTaskUserSignContractStatus.Pass ||
        x.hireStatus === EnumTaskUserHireStatus.Wait
    );
    if (hasSigned) {
      Message.warnMessage('勾选人员中包含已签约完成或未录用人员');
      return;
    }
    handleSignAdd();
    handleSignAdd({
      ids: selectionRows.map((x) => x.id),
      contractTemplateId: '',
    });
  }
}
async function signContract() {
  try {
    let params: API.InviteElectronSignCommand = {
      ids: signEditForm.ids,
      contractTemplateId: signEditForm.contractTemplateId,
    };
    let res = await enterpriseEmployeeServices.inviteElectronSign(params);
    if (res) {
      Message.successMessage('操作成功');
      getList(paginationState.pageIndex);
    }
  } catch (error) {}
}
async function handleUnSign(row: API.GetEnterpriseEmployeesQueryResultItem) {
async function handleEnterpriseSign(row: API.GetEnterpriseEmployeesQueryResultItem) {
  try {
    Message.warnMessage('功能开发中');
    // await Message.tipMessage('确定解约用户?');
    let res = await enterpriseEmployeeServices.enterpriseUserElectronSign({ id: row.id });
    if (res) {
      window.open(res?.signContractLongUrl, '_blank');
    }
  } catch (error) {}
}
function handleUnSign(row: API.GetEnterpriseEmployeesQueryResultItem) {
  stopElectronSign([row.id]);
}
function handleBatchUnSign() {
  try {
    Message.warnMessage('功能开发中');
    const selectionRows = getSelectionRows();
    if (selectionRows) {
      stopElectronSign(selectionRows.map((x) => x.id));
    }
  } catch (error) {}
}
async function stopElectronSign(ids: string[]) {
  try {
    await Message.tipMessage('确定解约用户?');
    let res = await enterpriseEmployeeServices.stopElectronSign({ ids: ids });
    if (res) {
      Message.successMessage('操作成功');
      getList(paginationState.pageIndex);
    }
  } catch (error) {}
}