Преглед на файлове

添加详情默认列表页除操作记录外的有关接口调用

lm преди 1 месец
родител
ревизия
1427666180

+ 2 - 1
src/layout/index.vue

@@ -21,7 +21,8 @@ const route = useRoute()
 
 // 此处要根据登录用户的权限 分条件展示 不同的内容
 const menuList =  computed(()=>{
-  if(route.path.startsWith('/main/myCustomerDetail')){
+  if(route.path.startsWith('/main/myCustomerDetail') || 
+      route.path.startsWith('/main/highSeasCustomerDetail') ){
     return []
   }
   return store.state.siderNav

+ 44 - 0
src/views/highSeasCustomer/components/DeleteCustomerDialog.vue

@@ -0,0 +1,44 @@
+<template>
+    <!-- 删除客户弹窗 -->
+    <Dialog :visible="deleteDialogVisible" 
+        :submitLoading="deleteDialogSubmitLoading"
+        @close="CloseDeleteDialog"
+        @confirm="HandleDeleteDialogConfirm">
+    </Dialog>
+</template>
+
+
+<script setup lang="ts">
+import {  ref } from 'vue';
+import {ElMessage} from 'element-plus'
+import { deleteHighSeasCustomerApi} from '@/api/highSeasCustomer'
+import Dialog from '@/baseComponents/Dialog.vue';
+
+const prpos = defineProps({
+    currentDeleteRow:{
+        type:Object,
+        required:true
+    }
+})
+const emit = defineEmits(['confirm'])
+
+const deleteDialogVisible = defineModel('dialogVisible')
+
+const deleteDialogSubmitLoading = ref(false)
+const CloseDeleteDialog = ()=>{
+    deleteDialogVisible.value = false
+    deleteDialogSubmitLoading.value = false
+}
+// 删除确认
+const HandleDeleteDialogConfirm = async ()=>{
+    deleteDialogSubmitLoading.value = true
+    let res = await deleteHighSeasCustomerApi(prpos.currentDeleteRow.id)
+    if(res?.code == 200){
+        ElMessage.success(res?.msg)
+        CloseDeleteDialog()
+        emit('confirm')
+    }else{
+        deleteDialogSubmitLoading.value = false
+    }
+}
+</script>

+ 172 - 109
src/views/highSeasCustomer/highSeasCustomerDetail/index.vue

@@ -14,19 +14,18 @@
                     <span>闲置天数:{{ customerBaseMsg.unUsedDayCount }}</span>
                 </div>
                 <div class="action">
-                    <el-button class="button_background" @click=""><img :src="peopleAuthenticationIcon" alt=""> 认领</el-button>
+                    <el-button class="button_background" @click="ClaimCustomer"><img :src="peopleAuthenticationIcon" alt=""> 认领</el-button>
                     <el-button class="button_border" @click="OpenConcactPeoplelFormDialog"><img :src="addIcon" alt=""> 新增联系人</el-button>
                     <el-button class="button_refresh" @click="OpenSchoolFormDialog"><img :src="editIcon" alt="" > 编辑</el-button>
                     <el-button class="button_refresh" @click="OpenOperationRecordDialog"><img :src="logIcon" alt=""> 操作记录</el-button>
-                    <el-button class="delete_button_border_no_bg" @click=""><el-icon class="img"><Delete /></el-icon>删除</el-button>
+                    <el-button class="delete_button_border_no_bg" @click="OpenDeleteDialog"><el-icon class="img"><Delete /></el-icon>删除</el-button>
                 </div>
             </template>
         </TopBackNav>
         <div class="page_item bottom_detail end_item">
             <TabSearch :defaultTabKey="defaultShowTab" 
                 tabType="line" :tabList="tabList" 
-                @tabChange="HandleTabChange"
-                />
+                @tabChange="HandleTabChange"/>
             <div class="page_solid_line" />
             <div class="page_jg_20" style="flex-shrink: 0 !important;"></div>
 
@@ -72,13 +71,20 @@
             :defaultFormData="concactPeopleDefaultFormData"
             @confirm="HandleAddPeoplelConfirm">
         </ConcactPeopleFormDialog>
+
+        <!-- 删除客户弹窗 -->
+        <DeleteCustomerDialog 
+            :currentDeleteRow="customerBaseMsg"
+            v-model:dialogVisible="deleteDialogVisible"
+            @confirm="HandleDeleteConfirm">
+        </DeleteCustomerDialog>
     </div>
 
 </template>
 
 <script setup lang="ts">
 import { ref, computed, onMounted } from 'vue';
-import { useRoute } from 'vue-router';
+import { useRoute, useRouter } from 'vue-router';
 
 import TopBackNav from '@/baseComponents/TopBackNav.vue';
 import addIcon from '@/assets/icon/add.svg';
@@ -97,19 +103,16 @@ import FollowCard from '@/components/FollowCard.vue';
 import Pagination from '@/baseComponents/Pagination.vue';
 import SchoolFormDialog from '@/components/SchoolFormDialog/index.vue'
 import ConcactPeopleFormDialog from '@/components/ConcactPeopleFormDialog/index.vue'
+import { ElMessage } from 'element-plus';
 
+import DeleteCustomerDialog from '../components/DeleteCustomerDialog.vue';
 
 import {
     addContactPeopleApi,
     claimHighSeasCustomerApi,
     updateHighSeasCustomerApi,
-    deleteHighSeasCustomerApi,
     getOperationLogApi,
 } from '@/api/highSeasCustomer'
-import { ElMessage } from 'element-plus';
-
-
-const route = useRoute()
 
 interface CustomerBaseMsg {
     name:string,  //学校名称
@@ -123,107 +126,22 @@ interface CustomerBaseMsg {
     resetDatetime:string,  //进入公海时间
     unUsedDayCount:string,  //闲置天数
 }
-const customerBaseMsg = ref<CustomerBaseMsg>({});
 
-// 默认列表的tab切换
+const route = useRoute()
+const router = useRouter()
+
+const customerBaseMsg = ref<CustomerBaseMsg>({}); //客户基础信息
+
+/**
+ * 1. 信息展示切换
+ */
 const defaultShowTab = ref('messageOverview')
 const HandleTabChange = (val)=>{
     defaultShowTab.value = val
 }
 
 
-/**  操作记录相关内容及操作 */
-const operationRecordDialogVisible = ref(false)
-const OpenOperationRecordDialog=()=>{
-    console.log('打开操作记录弹窗')
-    operationRecordDialogVisible.value = true
-}
-const CloseOperationRecordDialog=()=>{
-    operationRecordDialogVisible.value = false
-}
-
-
-
-/**  操作记录有关数据  */
-const operationLogList = ref([
-    {
-        id:1,
-        operationTime: '26-02-19 19:00',
-        operatorName: '张安顺',
-        schoolName: '北京师达学校',
-        operationType: '编辑学校信息',
-        operationContent: '学校名称【北京109中学】学段【初中】调整为学校名称【北京一零九中学】学段【九年一贯】。'
-    },
-    {
-        id:2,
-        operationTime: '26-02-19 19:00',
-        operatorName: '张安顺',
-        schoolName: '北京师达学校',
-        operationType: '删除联系人',
-        operationContent: '删除 姓名【张三】职务【校长】手机电话【17820681226】办公电话【17820681226】备注【文案文案】。'
-    },
-    {
-        id:3,
-        operationTime: '26-02-19 19:00',
-        operatorName: '张安顺',
-        schoolName: '北京师达学校',
-        operationType: '新增联系人',
-        operationContent: '新增 姓名【张三】职务【校长】手机电话【17820681226】办公电话【17820681226】备注【文案文案】。'
-    },
-    {
-        id:4,
-        operationTime: '26-02-19 19:00',
-        operatorName: '张安顺',
-        schoolName: '北京师达学校',
-        operationType: '编辑联系人',
-        operationContent: '联系人姓名【张三】职务【校长】手机电话【17820681226】备注【文案文案】调整为 联系人姓名【李四】职务【校长】手机电话【17820681226】备注【文案文案】。'
-    },
-    {
-        id:5,
-        operationTime: '26-02-19 19:00',
-        operatorName: '张安顺',
-        schoolName: '北京师达学校',
-        operationType: '转至公海',
-        operationContent: '将客户转至公海。'
-    }
-]);
-
-const finalOperationLogRenderData = computed(()=>{
-    return operationLogList.value.map(item=>{
-        return {
-            headerTitleList:[
-                item.operationTime,
-                item.operatorName,
-                item.schoolName,
-                item.operationType
-            ],
-            headerTags:[],
-            middleDesc:[],
-            bottomDesc:`操作内容:${item.operationContent}`
-        }
-    })
-})
-//  分页参数 有关数据 *
-const currentPage = ref(1)
-const pageSize = ref(20)
-const totalNum = ref(0)
-
-const GetOperationList = async ()=>{
-    let params = {
-        "customerId": 0,
-        "operUserId": 0,
-        "groupId": 0,
-        "startDate": "",
-        "endDate": "",
-        "pageNum": 0,
-        "pageSize": 0
-    }
-    await getOperationLogApi()
-
-}
-
-
-/** 1. 新增联系人有关数据  及操作 */
+/** 2. 新增联系人有关数据  及操作 */
 const concactPeopleVisible = ref(false)
 const concactPeopleDefaultFormData = ref({})
 const concactPeopleSubmitLoading = ref(false)
@@ -262,7 +180,7 @@ const HandleAddPeoplelConfirm = async (params:any)=>{
 
 
 
-/** 2. 编辑学校 有关数据 及操作 */
+/** 3. 编辑学校 有关数据 及操作 */
 const schoolVisible = ref(false)
 const schoolSubmitLoading = ref(false)
 
@@ -297,7 +215,6 @@ const OpenSchoolFormDialog = ()=>{
 const HandleSchoolDialogConfirm = async (params)=>{
     schoolSubmitLoading.value = true
     const {formData,formRef} = params
-
     let transferParams = {
         id: formData.id,
         name: formData.name,
@@ -311,19 +228,165 @@ const HandleSchoolDialogConfirm = async (params)=>{
     }
     let res = undefined
     try{
-        // 修改
         res = await updateHighSeasCustomerApi(transferParams) 
     }catch{}
 
     if(res?.code == 200){
+        customerBaseMsg.value = {
+            ...customerBaseMsg.value,
+            name:formData.name,
+            stageId: JSON.parse(formData.schoolStage || '{}')?.value,
+            stageName: JSON.parse(formData.schoolStage || '{}')?.label,
+            provinceId: JSON.parse(formData.provinceArea.province || '{}')?.value,
+            provinceName: JSON.parse(formData.provinceArea.province || '{}')?.label,
+            cityId: JSON.parse(formData.provinceArea.district || '{}')?.value,
+            cityName: JSON.parse(formData.provinceArea.district || '{}')?.label,
+            address: formData.address,
+        }
+        sessionStorage.setItem('customerMsg',JSON.stringify(customerBaseMsg.value))
         CloseSchoolFormDialog()
-        // 待完善---- 
-        // 重新查询学校基础信息
     }else{
         schoolSubmitLoading.value = false
     }
 }
 
+
+
+/** 4. 操作记录相关内容及操作 */
+const operationRecordDialogVisible = ref(false)
+const OpenOperationRecordDialog = async ()=>{
+    console.log('打开操作记录弹窗')
+    operationRecordDialogVisible.value = true
+
+    await GetOperationList()
+}
+const CloseOperationRecordDialog=()=>{
+    operationRecordDialogVisible.value = false
+}
+
+
+
+/**  操作记录有关数据  */
+const operationLogList = ref([
+    {
+        id:1,
+        operationTime: '26-02-19 19:00',
+        operatorName: '张安顺',
+        schoolName: '北京师达学校',
+        operationType: '编辑学校信息',
+        operationContent: '学校名称【北京109中学】学段【初中】调整为学校名称【北京一零九中学】学段【九年一贯】。'
+    },
+    {
+        id:2,
+        operationTime: '26-02-19 19:00',
+        operatorName: '张安顺',
+        schoolName: '北京师达学校',
+        operationType: '删除联系人',
+        operationContent: '删除 姓名【张三】职务【校长】手机电话【17820681226】办公电话【17820681226】备注【文案文案】。'
+    },
+    {
+        id:3,
+        operationTime: '26-02-19 19:00',
+        operatorName: '张安顺',
+        schoolName: '北京师达学校',
+        operationType: '新增联系人',
+        operationContent: '新增 姓名【张三】职务【校长】手机电话【17820681226】办公电话【17820681226】备注【文案文案】。'
+    },
+    {
+        id:4,
+        operationTime: '26-02-19 19:00',
+        operatorName: '张安顺',
+        schoolName: '北京师达学校',
+        operationType: '编辑联系人',
+        operationContent: '联系人姓名【张三】职务【校长】手机电话【17820681226】备注【文案文案】调整为 联系人姓名【李四】职务【校长】手机电话【17820681226】备注【文案文案】。'
+    },
+    {
+        id:5,
+        operationTime: '26-02-19 19:00',
+        operatorName: '张安顺',
+        schoolName: '北京师达学校',
+        operationType: '转至公海',
+        operationContent: '将客户转至公海。'
+    }
+]);
+
+const finalOperationLogRenderData = computed(()=>{
+    return operationLogList.value.map(item=>{
+        return {
+            headerTitleList:[
+                item.operationTime,
+                item.operatorName,
+                item.schoolName,
+                item.operationType
+            ],
+            headerTags:[],
+            middleDesc:[],
+            bottomDesc:`操作内容:${item.operationContent}`
+        }
+    })
+})
+//  分页参数 有关数据 *
+const currentPage = ref(1)
+const pageSize = ref(20)
+const totalNum = ref(0)
+
+const GetOperationList = async ()=>{
+    let params = {
+        customerId: route.params.id,
+        "operUserId": '',
+        // "groupId": 0,
+        // "startDate": "",
+        // "endDate": "",
+        pageNum: currentPage.value,
+        pageSize: pageSize.value
+    }
+    let res = await getOperationLogApi(params)
+    if(res?.code == 200){
+       const {data:operationData, dateData, groupData, memberData} =  res?.data
+       totalNum.value = operationData.total
+
+       finalOperationLogRenderData = operationData.records.map(item=>{
+        return {
+            headerTitleList:[
+                item.operDatetime,
+                item.operName,
+                item.operationType
+            ],
+            headerTags:[],
+            middleDesc:[],
+            bottomDesc:`操作内容:${item.operationContent}`
+        }
+       })
+
+
+    }
+
+}
+
+
+/**
+ * 5. 认领 有关操作
+ */
+const ClaimCustomer = async ()=>{
+    let res = await claimHighSeasCustomerApi(route.query.id)
+    if(res?.code == 200){
+        ElMessage.success(res?.msg)
+        router.go(-1)
+    }
+}
+
+/**
+ * 6. 删除弹窗 有关操作
+ */
+const deleteDialogVisible = ref(false)
+const OpenDeleteDialog = ()=>{
+    deleteDialogVisible.value = true
+}
+// 删除后执行的操作
+const HandleDeleteConfirm = ()=>{
+    router.go(-1)
+}
+
 onMounted(async ()=>{
     // 获取学校的基础信息
     customerBaseMsg.value = JSON.parse(sessionStorage.getItem('customerMsg') || '{}')    

+ 9 - 23
src/views/highSeasCustomer/index.vue

@@ -60,11 +60,11 @@
         </FormDialog>
 
         <!-- 删除弹窗 -->
-        <Dialog :visible="deleteDialogVisible" 
-            :submitLoading="deleteDialogSubmitLoading"
-            @close="CloseDeleteDialog"
+        <DeleteCustomerDialog 
+            :currentDeleteRow="currentDeleteRow"
+            v-model:dialogVisible="deleteDialogVisible"
             @confirm="HandleDeleteDialogConfirm">
-        </Dialog> 
+        </DeleteCustomerDialog>
     
     </div>
 </template>
@@ -83,6 +83,7 @@ import {publicSeasTableColumns,templateTableColumns} from './table'
 
 import SchoolFormDialog from '@/components/SchoolFormDialog/index.vue'
 import FormDialog from '@/baseComponents/FormDialog.vue';
+import DeleteCustomerDialog from './components/DeleteCustomerDialog.vue';
 
 import {batchImportFormItemList} from './formDialog'
 
@@ -93,11 +94,8 @@ import { getHeaderSearchParamsApi,
         addHighSeasCustomerApi,
         importHighSeasCustomerApi,
         updateHighSeasCustomerApi,
-        deleteHighSeasCustomerApi,
         claimHighSeasCustomerApi,
-
-    } from '@/api/highSeasCustomer'
-import Dialog from '@/baseComponents/Dialog.vue';
+} from '@/api/highSeasCustomer'
 
 
 const router = useRouter()
@@ -361,27 +359,15 @@ const HandleFileUplaod = (params)=>{
  * 5. 删除弹窗 有关数据
  */
 const deleteDialogVisible = ref(false)
-const deleteDialogSubmitLoading = ref(false)
 const currentDeleteRow = ref()
 const OpenDeleteDialog = (row)=>{
     deleteDialogVisible.value = true
     currentDeleteRow.value = row
 }
-const CloseDeleteDialog = ()=>{
-    deleteDialogVisible.value = false
-    deleteDialogSubmitLoading.value = false
-}
-// 删除确认
+// 删除后执行的操作
 const HandleDeleteDialogConfirm = async ()=>{
-    deleteDialogSubmitLoading.value = true
-    let res = await deleteHighSeasCustomerApi(currentDeleteRow.value.id)
-    if(res?.code == 200){
-        ElMessage.success(res?.msg)
-        CloseDeleteDialog()
-        await GetTableData()
-    }else{
-        deleteDialogSubmitLoading.value = false
-    }
+    currentDeleteRow.value = {}
+    await GetTableData()
 }
 
 /**