wupengfei
2025-11-12 2d186e743eb24fd44fba02e2146e55273a66f153
src/views/FlexJobManage/FlexJobManage.vue
@@ -120,11 +120,11 @@
            :limit="1"
            accept="xlsx,xls"
          >
            <el-button text type="primary" class="pro-table-operation-btn">批量导入</el-button>
            <el-button type="primary" class="pro-table-operation-btn">批量导入</el-button>
          </BlFileUpload>
          <el-button
            v-if="checkSubModuleItemShow('pageButton', 'addBtn')"
            @click="handleStaffInfoAdd()"
            @click="handleInternalStaffAdd()"
            type="primary"
            >新建</el-button
          >
@@ -174,6 +174,7 @@
    />
    <SendShotMessageDialog v-bind="dialogShotMessageProps" />
    <SignDialog v-bind="dialogSignProps" />
    <AddInternalStaffDialog v-bind="dialogAddInternalStaffProps" />
  </LoadingLayout>
</template>
@@ -202,6 +203,7 @@
import BatchImportDialog from './components/BatchImportDialog.vue';
import SendShotMessageDialog from './components/SendShotMessageDialog.vue';
import StaffDetailInfoDialog from './components/StaffDetailInfoDialog.vue';
import AddInternalStaffDialog from './components/AddInternalStaffDialog.vue';
import SignDialog from './components/SignDialog.vue';
import * as enterpriseEmployeeServices from '@/services/api/enterpriseEmployee';
import { ModelValueType } from 'element-plus';
@@ -304,7 +306,7 @@
  handleAdd: handleStaffInfoAdd,
  editForm: staffInfoEditForm,
} = useFormDialog({
  onConfirm: addEnterpriseEmployee,
  onConfirm: editEnterpriseEmployee,
  defaultFormParams: {
    id: '',
    name: '',
@@ -318,7 +320,6 @@
    regiterTime: '',
    userRealTime: '',
    userSignContractTime: '',
    contractTime: [] as unknown as ModelValueType,
    isDetail: false,
  },
});
@@ -342,31 +343,7 @@
      userRealTime: row.userRealTime ?? '',
      userSignContractTime: row.userSignContractTime ?? '',
      isDetail: isDetail,
      contractTime: [row.contractBegin, row.contractEnd],
    });
  } catch (error) {}
}
async function addEnterpriseEmployee() {
  try {
    let params: API.AddEnterpriseEmployeeCommand = {
      name: staffInfoEditForm.name,
      identity: staffInfoEditForm.identity,
      contactPhoneNumber: staffInfoEditForm.contactPhoneNumber,
      gender: staffInfoEditForm.gender,
      age: staffInfoEditForm.age,
      identityImg: staffInfoEditForm.identityImg[0]?.path ?? '',
      identityBackImg: staffInfoEditForm.identityBackImg[0]?.path ?? '',
      contractUrl: staffInfoEditForm.contractUrl[0]?.path ?? '',
      contractBegin: format(staffInfoEditForm.contractTime[0], 'YYYY-MM-DD 00:00:00'),
      contractEnd: format(staffInfoEditForm.contractTime[1], 'YYYY-MM-DD 23:59:59'),
    };
    let res = await enterpriseEmployeeServices.addEnterpriseEmployee(params);
    if (res) {
      Message.successMessage('操作成功');
      getList(paginationState.pageIndex);
    }
  } catch (error) {}
}
@@ -676,4 +653,48 @@
    state.flexjobUrl = [] as UploadUserFile[];
  }
}
const {
  dialogProps: dialogAddInternalStaffProps,
  handleAdd: handleInternalStaffAdd,
  editForm: internalStaffEditForm,
} = useFormDialog({
  onConfirm: addEnterpriseEmployee,
  defaultFormParams: {
    name: '',
    identity: '',
    contactPhoneNumber: '',
    gender: EnumUserGender.Male,
    age: null as any as number,
    identityImg: [] as UploadUserFile[],
    identityBackImg: [] as UploadUserFile[],
    contractUrl: [] as UploadUserFile[],
    regiterTime: '',
    userRealTime: '',
    userSignContractTime: '',
    contractTime: [] as unknown as ModelValueType,
  },
});
async function addEnterpriseEmployee() {
  try {
    let params: API.AddEnterpriseEmployeeCommand = {
      name: internalStaffEditForm.name,
      identity: internalStaffEditForm.identity,
      contactPhoneNumber: internalStaffEditForm.contactPhoneNumber,
      gender: internalStaffEditForm.gender,
      age: internalStaffEditForm.age,
      identityImg: internalStaffEditForm.identityImg[0]?.path ?? '',
      identityBackImg: internalStaffEditForm.identityBackImg[0]?.path ?? '',
      contractUrl: internalStaffEditForm.contractUrl[0]?.path ?? '',
      contractBegin: format(internalStaffEditForm.contractTime[0], 'YYYY-MM-DD 00:00:00'),
      contractEnd: format(internalStaffEditForm.contractTime[1], 'YYYY-MM-DD 23:59:59'),
    };
    let res = await enterpriseEmployeeServices.addEnterpriseEmployee(params);
    if (res) {
      Message.successMessage('操作成功');
      getList(paginationState.pageIndex);
    }
  } catch (error) {}
}
</script>