新增子表格显示,解决对象越界问题

This commit is contained in:
cyonjan 2025-07-03 12:23:50 +08:00
parent b43aae4049
commit 64f2dd29f6
3 changed files with 87 additions and 25 deletions

View File

@ -1,5 +1,18 @@
import service from '@/service'
export const supplierList = () => {
return service({
method: 'get',
url: `/member/supplierlist/`,
})
}
export const sellerList = () => {
return service({
method: 'get',
url: '/accessory/sellerlist/'
})
}
export const inquiryFilter = (users,status,days=7) => {
return service({
method: 'get',

View File

@ -39,7 +39,7 @@
</el-table-column>
</el-table>
</el-card>
<el-card shadow="hover" class="p-4">
<el-card shadow="hover" class="p-4 overflow-y-auto" :style="{height: cardHeight + 'px'}">
<div class="grid grid-cols-4 items-center gap-20px">
<a v-for="items in menuItems" :key="items.title" :href="items.url" target="_blank">
<div class="flex flex-col items-center">
@ -141,19 +141,19 @@
const menuItems = ref([
{'title': '批量查件','icon': '批量查件.png','url': 'https://www.jifuyun.cn/sitex/search','_blank': false},
{'title': '查件订单','icon': '查件订单.png','url': 'https://www.jifuyun.cn/ucenterx/preorder','_blank': false},
// {'title': '','icon': '.png','url': 'https://www.jifuyun.cn/ucenterx/preorder','_blank': false},
{'title': '可视检索','icon': '可视检索.png','url': 'https://epc.jifuyun.cn','_blank': false},
{'title': '收藏关注','icon': '收藏关注.png','url': 'https://www.jifuyun.cn/ucenterx/user_cart','_blank': false},
// {'title': '','icon': '.png','url': 'https://www.jifuyun.cn/ucenterx/user_cart','_blank': false},
{'title': '发布闲置','icon': '发布闲置.png','url': 'https://www.jifuyun.cn/sitex/upspareparts','_blank': false},
{'title': '我的设备','icon': '我的设备.png','url': 'https://www.jifuyun.cn/ucenterx/device','_blank': false},
{'title': '附近服务','icon': '附近服务.png','url': 'https://www.jifuyun.cn/sitex/nearest','_blank': false},
// {'title': '','icon': '.png','url': 'https://www.jifuyun.cn/ucenterx/device','_blank': false},
// {'title': '','icon': '.png','url': 'https://www.jifuyun.cn/sitex/nearest','_blank': false},
{'title': '机服云主站','icon': 'jifuyun.cn.png','url': 'https://www.jifuyun.cn','_blank': false},
{'title': '数据后台','icon': '数据处理.png','url': 'https://adm.jifuyun.cn','_blank': false},
{'title': '询盘订单','icon': '预报价单.png','url': 'https://m2.jifuyun.cn','_blank': false},
// {'title': '','icon': '.png','url': 'https://m2.jifuyun.cn','_blank': false},
{'title': '机联商家','icon': '商户管理 (1).png','url': 'https://sh.jifuyun.cn','_blank': false},
{'title': '供应商','icon': '工作台-报价.png','url': 'https://g.jifuyun.cn','_blank': false},
{'title': '可视化检索','icon': '装配工单.png','url': 'https://epc.jifuyun.cn','_blank': false},
{'title': '寻件通','icon': 'aim.png','url': 'https://xjt.jifuyun.cn/admin/index','_blank': false},
// {'title': '','icon': 'aim.png','url': 'https://xjt.jifuyun.cn/admin/index','_blank': false},
{'title': '旧版后台','icon': '系统管理.png','url': 'https://www.jifuyun.cn/admin/index','_blank': false}
])

View File

@ -64,6 +64,7 @@
</el-col>
</el-row>
<!-- @row-click="expandPanel" -->
<el-table
ref="orderTableRef"
:data="order_list"
@ -74,7 +75,6 @@
size="large"
row-class-name="no-expand-icon"
row-key="id"
@row-click="expandPanel"
@expand-change="expandChange"
class="mt-2"
:expand-row-keys="expandRowKeys"
@ -83,30 +83,61 @@
@selection-change="handleTableSelectionChange"
>
<el-table-column type="expand" width="1">
<template #default="{row}">
<div class="w-full p-2 flex justify-center overflow-auto">
<div class="w-full h-230px bg-light-500"></div>
<!-- <el-table
<template #default="{row: order_row}">
<div class="w-full p-2 flex overflow-auto" :class="`h-${subTableHeight}px`">
<el-table
size="small"
fit
:data="row.offer"
:data="order_row.status<=1 ? order_row.goods : order_row.offer"
class="text-xs w-auto"
style="border: 1px solid black;"
:header-cell-style="{background: '#e0f2fe', color: 'black',borderColor: 'black'}"
:cell-style="{borderColor: 'black'}"
:max-height="subTableHeight - 40"
border
>
<el-table-column type="index" label="#" width="50" align="center" header-align="center"/>
<el-table-column prop="brand_name" label="品牌" show-overflow-tooltip width="100" align="center" header-align="center"/>
<el-table-column prop="b_name" label="品牌" show-overflow-tooltip width="100" align="center" header-align="center" v-if="order_row.status <= 1"/>
<el-table-column prop="brand_name" label="品牌" show-overflow-tooltip width="100" align="center" header-align="center" v-if="order_row.status == 3"/>
<el-table-column prop="code" label="件号" show-overflow-tooltip width="120" align="center" header-align="center"/>
<el-table-column prop="new_code" label="更新件号" show-overflow-tooltip width="120" align="center" header-align="center"/>
<el-table-column prop="name" label="品名" show-overflow-tooltip width="120" align="center" header-align="center"/>
<el-table-column prop="market_price" label="面价" show-overflow-tooltip width="100" align="right" header-align="center">
<el-table-column prop="price" label="面价" show-overflow-tooltip width="100" align="right" header-align="center" v-if="order_row.status <= 1">
<template #default="{row}">
{{ (Math.round(row.price * 100) / 100.00).toFixed(2) }}
</template>
</el-table-column>
<el-table-column prop="goods" label="商城状况" show-overflow-tooltip width="120" header-align="center" align="center" v-if="order_row.status <= 1">
<template #default="{row}">
<el-tag v-if="row.goods?.length>0" effect="dark" type="primary">有货({{ row.goods?.length }})</el-tag>
<el-tag v-else effect="dark" type="danger">无货</el-tag>
</template>
</el-table-column>
<el-table-column prop="market_price" label="面价" show-overflow-tooltip width="100" align="right" header-align="center" v-if="order_row.status == 3">
<template #default="{row}">
{{ (Math.round(row.market_price * 100) / 100.00).toFixed(2) }}
</template>
</el-table-column>
<el-table-column prop="store" label="库存数" width="72" align="right" header-align="center"/>
<el-table-column label="供应商采购" width="120" align="center" header-align="center">
<el-table-column prop="sell_price" label="预计售价" show-overflow-tooltip width="100" align="right" header-align="center" v-if="order_row.status <= 1">
<template #default="{row}">
{{ (Math.round(row.sell_price * 100) / 100.00).toFixed(2) }}
</template>
</el-table-column>
<el-table-column prop="sell_price" label="报价" show-overflow-tooltip width="100" align="right" header-align="center" v-if="order_row.status == 3">
<template #default="{row}">
{{ (Math.round(row.sell_price * 100) / 100.00).toFixed(2) }}
</template>
</el-table-column>
<el-table-column prop="sell_price2" label="加急服务" show-overflow-tooltip width="100" align="right" header-align="center" v-if="order_row.status == 3">
<template #default="{row}">
{{ (Math.round(row.sell_price2 * 100) / 100.00).toFixed(2) }}
</template>
</el-table-column>
<el-table-column prop="amount" label="数量" show-overflow-tooltip width="100" align="right" header-align="center"/>
<el-table-column prop="store" label="库存数" width="72" align="right" header-align="center" v-if="order_row.status == 3"/>
<el-table-column prop="note" label="客户备注" show-overflow-tooltip width="140" align="center" header-align="center" v-if="order_row.status <= 1"/>
<el-table-column prop="note" label="报价备注" show-overflow-tooltip width="140" align="center" header-align="center" v-if="order_row.status == 3"/>
<el-table-column label="供应商采购" width="120" align="center" header-align="center" v-if="order_row.status == 3">
<el-table-column prop="selected" label="供应商" show-overflow-tooltip width="120" align="center" header-align="center">
<template #default="{row}">
{{ supplierName(row.selected) }}
@ -117,7 +148,7 @@
{{ parseFloat(row.from[0]) ? parseFloat(row.from[0]).toFixed(2) : 0.00 }}
</template>
</el-table-column>
<el-table-column label="急件价" width="100" align="right" header-align="center">
<el-table-column label="加急服务" width="100" align="right" header-align="center">
<template #default="{row}">
{{ row.from[3] && parseFloat(row.from[3]) ? parseFloat(row.from[3]).toFixed(2) : 0.00 }}
</template>
@ -138,6 +169,8 @@
</template>
</el-table-column>
</el-table-column>
<!--
<el-table-column label="客户销售" header-align="center">
<el-table-column prop="sell_price" label="售价" show-overflow-tooltip width="100" align="right" header-align="center">
<template #default="{row}">
@ -151,8 +184,8 @@
</el-table-column>
<el-table-column prop="amount" label="销售数" width="60" align="right" header-align="center"/>
<el-table-column prop="note" label="备注" show-overflow-tooltip width="80" header-align="center"/>
</el-table-column>
</el-table> -->
</el-table-column> -->
</el-table>
</div>
</template>
</el-table-column>
@ -177,6 +210,12 @@
<el-text size="small" type="primary" tag="b">{{ row.subject }}</el-text>
</template>
</el-table-column>
<el-table-column label="订单商品" header-align="center" width="90px" align="center">
<template #default="{row}">
<el-button v-if="row.goods.length > 0" type="info" size="small" circle @click="expandPanel(row)">{{ row.goods.length }}</el-button>
<el-button v-else type="info" size="small" circle disabled>0</el-button>
</template>
</el-table-column>
<el-table-column prop="note" label="订单备注" show-overflow-tooltip width="200px" header-align="center">
<template #default="{row}">
<el-text size="small" tag="b" type="danger">{{ row.note }}</el-text>
@ -294,7 +333,7 @@
import { useRouter } from 'vue-router'
import dayjs from 'dayjs'
import { ElMessage } from 'element-plus'
import { inquiryList,customerList,inquiryStatus,createInquiry,addInquiryGoods,removeInquiry } from '@/api/inquiry'
import { inquiryList,customerList,inquiryStatus,createInquiry,addInquiryGoods,removeInquiry,supplierList,sellerList } from '@/api/inquiry'
import { status_name } from '@/utils'
import { storeToRefs } from 'pinia'
import { useUserStore,useInquiryListStore } from '@/store'
@ -317,6 +356,7 @@
const background = ref(false)
const workflowDialogVisible = ref(false)
const tableHeight = ref(0)
const subTableHeight = ref(320)
const orderStatus = computed(() => (status,isdel) => status_name(status,isdel))
onMounted(async () => {
@ -326,10 +366,10 @@
customer_list.value = customer.data
}
await get_order_list()
// const {data:supplier} = await supplierList()
// supplier_list.value = supplier.data.map(item => ({id:item.sid,name:item.sname,mobile:item.mobile}))
// const {data:seller} = await sellerList()
// seller_list2.value = seller.data.map(item => ({id:`G${item.id}`,name:`**${item.seller_name}`,mobile:item.mobile}))
const {data:supplier} = await supplierList()
supplier_list.value = supplier.data.map(item => ({id:item.sid,name:item.sname,mobile:item.mobile}))
const {data:seller} = await sellerList()
seller_list2.value = seller.data.map(item => ({id:`G${item.id}`,name:`*商城*${item.seller_name}`,mobile:item.mobile}))
})
const get_order_list = async () => {
@ -473,6 +513,15 @@
</script>
<style scoped>
/* .el-table::before {
height: 0px;
}
.el-table--border::after {
width: 0px;
}
.el-table--border {
border: none;
} */
.el-table .cell {
white-space: pre-wrap;
}