|
@@ -1,21 +1,25 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="end_item">
|
|
<div class="end_item">
|
|
|
- <SearchBlock :searchList="blockSearchList" class="search_block">
|
|
|
|
|
|
|
+ <SearchBlock :searchList="blockSearchList" class="search_block" @searchChange="HandleSearchChange">
|
|
|
<template #position>
|
|
<template #position>
|
|
|
- <FormSearchGroup :searchList="formSearchList" />
|
|
|
|
|
|
|
+ <FormSearchGroup :searchList="formSearchList" @searchChange="HandleSearchChange" />
|
|
|
</template>
|
|
</template>
|
|
|
</SearchBlock>
|
|
</SearchBlock>
|
|
|
- <Table :currentPage="currentPage"
|
|
|
|
|
- :pageSize="pageSize" :totalNum="totalNum"
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <Table
|
|
|
|
|
+ :hidePagination="true"
|
|
|
:tableColumns="tableColumns"
|
|
:tableColumns="tableColumns"
|
|
|
:tableData="tableData">
|
|
:tableData="tableData">
|
|
|
<template #num="{currentIndex}">
|
|
<template #num="{currentIndex}">
|
|
|
- {{ (currentPage - 1) * pageSize + currentIndex }}
|
|
|
|
|
|
|
+ {{ currentIndex }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #lastFollowDate="{row}">
|
|
|
|
|
+ {{ row.lastFollowDate ? row.lastFollowDate : '-' }}
|
|
|
</template>
|
|
</template>
|
|
|
<template #operation="{row}">
|
|
<template #operation="{row}">
|
|
|
<div class="table_row_option">
|
|
<div class="table_row_option">
|
|
|
<span class="option_button_editor" @click="OpenCactPeopleFormDialog(row)">编辑</span>
|
|
<span class="option_button_editor" @click="OpenCactPeopleFormDialog(row)">编辑</span>
|
|
|
- <span class="el_button_delete">删除</span>
|
|
|
|
|
|
|
+ <span class="el_button_delete" @click="OpenDeleteDialog(row)">删除</span>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</Table>
|
|
</Table>
|
|
@@ -24,81 +28,173 @@
|
|
|
|
|
|
|
|
<!-- 修改联系人弹窗 -->
|
|
<!-- 修改联系人弹窗 -->
|
|
|
<ConcactPeopleFormDialog
|
|
<ConcactPeopleFormDialog
|
|
|
|
|
+ v-if="concactPeopleVisible"
|
|
|
title="修改联系人"
|
|
title="修改联系人"
|
|
|
v-model:visible="concactPeopleVisible"
|
|
v-model:visible="concactPeopleVisible"
|
|
|
- :defaultFormData="defaultConcactPeopleFormData">
|
|
|
|
|
|
|
+ v-model:submitLoading="concactPeopleSubmitLoading"
|
|
|
|
|
+ :defaultFormData="defaultConcactPeopleFormData"
|
|
|
|
|
+ @confirm="HandleUpdateConcactPeople">
|
|
|
</ConcactPeopleFormDialog>
|
|
</ConcactPeopleFormDialog>
|
|
|
|
|
|
|
|
|
|
+ <Dialog :visible="deleteDialogVisible"
|
|
|
|
|
+ :submitLoading="deleteDialogSubmitLoading"
|
|
|
|
|
+ @close="CloseDeleteDialog"
|
|
|
|
|
+ @confirm="HandleDeleteConfirm">
|
|
|
|
|
+ </Dialog>
|
|
|
|
|
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import { ref } from 'vue';
|
|
|
|
|
-
|
|
|
|
|
|
|
+import { onMounted, ref } from 'vue';
|
|
|
|
|
+import { useStore } from 'vuex';
|
|
|
|
|
+import { useRoute } from 'vue-router';
|
|
|
import SearchBlock from '@/baseComponents/SearchBlock.vue';
|
|
import SearchBlock from '@/baseComponents/SearchBlock.vue';
|
|
|
import {blockSearchList} from'./searchBlock'
|
|
import {blockSearchList} from'./searchBlock'
|
|
|
import FormSearchGroup from '@/baseComponents/FormSearchGroup.vue';
|
|
import FormSearchGroup from '@/baseComponents/FormSearchGroup.vue';
|
|
|
import {formSearchList} from './formSearchGroup'
|
|
import {formSearchList} from './formSearchGroup'
|
|
|
import Table from '@/baseComponents/Table.vue';
|
|
import Table from '@/baseComponents/Table.vue';
|
|
|
import {tableColumns} from './table'
|
|
import {tableColumns} from './table'
|
|
|
|
|
+import ConcactPeopleFormDialog from '@/components/ConcactPeopleFormDialog/index.vue'
|
|
|
|
|
+import {
|
|
|
|
|
+ getContactPeopleListApi,
|
|
|
|
|
+ deleteContactPeopleApi,
|
|
|
|
|
+ updateContactPeopleApi,
|
|
|
|
|
+} from '@/api/highSeasCustomer'
|
|
|
|
|
+import Dialog from '@/baseComponents/Dialog.vue';
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+const store = useStore()
|
|
|
|
|
+const route = useRoute ()
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * 1. 获取职位列表信息
|
|
|
|
|
+*/
|
|
|
|
|
+const GetPositionList = async ()=>{
|
|
|
|
|
+ await store.dispatch('updatePositionList')
|
|
|
|
|
+ let positionOption = store.state.positionList
|
|
|
|
|
+ blockSearchList.value = blockSearchList.value.map(item=>{
|
|
|
|
|
+ if(item.key == 'position'){
|
|
|
|
|
+ item.options = [
|
|
|
|
|
+ {
|
|
|
|
|
+ label:'全部',
|
|
|
|
|
+ value:'all'
|
|
|
|
|
+ },
|
|
|
|
|
+ ...positionOption
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
|
|
+ return item
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
|
|
|
-import ConcactPeopleFormDialog from '@/components/ConcactPeopleFormDialog/index.vue'
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * 2. 查询联系人详情 及有关数据操作
|
|
|
|
|
+*/
|
|
|
|
|
+const tableData = ref([]);
|
|
|
|
|
+const searchParams = ref({
|
|
|
|
|
+ position:'all',
|
|
|
|
|
+ queryStr:'',
|
|
|
|
|
+})
|
|
|
|
|
+//处理筛选参数的变更
|
|
|
|
|
+const HandleSearchChange = async (params,key)=>{
|
|
|
|
|
+ console.log('职位信息的变更-----',params)
|
|
|
|
|
+ searchParams.value = {
|
|
|
|
|
+ ...searchParams.value,
|
|
|
|
|
+ ...params
|
|
|
|
|
+ }
|
|
|
|
|
+ await GetConcactPeopleList()
|
|
|
|
|
+}
|
|
|
|
|
+// 获取联系人列表
|
|
|
|
|
+const GetConcactPeopleList = async ()=>{
|
|
|
|
|
+ console.log('当前筛选的职位信息-----',searchParams.value.position)
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ customerId:route.query.id,
|
|
|
|
|
+ queryStr:searchParams.value.queryStr,
|
|
|
|
|
+ positionId:searchParams.value?.position == 'all' ? '' : JSON.parse(searchParams.value.position || '{}')?.value,
|
|
|
|
|
+ }
|
|
|
|
|
+ let res = await getContactPeopleListApi(params)
|
|
|
|
|
+ if(res.code == 200){
|
|
|
|
|
+ tableData.value = res.data
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
|
|
|
-const currentPage = ref(1)
|
|
|
|
|
-const pageSize = ref(20)
|
|
|
|
|
-const totalNum = ref(0)
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-const tableData = ref([
|
|
|
|
|
- {
|
|
|
|
|
- id: '1',
|
|
|
|
|
- name: '严谨',
|
|
|
|
|
- position:'principal',
|
|
|
|
|
- positionName: '校长',
|
|
|
|
|
- mobilePhone: '172****9908',
|
|
|
|
|
- officePhone: '17287889908',
|
|
|
|
|
- remark: '备注文案',
|
|
|
|
|
- lastFollowUpTime: '26-08-19 19:00',
|
|
|
|
|
- creator: '李四',
|
|
|
|
|
- createTime: '26-08-19 17:00'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: '2',
|
|
|
|
|
- name: '王诗雅',
|
|
|
|
|
- position:'principal',
|
|
|
|
|
- positionName: '校长',
|
|
|
|
|
- mobilePhone: '172****9908',
|
|
|
|
|
- officePhone: '-', // 图片中显示为横杠
|
|
|
|
|
- remark: '备注文案',
|
|
|
|
|
- lastFollowUpTime: '26-08-19 19:00',
|
|
|
|
|
- creator: '李四',
|
|
|
|
|
- createTime: '26-08-19 17:00'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: '3',
|
|
|
|
|
- name: '赵子涵',
|
|
|
|
|
- position:'principal',
|
|
|
|
|
- positionName: '教学校长',
|
|
|
|
|
- mobilePhone: '172****9908',
|
|
|
|
|
- officePhone: '172****9908', // 图片中该号码也进行了脱敏处理
|
|
|
|
|
- remark: '备注文案',
|
|
|
|
|
- lastFollowUpTime: '26-08-19 19:00',
|
|
|
|
|
- creator: '李四',
|
|
|
|
|
- createTime: '26-08-19 17:00'
|
|
|
|
|
- }
|
|
|
|
|
-]);
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-/** 修改联系人弹窗 有关数据及操作 */
|
|
|
|
|
|
|
+/** 3. 修改联系人弹窗 有关数据及操作 */
|
|
|
const concactPeopleVisible = ref(false)
|
|
const concactPeopleVisible = ref(false)
|
|
|
const defaultConcactPeopleFormData = ref({})
|
|
const defaultConcactPeopleFormData = ref({})
|
|
|
|
|
+const concactPeopleSubmitLoading = ref(false)
|
|
|
const OpenCactPeopleFormDialog = (row)=>{
|
|
const OpenCactPeopleFormDialog = (row)=>{
|
|
|
concactPeopleVisible.value = true
|
|
concactPeopleVisible.value = true
|
|
|
- defaultConcactPeopleFormData.value = row
|
|
|
|
|
|
|
+ defaultConcactPeopleFormData.value = {
|
|
|
|
|
+ ...row,
|
|
|
|
|
+ position:JSON.stringify({
|
|
|
|
|
+ label:row.positionName,
|
|
|
|
|
+ value:row.positionId
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+const CloseCactPeopleFormDialog =()=>{
|
|
|
|
|
+ concactPeopleSubmitLoading.value = false
|
|
|
|
|
+ concactPeopleVisible.value = false
|
|
|
|
|
+ defaultConcactPeopleFormData.value = {}
|
|
|
|
|
+}
|
|
|
|
|
+const HandleUpdateConcactPeople = async (params)=>{
|
|
|
|
|
+ concactPeopleSubmitLoading.value = true
|
|
|
|
|
+ const {formData,formRef} = params
|
|
|
|
|
+ let transferParams = {
|
|
|
|
|
+ id:formData.id,
|
|
|
|
|
+ customerId: route.query.id, //
|
|
|
|
|
+ name: formData.name,
|
|
|
|
|
+ positionId: JSON.parse(formData.position || '{}')?.value,
|
|
|
|
|
+ positionName: JSON.parse(formData.position || '{}')?.label,
|
|
|
|
|
+ phoneNo: formData.phoneNo,
|
|
|
|
|
+ officePhoneNo: formData.officePhoneNo,
|
|
|
|
|
+ remark: formData.remark,
|
|
|
|
|
+ }
|
|
|
|
|
+ let res = undefined
|
|
|
|
|
+ res = await updateContactPeopleApi(transferParams)
|
|
|
|
|
+ if(res?.code == 200){
|
|
|
|
|
+ CloseCactPeopleFormDialog()
|
|
|
|
|
+ await GetConcactPeopleList()
|
|
|
|
|
+ }else{
|
|
|
|
|
+ concactPeopleSubmitLoading.value = false
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+/**
|
|
|
|
|
+ * 4. 删除联系人弹窗有关操作
|
|
|
|
|
+ */
|
|
|
|
|
+const deleteDialogVisible = ref(false)
|
|
|
|
|
+const deleteDialogSubmitLoading = ref(false)
|
|
|
|
|
+const currentDeleteRow = ref()
|
|
|
|
|
+const OpenDeleteDialog = (row)=>{
|
|
|
|
|
+ deleteDialogVisible.value = true
|
|
|
|
|
+ currentDeleteRow.value = row
|
|
|
}
|
|
}
|
|
|
|
|
+const CloseDeleteDialog = ()=>{
|
|
|
|
|
+ deleteDialogSubmitLoading.value = false
|
|
|
|
|
+ deleteDialogVisible.value = false
|
|
|
|
|
+}
|
|
|
|
|
+const HandleDeleteConfirm = async ()=>{
|
|
|
|
|
+ deleteDialogSubmitLoading.value = true
|
|
|
|
|
+ let res = undefined
|
|
|
|
|
+ try{
|
|
|
|
|
+ res = await deleteContactPeopleApi(currentDeleteRow.value.id)
|
|
|
|
|
+ }catch{}
|
|
|
|
|
+ if(res?.code == 200){
|
|
|
|
|
+ CloseDeleteDialog()
|
|
|
|
|
+ await GetConcactPeopleList()
|
|
|
|
|
+ }else{
|
|
|
|
|
+ deleteDialogSubmitLoading.value = false
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+onMounted(async ()=>{
|
|
|
|
|
+ await GetPositionList()
|
|
|
|
|
+ await GetConcactPeopleList()
|
|
|
|
|
+
|
|
|
|
|
+})
|
|
|
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|