123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <template>
- <Page :title="`${currentRoutingInformation?.name}详情`" styleReset="backNone">
- <template v-slot:body>
- <div class="w-full h-full detailsClass">
- <!-- 商机 -->
- <template v-if="currentRoutingInformation?.key == 'business'">
- <Business :info="queryParameters" />
- </template>
- <!-- 线索 -->
- <template v-if="currentRoutingInformation?.key == 'thread'">
- <Thread :info="queryParameters" />
- </template>
- <!-- 客户 -->
- <template v-if="currentRoutingInformation?.key == 'customer'">
- <Customer :info="queryParameters" />
- </template>
- <!-- 联系人 -->
- <template v-if="currentRoutingInformation?.key == 'contacts'">
- <Contacts :info="queryParameters" />
- </template>
- <!-- 任务 -->
- <template v-if="currentRoutingInformation?.key == 'tasks'">
- <Tasks :info="queryParameters" />
- </template>
- <!-- 产品管理 -->
- <template v-if="currentRoutingInformation?.key == 'product'">
- <Product :info="queryParameters" />
- </template>
- <!-- 合同管理 -->
- <template v-if="currentRoutingInformation?.key == 'contract'">
- <Contract :info="queryParameters" />
- </template>
- <!-- 销售订单 -->
- <template v-if="currentRoutingInformation?.key == 'order'">
- <Order :info="queryParameters" />
- </template>
- </div>
- </template>
- <template v-slot:headerRight>
- <template v-if="currentRoutingInformation?.key == 'tasks'">
- <div class="themeTextColor" @click="jumpEdit()">编辑</div>
- </template>
- </template>
- </Page>
- </template>
- <script setup>
- import { ref } from 'vue';
- import { useLifecycle } from '@hooks/useCommon.js';
- import { resetListData, getListFieldKey } from '@components/common/formForm/formCorrespondenceProcessing'
- import useRouterStore from "@store/useRouterStore.js";
- import useFixedData from "@store/useFixedData.js"
- import Business from "@pages/pageComponents/business/detail.vue"
- import Thread from "@pages/pageComponents/thread/detail.vue"
- import Customer from "@pages/pageComponents/customer/detail.vue"
- import Contacts from "@pages/pageComponents/contacts/detail.vue"
- import Tasks from "@pages/pageComponents/tasks/detail.vue"
- import Product from "@pages/pageComponents/product/detail.vue"
- import Contract from "@pages/pageComponents/contract/detail.vue"
- import Order from "@pages/pageComponents/order/detail.vue"
- const fixedData = useFixedData()
- const router = useRouterStore()
- const queryParameters = ref({})
- const currentRoutingInformation = ref({})
- function reloadListData(data) {
- const { routerInfo = '', parameter = '' } = data
- queryParameters.value = JSON.parse(parameter)
- currentRoutingInformation.value = JSON.parse(routerInfo)
- }
- function jumpEdit() {
- const formJson = fixedData.formJson[currentRoutingInformation.value.key] || []
- const formList = resetListData(formJson?.list)
- const filedObj = getListFieldKey(formList, queryParameters.value)
- const formVal = { ...queryParameters.value, ...filedObj, id: queryParameters.value.id }
- console.log(formVal, '<=== formVal')
- router.navigateTo({
- pathName: 'addEditor',
- success: () => {
- router.emit('addEditorParameter', {
- routerInfo: JSON.stringify(currentRoutingInformation.value),
- filedValue: JSON.stringify(formVal)
- })
- }
- })
- }
- useLifecycle({
- load: () => {
- router.on('detailParameter', (data) => {
- reloadListData(data)
- })
- }
- });
- </script>
- <style lang='scss' scoped>
- .backNone {
- background: linear-gradient(to bottom, #E0EFFF, #F8F8F8 60%) !important;
- :deep(.van-nav-bar) {
- background: none;
- }
- }
- .detailsClass {
- :deep(.van-tabs) {
- height: 100%;
- display: flex;
- flex-direction: column;
- }
- :deep(.van-tabs__content) {
- flex: 1;
- overflow: hidden;
- }
- :deep(.van-tab__panel) {
- height: 100%;
- }
- :deep(.van-tabs__nav) {
- background: none;
- }
- }
- </style>
|