Commit e6f432ad by qinjianhui

fix: 发货单明细加分页

parent 782d121a
...@@ -14,6 +14,7 @@ import { ...@@ -14,6 +14,7 @@ import {
import { import {
DeliveryNoteData, DeliveryNoteData,
DeliveryNoteSearchForm, DeliveryNoteSearchForm,
DetailForm,
ProductionOrder, ProductionOrder,
ShipmentOrderDetailData, ShipmentOrderDetailData,
} from '@/types/api/deliveryNote' } from '@/types/api/deliveryNote'
...@@ -23,6 +24,7 @@ import { ...@@ -23,6 +24,7 @@ import {
BillOrderDetailData, BillOrderDetailData,
ConfirmOrderForm, ConfirmOrderForm,
CountStatus, CountStatus,
LogList,
} from '@/types/api/billOrder' } from '@/types/api/billOrder'
export function getOrderList( export function getOrderList(
...@@ -330,13 +332,17 @@ export function updateReconciliation(data: AccountStatementNote) { ...@@ -330,13 +332,17 @@ export function updateReconciliation(data: AccountStatementNote) {
) )
} }
export function getShipmentDetailsById(shipmentId?: number) { export function getShipmentDetailsById(data: DetailForm) {
return axios.get<never, BaseRespData<BillOrderDetailData>>( return axios.post<never, BasePaginationData<BillOrderDetailData>>(
'reconciliation/getById', 'reconciliation/getItemList',
data,
)
}
export function getLogListApi(id?: number) {
return axios.get<never, BaseRespData<LogList[]>>(
'reconciliation/getLog',
{ {
params: { params: { id },
id: shipmentId,
},
}, },
) )
} }
...@@ -364,7 +370,7 @@ export function confirmOrderApi(data: ConfirmOrderForm) { ...@@ -364,7 +370,7 @@ export function confirmOrderApi(data: ConfirmOrderForm) {
export function rejectOrderApi({ export function rejectOrderApi({
ids, ids,
description, description,
pass pass,
}: { }: {
ids: string ids: string
pass: number pass: number
...@@ -373,6 +379,6 @@ export function rejectOrderApi({ ...@@ -373,6 +379,6 @@ export function rejectOrderApi({
return axios.post<never, BaseRespData<never>>('reconciliation/confirm', { return axios.post<never, BaseRespData<never>>('reconciliation/confirm', {
ids, ids,
description, description,
pass pass,
}) })
} }
...@@ -106,4 +106,8 @@ img { ...@@ -106,4 +106,8 @@ img {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
\ No newline at end of file .table-wrap {
flex: 1;
overflow: hidden;
}
...@@ -15,6 +15,7 @@ export interface AccountStatementNoteSearchForm { ...@@ -15,6 +15,7 @@ export interface AccountStatementNoteSearchForm {
erp_status?: string erp_status?: string
start_time?: string start_time?: string
end_time?: string end_time?: string
order_number?: string
} }
export interface AccountStatementNote { export interface AccountStatementNote {
create_time?: string create_time?: string
......
...@@ -182,3 +182,11 @@ export interface DbFactory { ...@@ -182,3 +182,11 @@ export interface DbFactory {
authorize_number?: number authorize_number?: number
status?: number status?: number
} }
export interface DetailForm {
billNumber?: string
orderNumber?:string
subOrderNumber?: string
rows?: number
page?: number
infoId?: number
}
...@@ -24,25 +24,10 @@ ...@@ -24,25 +24,10 @@
</div> </div>
<div class="right"> <div class="right">
<div class="delivery-note-page flex-column card h-100 overflow-hidden"> <div class="delivery-note-page flex-column card h-100 overflow-hidden">
<splitDiv size="70"> <splitDiv size="50">
<template #top> <template #top>
<div class="header-filter-form"> <div class="header-filter-form">
<ElForm :model="searchForm" inline> <ElForm :model="searchForm" inline>
<!-- <ElFormItem label="客户">
<ElSelect
v-model="searchForm.user_mark"
clearable
placeholder="请选择客户"
style="width: 130px"
>
<ElOption
v-for="item in nameSpaceList"
:key="item"
:label="item"
:value="item"
></ElOption>
</ElSelect>
</ElFormItem> -->
<ElFormItem label="账期"> <ElFormItem label="账期">
<el-date-picker <el-date-picker
v-model="dateRange" v-model="dateRange"
...@@ -60,14 +45,6 @@ ...@@ -60,14 +45,6 @@
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="发货单号">
<ElInput
v-model="searchForm.bill_number"
clearable
placeholder="发货单号"
style="width: 130px"
/>
</ElFormItem>
<ElFormItem label="对账单号"> <ElFormItem label="对账单号">
<ElInput <ElInput
v-model="searchForm.rec_number" v-model="searchForm.rec_number"
...@@ -76,30 +53,22 @@ ...@@ -76,30 +53,22 @@
style="width: 160px" style="width: 160px"
/> />
</ElFormItem> </ElFormItem>
<!-- <ElFormItem label="物流跟踪号"> <ElFormItem label="发货单号">
<ElInput
v-model="searchForm.logisticsTracking"
placeholder="物流跟踪号"
clearable
style="width: 160px"
></ElInput>
</ElFormItem> -->
<!-- <ElFormItem label="物流名称">
<ElInput <ElInput
v-model="searchForm.carriageName" v-model="searchForm.bill_number"
placeholder="物流名称"
clearable clearable
placeholder="发货单号"
style="width: 160px" style="width: 160px"
></ElInput> />
</ElFormItem> --> </ElFormItem>
<!-- <ElFormItem label="收货人"> <ElFormItem style="margin-right: 10px" label="订单号">
<ElInput <ElInput
v-model="searchForm.lanshou_name" v-model="searchForm.order_number"
placeholder="收货人"
clearable clearable
placeholder="订单号"
style="width: 160px" style="width: 160px"
></ElInput> />
</ElFormItem> --> </ElFormItem>
<ElFormItem> <ElFormItem>
<ElButton type="primary" @click="search">查询</ElButton> <ElButton type="primary" @click="search">查询</ElButton>
...@@ -313,81 +282,8 @@ ...@@ -313,81 +282,8 @@
header-align="center" header-align="center"
align="center" align="center"
></ElTableColumn> ></ElTableColumn>
<!-- <ElTableColumn
label="发货数量"
show-overflow-tooltip
prop="shipment_num"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="质检通过总价"
show-overflow-tooltip
prop="total_price"
width="200"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="收货人"
show-overflow-tooltip
width="200"
prop="lanshou_name"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="物流跟踪号"
width="200"
show-overflow-tooltip
prop="logisticsTracking"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="物流名称"
width="200"
show-overflow-tooltip
prop="carriageName"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="收货人电话"
show-overflow-tooltip
prop="lanshouPhone"
header-align="center"
align="center"
width="180"
></ElTableColumn>
<ElTableColumn <ElTableColumn
label="揽收区域"
show-overflow-tooltip
width="200"
prop="lanshouRegion"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="揽收地址"
show-overflow-tooltip
prop="lanshouAddress"
width="200"
header-align="center"
align="center"
></ElTableColumn>
<ElTableColumn
label="揽收邮编"
show-overflow-tooltip
width="200"
prop="lanshouPost"
header-align="center"
align="center"
></ElTableColumn> -->
<ElTableColumn
label="创建时间" label="创建时间"
show-overflow-tooltip show-overflow-tooltip
width="200" width="200"
...@@ -395,27 +291,6 @@ ...@@ -395,27 +291,6 @@
header-align="center" header-align="center"
align="center" align="center"
></ElTableColumn> ></ElTableColumn>
<!-- <ElTableColumn
label="操作"
fixed="right"
header-align="center"
align="center"
prop="operation"
width="80"
>
<template #default="{ row }">
<div>
<ElButton
v-if="nodeId === 1"
type="primary"
link
@click="onEditOrder(row)"
>编辑
</ElButton>
</div>
</template>
</ElTableColumn> -->
</ElTable> </ElTable>
</div> </div>
<ElPagination <ElPagination
...@@ -432,91 +307,137 @@ ...@@ -432,91 +307,137 @@
</div> </div>
</template> </template>
<template #bottom> <template #bottom>
<el-tabs v-model="tabsValue"> <el-tabs v-model="tabsValue" @tab-click="tabsClick">
<el-tab-pane name="0" label="发货单详情"> <el-tab-pane name="0" label="发货单详情">
<ElTable size="small" :data="detailList" height="100%" border> <el-form :model="detailForm" inline>
<ElTableColumn <el-form-item label="发货单号">
show-overflow-tooltip <el-input
width="60" v-model="detailForm.billNumber"
align="center" placeholder="请输入发货单号"
label="序号" clearable
type="index" style="width: 130px"
/> />
<ElTableColumn </el-form-item>
show-overflow-tooltip
align="center" <el-form-item label="订单号">
label="单号" <el-input
prop="factory_order_number" v-model="detailForm.orderNumber"
/> placeholder="请输入订单号"
<!-- <ElTableColumn clearable
style="width: 130px"
/>
</el-form-item>
<el-form-item label="生产单号">
<el-input
v-model="detailForm.subOrderNumber"
placeholder="请输入订单号"
clearable
style="width: 130px"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="searchDetail"
>查询</el-button
>
</el-form-item>
</el-form>
<div class="table-wrap">
<ElTable size="small" :data="detailList" height="100%" border>
<ElTableColumn
show-overflow-tooltip
width="60"
align="center"
label="序号"
type="index"
/>
<ElTableColumn
show-overflow-tooltip
align="center"
label="单号"
prop="factory_order_number"
/>
<!-- <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
label="ERP单号" label="ERP单号"
prop="erp_order_number" prop="erp_order_number"
/> --> /> -->
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
label="发货单号" label="发货单号"
prop="bill_number" prop="bill_number"
/> />
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
label="发货数(件)" label="发货数(件)"
prop="num" prop="num"
/> />
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
label="质检通过(件)" label="质检通过(件)"
prop="pass_num" prop="pass_num"
/> />
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
label="质检不通过(件)" label="质检不通过(件)"
prop="not_pass_num" prop="not_pass_num"
/> />
<!-- <ElTableColumn <!-- <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
label="ERP价格" label="ERP价格"
prop="erp_price" prop="erp_price"
/> --> /> -->
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
label="成本价(¥)" label="成本价(¥)"
prop="price" prop="price"
/> />
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
label="物流价格(¥)" label="物流价格(¥)"
prop="carriage_amount" prop="carriage_amount"
/> />
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
label="发货时间" label="发货时间"
prop="shipment_time" prop="shipment_time"
/> />
<ElTableColumn <ElTableColumn
width="100" width="100"
align="center" align="center"
header-align="center" header-align="center"
label="操作" label="操作"
> >
<template #default="{ row }"> <template #default="{ row }">
<ElButton type="primary" link @click="onDetail(row)" <ElButton type="primary" link @click="onDetail(row)"
>查看详情 >查看详情
</ElButton> </ElButton>
</template> </template>
</ElTableColumn> </ElTableColumn>
</ElTable> </ElTable>
</div>
<ElPagination
v-model:current-page="detailPager.page"
v-model:page-size="detailPager.rows"
:page-sizes="[100, 200, 300, 400]"
background
layout="total, sizes, prev, pager, next, jumper"
:total="detailPager.total"
style="margin: 10px auto 0; text-align: right"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
></ElPagination>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="1" label="操作日志"> <el-tab-pane name="1" label="操作日志">
<ul <ul
...@@ -609,6 +530,7 @@ import { ...@@ -609,6 +530,7 @@ import {
getShipmentOrderDetailById, getShipmentOrderDetailById,
confirmOrderApi, confirmOrderApi,
rejectOrderApi, rejectOrderApi,
getLogListApi,
} from '@/api/order' } from '@/api/order'
import { ref, onMounted, watch, nextTick } from 'vue' import { ref, onMounted, watch, nextTick } from 'vue'
...@@ -620,7 +542,7 @@ import { ...@@ -620,7 +542,7 @@ import {
LogList, LogList,
AccountStatementNoteSearchForm, AccountStatementNoteSearchForm,
} from '@/types/api/billOrder.ts' } from '@/types/api/billOrder.ts'
import { ShipmentOrderDetailData } from '@/types/api/deliveryNote' import { DetailForm, ShipmentOrderDetailData } from '@/types/api/deliveryNote'
import shipmentOrderDetailInfo from '@/components/ShipmentOrderDetail.vue' import shipmentOrderDetailInfo from '@/components/ShipmentOrderDetail.vue'
import ImageView from '@/components/ImageView.vue' import ImageView from '@/components/ImageView.vue'
import { showConfirm } from '@/utils/ui' import { showConfirm } from '@/utils/ui'
...@@ -653,19 +575,6 @@ const logList = ref<LogList[]>([]) ...@@ -653,19 +575,6 @@ const logList = ref<LogList[]>([])
const nodeId = ref<number | string>(10) const nodeId = ref<number | string>(10)
const treeRef = ref<InstanceType<typeof ElTree>>() const treeRef = ref<InstanceType<typeof ElTree>>()
// const editForm = ref<AccountStatementNote>({
// billNumber: '',
// lanshouAddress: '',
// shipmentId: '',
// totalPrice: '',
// shipmentNum: '',
// passNum: '',
// lanshouPost: '',
// lanshouName: '',
// lanshouPhone: '',
// totalAmount: '',
// })
const { const {
currentPage, currentPage,
pageSize, pageSize,
...@@ -714,30 +623,11 @@ const getTreeNum = async () => { ...@@ -714,30 +623,11 @@ const getTreeNum = async () => {
console.error(e) console.error(e)
} }
} }
// const onEditOrder = async (item: AccountStatementNote) => {
// try {
// const res = await getCustomJomallReconciliationById(item.id)
// editForm.value = res.data as never
// dialogVisible.value = true
// } catch (e) {
// // showError(e)
// }
// }
// const submitData = async () => {
// try {
// const res = await updateReconciliation(editForm.value)
// logList.value = res.data as never
// dialogVisible.value = false
// ElMessage.success('修改成功')
// search()
// } catch (e) {
// // showError(e)
// }
// }
const rowClick = (row: AccountStatementNote) => { const rowClick = (row: AccountStatementNote) => {
if (!row) {
currentRow.value = null
}
currentRow.value = row currentRow.value = row
tabsValue.value = '0'
tabsClick() tabsClick()
} }
...@@ -747,12 +637,11 @@ const tabsClick = async () => { ...@@ -747,12 +637,11 @@ const tabsClick = async () => {
logList.value = [] logList.value = []
return return
} }
try { await nextTick()
const res = await getShipmentDetailsById(currentRow.value.id) if (tabsValue.value === '0') {
detailList.value = res.data.itemList || [] searchDetail()
logList.value = res.data.logList || [] } else {
} catch (e) { getLogList()
console.error(e)
} }
} }
const handleSelectionChange = (v: AccountStatementNote[]) => { const handleSelectionChange = (v: AccountStatementNote[]) => {
...@@ -932,6 +821,36 @@ const onDetail = async (row: ItemList) => { ...@@ -932,6 +821,36 @@ const onDetail = async (row: ItemList) => {
console.error(e) console.error(e)
} }
} }
const detailForm = ref({} as DetailForm)
const detailPager = ref({
page: 1,
rows: 100,
total: 0,
})
const searchDetail = async () => {
try {
const res = await getShipmentDetailsById({
...detailForm.value,
page: detailPager.value.page,
rows: detailPager.value.rows,
infoId: currentRow.value?.id,
})
detailList.value = res.data.records || []
detailPager.value.total = res.data.total
// logList.value = res.data.logList || []
} catch (e) {
console.error(e)
}
}
const getLogList = async () => {
try {
const res = await getLogListApi(currentRow.value?.id)
logList.value = res.data
// logList.value = res.data.logList || []
} catch (e) {
console.error(e)
}
}
onMounted(() => { onMounted(() => {
getTreeNum() getTreeNum()
}) })
...@@ -1116,6 +1035,9 @@ $border: solid 1px #ddd; ...@@ -1116,6 +1035,9 @@ $border: solid 1px #ddd;
.el-tab-pane { .el-tab-pane {
height: 100%; height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
} }
} }
} }
......
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