Selaa lähdekoodia

人才去重列表

Xiao_123 1 viikko sitten
vanhempi
commit
2f21fefc1a

+ 38 - 0
src/api/menduner/system/talentMap/duplicate.ts

@@ -0,0 +1,38 @@
+import request from '@/config/axios'
+
+export const talentDuplicateApi = {
+	// 获取重复记录列表
+	getDuplicateList: async (params: any) => {
+		return await request.get({ 
+			url: `/api/parse/get-duplicate-records`,
+			params,
+			baseURL: import.meta.env.VITE_BASE_URL
+		})
+	},
+
+	// 创建职位
+	createHotelPosition: async (data: any) => {
+		return await request.post({ 
+			url: `/api/parse/add-hotel-positions`, 
+			data, 
+			baseURL: import.meta.env.VITE_BASE_URL
+		})
+	},
+
+	// 更新职位
+	updateHotelPosition: async (position_id: number, data: any) => {
+		return await request.put({ 
+			url: `/api/parse/update-hotel-positions/${position_id}`, 
+			data, 
+			baseURL: import.meta.env.VITE_BASE_URL 
+		})
+	},
+
+	// 删除职位
+	deleteHotelPosition: async (position_id: number) => {
+		return await request.delete({ 
+			url: `/api/parse/delete-hotel-positions/${position_id}`, 
+			baseURL: import.meta.env.VITE_BASE_URL 
+		})
+	}
+}

+ 133 - 0
src/views/menduner/system/talentMap/duplicate/index.vue

@@ -0,0 +1,133 @@
+<template>
+  <!-- 搜索工作栏 -->
+  <ContentWrap>
+    <el-form
+      class="-mb-15px"
+      :model="queryParams"
+      ref="queryFormRef"
+      :inline="true"
+      label-width="40px"
+    >
+			<el-form-item label="状态" prop="status">
+        <el-select
+          v-model="queryParams.status"
+          class="!w-240px"
+          clearable
+          placeholder="请选择状态"
+        >
+          <el-option
+            v-for="dict in statusOptions"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
+        <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
+      </el-form-item>
+    </el-form>
+  </ContentWrap>
+
+  <!-- 列表 -->
+  <ContentWrap>
+    <el-table v-loading="loading" :data="list" :stripe="true" row-key="id">
+      <el-table-column label="姓名" align="center" prop="main_card.name_zh" />
+      <el-table-column label="手机号" align="center" prop="main_card.mobile" />
+      <el-table-column label="职位" align="center" prop="main_card.title_zh" />
+      <el-table-column label="酒店" align="center" prop="main_card.hotel_zh" :show-overflow-tooltip="true" />
+      <el-table-column label="状态" align="center" prop="processing_status">
+        <template #default="scope">
+          <el-tag :type="statusOptions.find(item => item.value === scope.row.processing_status)?.color">
+						{{ statusOptions.find(item => item.value === scope.row.processing_status)?.label }}
+          </el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="创建时间" align="center" prop="duplicate_reason" :show-overflow-tooltip="true" />
+      <el-table-column label="创建时间" align="center" prop="created_at" width="180" />
+      <el-table-column label="操作" align="center">
+        <template #default="scope">
+          <el-button link type="primary" @click="openForm(scope.row)">标注</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+  </ContentWrap>
+</template>
+
+<script setup lang="ts" name="TalentMapDuplicate">
+import { talentDuplicateApi } from '@/api/menduner/system/talentMap/duplicate'
+
+const loading = ref(false)
+const list = ref([
+  {
+    "id": 1,
+    "main_card_id": 123,
+    "suspected_duplicates": [
+      {
+        "id": 101,
+        "name_zh": "张三",
+        "mobile": "13812345678",
+        "hotel_zh": "北京丽思卡尔顿酒店",
+        "title_zh": "总监",
+        "created_at": "2024-01-15 10:30:00"
+      }
+    ],
+    "duplicate_reason": "姓名相同但手机号码不同:张三,新手机号:13987654321",
+    "processing_status": "pending",
+    "created_at": "2024-01-16 09:15:00",
+    "main_card": {
+      "id": 123,
+      "name_zh": "张三",
+      "mobile": "13987654321",
+      "hotel_zh": "上海丽思卡尔顿酒店",
+      "title_zh": "总经理",
+      "image_path": "abc123def456.jpg"
+    }
+  }
+])
+const queryParams = reactive({
+	status: 'pending'
+})
+const queryFormRef = ref() // 搜索的表单
+const statusOptions = [
+	{ label: '待处理', value: 'pending', color: 'warning' },
+	{ label: '已处理', value: 'processed', color: 'success' },
+	{ label: '已忽略', value: 'ignored', color: 'info' }
+]
+
+const message = useMessage() // 消息弹窗
+
+/** 查询列表 */
+const getList = async () => {
+  loading.value = true
+  try {
+    const data = await talentDuplicateApi.getDuplicateList(queryParams)
+    list.value = data
+  } finally {
+    loading.value = false
+  }
+}
+
+/** 添加/修改操作 */
+const formRef = ref()
+const openForm = (data: any) => {
+  formRef.value.open(data)
+}
+
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  getList()
+}
+
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value.resetFields()
+  handleQuery()
+}
+
+/** 初始化 **/
+onMounted(() => {
+  getList()
+})
+</script>