소스 검색

简历投递

Xiao_123 10 달 전
부모
커밋
5a159ec901
3개의 변경된 파일138개의 추가작업 그리고 2개의 파일을 삭제
  1. 27 0
      src/components/CtForm/index.vue
  2. 88 0
      src/views/recruit/personal/shareJob/components/deliveryForm.vue
  3. 23 2
      src/views/recruit/personal/shareJob/index.vue

+ 27 - 0
src/components/CtForm/index.vue

@@ -62,6 +62,33 @@
                 :item="item"
                 @change="handleChange(item)"
               ></nestedListGroupUI>
+              <v-file-input
+                v-if="item.type === 'upload'"
+                :prepend-icon="item.prependIcon || ''"
+                :append-icon="item.appendIcon"
+                :append-outer-icon="item.appendOuterIcon"
+                :show-size="item.showSize"
+                variant="outlined"
+                density="compact"
+                v-model="item.value"
+                :placeholder="item.placeholder || item.label"
+                :hint="item.hint"
+                :rules="item.rules"
+                :label="item.label"
+                color="primary"
+                :persistent-hint="item.persistentHint"
+                :loading= "item.loading"
+                :disabled="item.disabled"
+                :multiple="item.multiple"
+                :success="item.success"
+                :error="item.error"
+                :accept="item.accept || '.xlsx, .xls, .csv, .pdf, .txt, .doc'"
+                @change="handleChange(item)"
+              >
+                <template v-if="item.selfAppend" #append>
+                  <slot :name="item.selfAppend" :data="item.value"></slot>
+                </template>
+              </v-file-input>
               <DatePicker v-if="item.type === 'datePicker'" v-model="item.value" :options="item.options" :width="item.width" :class="item.class"></DatePicker>
               
               <template v-if="item.slotName">

+ 88 - 0
src/views/recruit/personal/shareJob/components/deliveryForm.vue

@@ -0,0 +1,88 @@
+<template>
+  <div style="width: 100%;">
+    <CtForm ref="formPageRef" :items="items"></CtForm>
+  </div>
+</template>
+
+<script setup>
+defineOptions({ name: 'position-add-job-requirements'})
+import { reactive, ref, defineExpose } from 'vue'
+import { useI18n } from '@/hooks/web/useI18n'
+import { uploadFile } from '@/api/common'
+import Snackbar from '@/plugins/snackbar'
+
+const { t }  = useI18n()
+const formPageRef = ref()
+let query = reactive({})
+
+// 上传简历
+const typeList = ['pdf', 'doc', 'docx']
+const handleUpload = async (e) => {
+  const file = e
+  const size = file.size
+  if (size / (1024*1024) > 10) {
+    Snackbar.warning(t('common.fileSizeExceed'))
+    return
+  }
+  const arr = file.name.split('.')
+  if (typeList.indexOf(arr[arr.length - 1]) < 0) {
+    Snackbar.warning(t('common.fileFormatIncorrect'))
+    return
+  }
+  const formData = new FormData()
+  formData.append('file', file)
+  const { data } = await uploadFile(formData)
+  if (!data) return
+  items.value.options.find(e => e.key === 'url').data = data
+}
+
+const items = ref({
+  options: [
+    {
+      type: 'text',
+      key: 'name',
+      value: '',
+      clearable: true,
+      label: '姓名 *',
+      rules: [v => !!v || '请填写姓名']
+    },
+    {
+      type: 'text',
+      key: 'phone',
+      value: '',
+      clearable: true,
+      label: '手机号码 *',
+      rules: [v => !!v || '请填写手机号码']
+    },
+    {
+      type: 'upload',
+      key: 'url',
+      value: null,
+      data: '',
+      label: '简历 *',
+      accept: '.doc, .docx, .pdf',
+      placeholder: '请上传简历',
+      rules: [v => !!v || '请上传简历'],
+      change: handleUpload
+    }
+  ]
+})
+
+
+const getQuery = async () => {
+  const { valid } = await formPageRef.value.formRef.validate()
+  if (!valid) return
+  const obj = {}
+  items.value.options.forEach(e => {
+    if (Object.prototype.hasOwnProperty.call(e, 'data')) return obj[e.key] = e.data
+    obj[e.key] = e.value
+  })
+  query = Object.assign(query, obj)
+  return query
+}
+
+defineExpose({
+  formPageRef,
+  getQuery
+})
+</script>

+ 23 - 2
src/views/recruit/personal/shareJob/index.vue

@@ -58,18 +58,25 @@
         <div class="mb-5 text-center" style="height: 80px; line-height: 80px;">
           <!-- <v-btn class="mr-2 radius button-item" color="success" variant="outlined">{{ $t('position.communicate') }}</v-btn> -->
           <v-btn class="mr-2 radius button-item" color="success" variant="outlined" target="_blank" to="/recruit/personal/position">{{ $t('position.moreBtn') }}</v-btn>
-          <v-btn class="radius button-item" color="primary" @click="null">{{ $t('position.submitResume') }}</v-btn>
+          <v-btn class="radius button-item" color="primary" @click="handleDelivery">{{ $t('position.submitResume') }}</v-btn>
         </div>
       </div>
     </v-card>
   </div>
+
+  <CtDialog :visible="showResume" :widthType="2" titleClass="text-h6" title="简历投递" @close="handleClose" @submit="handleSubmit">
+    <DeliveryForm ref="deliveryForm"></DeliveryForm>
+  </CtDialog>
+
 </template>
 
 <script setup>
+defineOptions({name: 'recruit-personal-shareJob-index'})
 import { onMounted, ref } from 'vue';
 import { getPositionDetails } from '@/api/position'
 import { dealDictObjData } from '@/utils/position'
-defineOptions({name: 'recruit-personal-shareJob-index'})
+import DeliveryForm from './components/deliveryForm.vue'
+
 // 组件挂载后添加事件监听器  
 const isMobile = ref(false)
 onMounted(() => {
@@ -100,7 +107,21 @@ const desc = [
   { mdi: 'mdi-school-outline', value: 'eduName' },
   { mdi: 'mdi-clock-time-ten-outline', value: 'expName' }
 ]
+
+const deliveryForm = ref()
+const showResume = ref(false)
+const handleDelivery = () => {
+  showResume.value = true
+}
+
+const handleClose = () => {
+  showResume.value = false
+}
+const handleSubmit = async () => {
+  console.log(await deliveryForm.value.getQuery(), 'handleSubmit')
+}
 </script>
+
 <style lang="scss" scoped>
 .f-w-600 { font-weight: 600; }
 .radius { border-radius: 8px; }