Commit 7f6b6010 by yuzhenWang

提交代码写到了预约信息

parent 19b678da
<template>
<div class="formContainer">
<div class="formLeft" v-if="showAnchor">
<el-affix :offset="affixOffset">
<el-anchor
:direction="direction"
:type="type"
:offset="anchorOffset"
@click="handleAnchorClick"
>
<!-- -->
<el-anchor-link
v-for="item in anchorList"
:href="'#' + item.title"
:title="item.name"
@click="e => handleLinkClick(e, item.title)"
/>
</el-anchor>
</el-affix>
</div>
<div class="formRight" :class="showAnchor ? 'formRightSelf' : ''">
<slot name="form-right"></slot>
</div>
</div>
</template>
<script setup>
import { ref, onMounted, getCurrentInstance } from 'vue'
const props = defineProps({
containerRef: {
type: Object,
default: () => {
return {}
}
},
direction: {
type: String,
default: 'vertical'
},
type: {
type: String,
default: 'default'
},
anchorOffset: {
type: Number,
default: 30
},
affixOffset: {
type: Number,
default: 60
},
anchorList: {
type: Array,
default: () => {
return []
}
},
// 新增:滚动容器的选择器
scrollContainerSelector: {
type: String,
default: ''
},
// 新增:滚动到元素时额外的偏移量
scrollOffset: {
type: Number,
default: 0
},
domIndex: {
type: Number,
default: 0
},
showAnchor: {
type: Boolean,
default: true
}
})
const emit = defineEmits(['anchor-click'])
// 处理锚点点击
const handleAnchorClick = e => {
// 阻止默认的锚点跳转
e.preventDefault()
}
// 处理链接点击
const handleLinkClick = (e, anchorId) => {
e.preventDefault()
e.stopPropagation()
emit('anchor-click', anchorId)
// 延迟执行滚动,确保 DOM 已经更新
setTimeout(() => {
scrollToAnchor(anchorId)
}, 50)
}
// 滚动到锚点
const scrollToAnchor = anchorId => {
const targetElement = document.getElementById(anchorId)
if (!targetElement) return
let scrollContainer
if (props.scrollContainerSelector) {
scrollContainer = document.querySelectorAll(props.scrollContainerSelector)
}
if (scrollContainer.length > 0) {
// 计算在容器内的相对位置
const containerRect = scrollContainer[props.domIndex].getBoundingClientRect()
const targetRect = targetElement.getBoundingClientRect()
// 计算滚动位置
const scrollTop =
targetRect.top -
containerRect.top +
scrollContainer[props.domIndex].scrollTop -
props.scrollOffset
// 平滑滚动
scrollContainer[props.domIndex].scrollTo({
top: scrollTop,
behavior: 'smooth'
})
} else {
// 如果没有指定容器,使用默认滚动
targetElement.scrollIntoView({
behavior: 'smooth',
block: 'start'
})
}
}
// 暴露方法给父组件
defineExpose({
scrollToAnchor
})
</script>
<style lang="scss" scoped>
.formContainer {
width: 100%;
box-sizing: border-box;
display: flex;
}
.formLeft {
width: 15%;
box-sizing: border-box;
height: 100vh;
}
.formRight {
flex: 1;
padding-left: 10px;
box-sizing: border-box;
}
.formRightSelf {
border-left: 3px solid rgb(247 247 247);
}
</style>
......@@ -20,9 +20,20 @@
</div>
</div>
</div>
<div class="tabsBox" ref="tabPaneRef">
<el-tabs v-model="activeName" class="demo-tabs" :before-leave="beforeTabLeave">
<el-tab-pane v-for="tab in tabsList" :key="tab.name" :label="tab.label" :name="tab.name">
<div class="tabsBox">
<el-tabs
v-model="activeName"
class="demo-tabs"
:before-leave="beforeTabLeave"
ref="tabPaneRef"
>
<el-tab-pane
v-for="(tab, tIndex) in tabsList"
:key="tab.name"
:label="tab.label"
:name="tab.name"
>
<!-- 注意tabPaneBox这个类名与子组件的锚点定位相关,不能轻易改动 -->
<div :class="{ tabPaneBox: activeName !== 'appointment' }">
<div v-if="tab.name === 'overview'" class="overviewBox">
<div
......@@ -79,6 +90,8 @@
:customerBizId="processInfo.customerBizId"
@handleSuccess="handleSuccess"
:tabPaneRef="tabPaneRef"
:tabIndex="tabsList.findIndex(t => t.name === 'customer')"
anchorContainer=".tabPaneBox"
/>
<div v-if="tab.name === 'fnaform'">
<FanForm
......@@ -206,17 +219,17 @@ const getDictsData = async () => {
pageSize: 10
}
const response2 = await getInsuranceProductList(params2)
if (response2.code == 200) {
response2.data.records = response2.data.records.map(item => {
return {
...item,
label: item.productName,
value: item.productBizId
}
})
dictStore.setInsureProductList(response2.data.records)
}
// const response2 = await getInsuranceProductList(params2)
// if (response2.code == 200) {
// response2.data.records = response2.data.records.map(item => {
// return {
// ...item,
// label: item.productName,
// value: item.productBizId
// }
// })
// dictStore.setInsureProductList(response2.data.records)
// }
const params3 = {
pageNo: 1,
pageSize: 10
......@@ -276,15 +289,7 @@ const processUpdate = (data, status) => {
}
})
}
// 新建流程
// const getAddInfo = () => {
// addFna({ remark: '' }).then(res => {
// if (res.code == 200) {
// // 获取流程详情
// getProcessInfo(res.data.fnaBizId)
// }
// })
// }
// 获取流程详情
function getProcessInfo(fnaBizId, changeTab) {
getProcessDetail(fnaBizId).then(res => {
......@@ -515,13 +520,9 @@ getDictsData()
}
}
}
/* .tabPaneBox {
height: calc(100vh - 275px);
overflow-y: auto;
padding-right: 10px;
} */
.tabPaneBox {
height: calc(100vh - 275px);
height: calc(100vh - 280px);
overflow-y: auto;
padding-right: 10px;
position: relative;
......
......@@ -72,6 +72,7 @@
:data="tenantList"
@selection-change="tableSelect"
@sort-change="sortChange"
border
>
<el-table-column type="index" width="50" label="序号" />
<el-table-column label="客户姓名" align="center" prop="customerName" width="100" />
......@@ -130,16 +131,6 @@
</template>
</el-table-column>
</el-table>
<!-- <div style="width: 100%; display: flex; justify-content: flex-end; margin-bottom: 30px">
<pagination
v-show="total >= 0"
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
style="text-align: right"
/>
</div> -->
</template>
</CommonPage>
<!-- 下一步到预约 -->
......
......@@ -44,12 +44,19 @@
<el-row v-if="isEmbed">
<el-col>
<div class="topButtonBox">
<el-button
<!-- <el-button
v-if="idsObj.appointmentBizId && pageSource !== 'policyList'"
type="primary"
icon="Plus"
@click="handleAddExecl"
>上传EXECL</el-button
> -->
<el-button
v-if="pageSource !== 'policyList'"
type="primary"
:icon="Edit"
@click="handleEdit"
>编辑</el-button
>
<el-button
v-if="pageSource !== 'policyList'"
......@@ -86,6 +93,10 @@
:appointmentStatus="appointmentSummeryInfo.status"
@handleSuccessEdit="getAppointmentInfo(idsObj.appointmentBizId)"
ref="appointmentInfoRef"
:tabIndex="tabsList.findIndex(t => t.name === 'appointmentInfo')"
anchorContainer=".appointmentTabPaneBox"
:fatherTabName="tabName"
:editStatus="editStatus"
/>
</div>
<div v-if="tab.name === 'productPlan'">
......@@ -320,7 +331,7 @@ import {
} from '@/api/sign/appointment'
import { getPolicyfollow, getPolicyInfo, signName } from '@/api/sign/underwritingMain'
import { listTenantUser, getInsuranceProductList, getAdditionalProductList } from '@/api/common'
import { Check } from '@element-plus/icons-vue'
import { Check, Edit } from '@element-plus/icons-vue'
import { ref, nextTick, onUnmounted } from 'vue'
const emit = defineEmits(['handleSuccess'])
......@@ -363,6 +374,7 @@ const processInfo = ref({
createTime: proxy.parseTime(new Date()),
customerName: userStore.name
})
const editStatus = ref(true) //编辑状态
const execlDialog = ref(false)
const isEmbed = ref(false) //是否作为组件插入
const policyNo = ref('') //新单跟进保单号
......@@ -626,17 +638,17 @@ const getDictsData = async () => {
pageSize: 10
}
const response2 = await getInsuranceProductList(params2)
if (response2.code == 200) {
response2.data.records = response2.data.records.map(item => {
return {
...item,
label: item.productName,
value: item.productBizId
}
})
dictStore.setInsureProductList(response2.data.records)
}
// const response2 = await getInsuranceProductList(params2)
// if (response2.code == 200) {
// response2.data.records = response2.data.records.map(item => {
// return {
// ...item,
// label: item.productName,
// value: item.productBizId
// }
// })
// dictStore.setInsureProductList(response2.data.records)
// }
const params3 = {
pageNo: 1,
pageSize: 10
......@@ -887,7 +899,9 @@ const handleSubmit = type => {
})
}
}
const handleEdit = () => {
editStatus.value = !editStatus.value
}
//修改预约数据
if (route.query.appointmentNo && route.query.source == 'appointmentList') {
processInfo.value = route.query
......@@ -901,7 +915,7 @@ const pageSource = computed(() => {
})
const tabHight = computed(() => {
if (pageSource.value == 'fnaList') {
return 'calc(100vh - 407px)'
return 'calc(100vh - 412px)'
} else if (pageSource.value == 'policyList') {
return 'calc(100vh - 225px)'
} else {
......@@ -910,7 +924,7 @@ const tabHight = computed(() => {
})
const minHight = computed(() => {
if (pageSource.value == 'fnaList') {
return 'calc(100vh - 84.5px)'
return 'calc(100vh - 80px)'
} else if (pageSource.value == 'policyList') {
return 'calc(100vh - 84.5px)'
} else {
......@@ -983,7 +997,7 @@ watch(
activeName.value = 'appointmentInfo'
})
} else {
getAppointmentInfo(idsObj.value.appointmentBizId)
// getAppointmentInfo(idsObj.value.appointmentBizId)
tabsList.value = [
{
label: '预约信息',
......@@ -1235,6 +1249,17 @@ const showSubmitBtn = computed(() => {
return false
}
})
if (route.query.appointmentNo && route.query.source == 'appointmentList') {
editStatus.value = true
} else if (route.query.source == 'policyList') {
editStatus.value = true
} else if (route.query.source == 'fnaList' && idsObj.value.appointmentBizId) {
editStatus.value = true
} else if (route.query.source == 'fnaList' && !idsObj.value.appointmentBizId) {
editStatus.value = false
}
console.log('editStatus.value ', editStatus.value, idsObj.value)
onUnmounted(() => {
// 彻底重置所有响应式数据
submitAppointmentObj.value = {}
......
......@@ -203,7 +203,7 @@ import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
const router = useRouter()
const { proxy } = getCurrentInstance()
const dialogVisible = ref(true)
const dialogVisible = ref(false)
const appointmentSummeryInfo = ref({})
const tenantList = ref([])
const loading = ref(true)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment