瀏覽代碼

门墩儿猎寻服务

lifanagju_citu 9 月之前
父節點
當前提交
3439defc57
共有 3 個文件被更改,包括 15 次插入9 次删除
  1. 9 0
      src/api/headhunting.js
  2. 1 2
      src/views/headhunting/components/form.vue
  3. 5 7
      src/views/headhunting/index.vue

+ 9 - 0
src/api/headhunting.js

@@ -0,0 +1,9 @@
+import request from '@/config/axios'
+
+// 提交猎寻服务
+export const huntSubmit = async (data) => {
+  return await request.post({
+    url: '/admin-api/menduner/system/hunt/submit',
+    data
+  })
+}

+ 1 - 2
src/views/headhunting/components/form.vue

@@ -32,7 +32,7 @@ const items = ref({
     },
     {
       type: 'text',
-      key: 'en',
+      key: 'enterpriseName',
       value: '',
       default: null,
       label: '企业名称 *',
@@ -48,7 +48,6 @@ const getQuery = async () => {
   if (!valid) return false
   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)

+ 5 - 7
src/views/headhunting/index.vue

@@ -25,8 +25,8 @@
 <script setup>
 import { ref } from 'vue'
 import formItem from './components/form.vue'
-// import Snackbar from '@/plugins/snackbar'
 import Curtain from '@/plugins/curtain'
+import { huntSubmit } from '@/api/headhunting'
 import { useI18n } from '@/hooks/web/useI18n'; const { t } = useI18n()
 defineOptions({ name: 'headhunting-index'})
 
@@ -37,15 +37,13 @@ const formRef = ref()
 const handleSubmit = async () => {
   try {
     const obj = await formRef.value.getQuery()
-    console.log('1', obj)
-    // if (!obj) return
-    // await savePersonSimpleInfo(obj)
-    // Snackbar.success(t('headhunting.submitSuccess'))
+    if (!obj) return
+    const params = JSON.parse(JSON.stringify(obj))
+    await huntSubmit(params)
+    showDialog.value = false
     Curtain('message', { message: t('headhunting.submitSuccess') })
   } catch (error) {
     console.error('error', error)
-  } finally {
-    showDialog.value = false
   }
 }