订单列表
parent
8894d0bb48
commit
045d327230
|
|
@ -19,7 +19,7 @@ interface ADetailPanelType<D extends object> {
|
|||
}
|
||||
|
||||
const component = defineComponent(
|
||||
<T extends object & { id?: string }, D extends object>(props: ADetailPanelType<D>, {slots, expose}: SetupContext) => {
|
||||
<D extends object>(props: ADetailPanelType<D>, {slots, expose}: SetupContext) => {
|
||||
|
||||
const showDialog = ref(false)
|
||||
const loading = ref(false)
|
||||
|
|
@ -28,10 +28,10 @@ const component = defineComponent(
|
|||
const dialogCloseHandler = () => {
|
||||
detailData.$reset()
|
||||
}
|
||||
const open = (data: T) => {
|
||||
const open = (id: string) => {
|
||||
showDialog.value = true
|
||||
loading.value = true
|
||||
props.detailsLoader(data.id!)
|
||||
props.detailsLoader(id)
|
||||
.then(res => {
|
||||
detailData.$reset((res?.data ?? {}) as any)
|
||||
})
|
||||
|
|
@ -70,8 +70,8 @@ const component = defineComponent(
|
|||
},
|
||||
)
|
||||
|
||||
export interface ADetailPanelInstance<T extends object & { id?: string }> extends InstanceType<typeof component> {
|
||||
open: (data: T) => void
|
||||
export interface ADetailPanelInstance extends InstanceType<typeof component> {
|
||||
open: (id: string) => void
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -623,6 +623,8 @@ const component = defineComponent(
|
|||
class="data-table"
|
||||
span-method={props.table.spanMethod}
|
||||
onSort-change={sortChangeHandler}
|
||||
summary-method={props.table.summaryMethod}
|
||||
show-summary={props.table.summaryMethod != null}
|
||||
>
|
||||
{
|
||||
slots.columns?.()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
import type { TableColumnCtx } from 'element-plus'
|
||||
import type { DefaultRow } from 'element-plus/es/components/table/src/table/defaults'
|
||||
|
||||
export interface SummaryMethodProps<T extends object> {
|
||||
columns: TableColumnCtx<T>[]
|
||||
data: T[]
|
||||
}
|
||||
|
||||
export type SummariesType<T extends object> = {
|
||||
[key in keyof T]?: (data: T[]) => string
|
||||
} & {
|
||||
[key: string]: (data: T[]) => string
|
||||
}
|
||||
|
||||
export default function buildSummaryMethod<T extends DefaultRow>(summaries: SummariesType<T>) {
|
||||
return ({columns, data}: SummaryMethodProps<T>) => {
|
||||
const summary: string[] = [ '合计' ]
|
||||
for (let i = 1; i < columns.length; i++) {
|
||||
const column = columns[i]
|
||||
summary[i] = summaries[column.property]?.(data) ?? ''
|
||||
}
|
||||
return summary
|
||||
}
|
||||
}
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
</ElFormItem>
|
||||
</template>
|
||||
<template #columns>
|
||||
<ElTableColumn fixed="left" label="订单编号" prop="sn" width="140"/>
|
||||
<ElTableColumn fixed="left" label="订单编号" prop="sn" width="155"/>
|
||||
<ElTableColumn label="客户姓名" prop="contacts" width="100"/>
|
||||
<ElTableColumn label="客户电话" prop="phone" width="120"/>
|
||||
<ElTableColumn label="货品名称" prop="goodsName" width="120"/>
|
||||
|
|
@ -57,21 +57,38 @@
|
|||
<ElTableColumn label="运输单位" prop="transOrgName" show-overflow-tooltip width="100"/>
|
||||
<ElTableColumn label="运距" prop="transDistance" width="100">
|
||||
<template #default="{row}">
|
||||
{{ `${row.transDistance == null ? '' : row.transDistance + ' 公里'}` }}
|
||||
{{ `${row.transDistance == null ? '' : (row.transDistance / 1000) + ' 公里'}` }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
|
||||
<ElTableColumn label="车次" prop="trainNum" width="70"/>
|
||||
<ElTableColumn label="车牌号" prop="truckLicensePlate" width="120"/>
|
||||
<ElTableColumn label="司机姓名" prop="driverName" width="100"/>
|
||||
<ElTableColumn label="司机电话" prop="driverPhone" width="120"/>
|
||||
<ElTableColumn label="下单时间" prop="orderTime" width="175"/>
|
||||
<ElTableColumn fixed="right" label="支付状态" prop="paymentStatusTxt" width="90">
|
||||
<ElTableColumn label="车牌号" prop="truckLicensePlate" width="120">
|
||||
<template #default="{row}">
|
||||
<ElTag :data-cs="paymentStatusColor.cs(row.paymentStatus)"> {{ row.paymentStatusTxt }}</ElTag>
|
||||
{{ Strings.isBlank(row.truckLicensePlate) ? '-' : row.truckLicensePlate }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn fixed="right" label="订单状态" prop="transStatus" width="90">
|
||||
<ElTableColumn label="司机姓名" prop="driverName" width="100">
|
||||
<template #default="{row}">
|
||||
{{ row.driverName ?? '-' }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="司机电话" prop="driverPhone" width="120">
|
||||
<template #default="{row}">
|
||||
{{ row.driverPhone ?? '-' }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn fixed="right" label="总金额" prop="settleMoney" width="80">
|
||||
<template #default="{row}">
|
||||
{{ `${row.settleMoney == null ? '' : row.settleMoney + ' 元'}` }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="下单时间" prop="orderTime" width="175"/>
|
||||
<ElTableColumn fixed="right" label="支付状态" prop="paymentStatusTxt" width="120">
|
||||
<template #default="{row}">
|
||||
<ElTag :data-cs="paymentStatusColor.cs(row.paymentStatus,'info')"> {{ row.paymentStatusTxt ?? '暂无支付信息' }}</ElTag>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn fixed="right" label="运输状态" prop="transStatus" width="90">
|
||||
<template #default="{row}">
|
||||
<ElTag :data-cs="transStatusColor.cs(row.transStatus)"> {{ row.transStatusTxt }}</ElTag>
|
||||
</template>
|
||||
|
|
@ -79,7 +96,7 @@
|
|||
</template>
|
||||
<BookForm ref="bookForm" :research="research"/>
|
||||
<BookDetail ref="bookDetail"/>
|
||||
<DispatchForm ref="dispatchForm"/>
|
||||
<DispatchForm ref="dispatchForm" @succ="research"/>
|
||||
</ATablePage>
|
||||
</template>
|
||||
|
||||
|
|
@ -100,9 +117,10 @@ import BookDetail from '@/pages/order/book/BookDetail.vue'
|
|||
import type { R } from '@/common/utils/http-util.ts'
|
||||
import DispatchForm from '@/pages/order/book/DispatchForm.vue'
|
||||
import OrderApi from '@/pages/order/order-api.ts'
|
||||
import Strings from '@/common/utils/strings.ts'
|
||||
|
||||
const props = defineProps<{
|
||||
defaultOrderCategory: 'XiaoShou' | 'HuiShou' | 'DuanBo'
|
||||
bizType: 'XiaoShou' | 'HuiShou' | 'DuanBo'
|
||||
}>()
|
||||
|
||||
const tablePageIns = useTemplateRef<ATablePageInstance>('tablePage')
|
||||
|
|
@ -122,7 +140,8 @@ const tablePageProps = buildTablePageProps<OrderTypes.SearchOrderParam, OrderTyp
|
|||
},
|
||||
searchForm: {
|
||||
defaultData: {
|
||||
bizType: props.defaultOrderCategory,
|
||||
bizType: props.bizType,
|
||||
orderType: 'YuYue',
|
||||
},
|
||||
highForm: {
|
||||
contentWidth: 342,
|
||||
|
|
@ -143,9 +162,12 @@ const tablePageProps = buildTablePageProps<OrderTypes.SearchOrderParam, OrderTyp
|
|||
record.transRecodes = undefined
|
||||
for (let i = 0; i < transRecodes.length; i++) {
|
||||
const it = transRecodes[i]
|
||||
const settleMoney = it.paymentRecords?.map(it1 => +(it1.settleMoney ?? 0)).reduce((a: number, b: number) => a + b, 0) ?? 0
|
||||
dataList.push({
|
||||
...record,
|
||||
...it,
|
||||
settleMoney,
|
||||
orderId: record.id,
|
||||
rowCount: i === 0 ? transRecodes.length : 0,
|
||||
} as OrderTypes.TableData)
|
||||
}
|
||||
|
|
@ -185,7 +207,6 @@ const tablePageProps = buildTablePageProps<OrderTypes.SearchOrderParam, OrderTyp
|
|||
icon: 'Postcard',
|
||||
type: 'primary',
|
||||
action({row}) {
|
||||
console.log(row)
|
||||
bookDetailIns.value?.open(row)
|
||||
},
|
||||
},
|
||||
|
|
@ -198,7 +219,7 @@ const tablePageProps = buildTablePageProps<OrderTypes.SearchOrderParam, OrderTyp
|
|||
icon: 'Position',
|
||||
action({row}) {
|
||||
dispatchFormIns.value?.open({
|
||||
orderId: row.id,
|
||||
orderId: row.orderId,
|
||||
sn: row.sn,
|
||||
transOrgId: row.transOrgId,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -44,9 +44,21 @@
|
|||
<ElDescriptionsItem :span="1">
|
||||
<TransRecode :trans-recodes="detailData.transRecodes" v-bind="transRecodeProps">
|
||||
<ElTableColumn label="车次" prop="trainNum"/>
|
||||
<ElTableColumn label="司机姓名" prop="driverName"/>
|
||||
<ElTableColumn label="司机电话" prop="driverPhone"/>
|
||||
<ElTableColumn label="车牌号" prop="truckLicensePlate"/>
|
||||
<ElTableColumn label="司机姓名" prop="driverName">
|
||||
<template #default="{row}">
|
||||
<span> {{ row.driverName ?? '-' }}</span>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="司机电话" prop="driverPhone">
|
||||
<template #default="{row}">
|
||||
<span> {{ row.driverName ?? '-' }}</span>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="车牌号" prop="truckLicensePlate">
|
||||
<template #default="{row}">
|
||||
<span> {{ row.truckLicensePlate ?? '-' }}</span>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn fixed="right" label="运输状态" prop="transStatusTxt" width="100">
|
||||
<template #default="{row}">
|
||||
<ElTag :data-cs="transStatusColor.cs(row.transStatus)"> {{ row.transStatusTxt }}</ElTag>
|
||||
|
|
@ -56,7 +68,7 @@
|
|||
<template #default="{row}">
|
||||
<div class="action-btn">
|
||||
<ElTooltip content="派单" placement="top">
|
||||
<ElButton :disabled="!Strings.isBlank(row.driverName)" :icon="elIcons.Position" class="icon-btn" plain type="primary" @click="dispatch(detailData, row.id, row.trainNum)"/>
|
||||
<ElButton :disabled="row.transStatus !== transStatus.DaiPaiDan" :icon="elIcons.Position" class="icon-btn" plain type="primary" @click="dispatch(detailData, row.id, row.trainNum)"/>
|
||||
</ElTooltip>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -67,7 +79,7 @@
|
|||
</template>
|
||||
<template #footer="detailData">
|
||||
<ElButton :disabled="transRecodeProps.moduleValue.length < 1 " type="primary" @click="dispatch(detailData)">派单</ElButton>
|
||||
<DispatchForm ref="dispatchForm"/>
|
||||
<DispatchForm ref="dispatchForm" @succ="succ"/>
|
||||
</template>
|
||||
</ADetailPanel>
|
||||
</template>
|
||||
|
|
@ -79,14 +91,17 @@ import ADetailPanel, {
|
|||
} from '@/components/a-detail-panel/ADetailPanel.tsx'
|
||||
import TransRecode, { buildTransRecodeProps } from '@/pages/order/trans-recode/TransRecode.tsx'
|
||||
import DispatchForm from '@/pages/order/book/DispatchForm.vue'
|
||||
import { transStatusColor } from '@/pages/order/constants.ts'
|
||||
import {
|
||||
transStatus,
|
||||
transStatusColor,
|
||||
} from '@/pages/order/constants.ts'
|
||||
import { elIcons } from '@/common/element/element.ts'
|
||||
import Strings from '@/common/utils/strings.ts'
|
||||
import OrderApi from '@/pages/order/order-api.ts'
|
||||
|
||||
const detailPanelIns = useTemplateRef<ADetailPanelInstance<OrderTypes.TableData>>('detailPanel')
|
||||
const detailPanelIns = useTemplateRef<ADetailPanelInstance>('detailPanel')
|
||||
const dispatchFormIns = useTemplateRef<InstanceType<typeof DispatchForm>>('dispatchForm')
|
||||
|
||||
let orderId = ''
|
||||
const transRecodeProps = buildTransRecodeProps({
|
||||
moduleValue: [],
|
||||
selectable: true,
|
||||
|
|
@ -97,7 +112,7 @@ const transRecodeProps = buildTransRecodeProps({
|
|||
|
||||
function dispatch(data: OrderTypes.SearchOrderResult, transId?: string, trainNum?: number) {
|
||||
dispatchFormIns.value?.open({
|
||||
orderId: data.id,
|
||||
// orderId: data.id,
|
||||
sn: data.sn,
|
||||
transIds: transId == null ? transRecodeProps.moduleValue : [ transId ],
|
||||
transOrgId: data.transOrgId,
|
||||
|
|
@ -105,14 +120,21 @@ function dispatch(data: OrderTypes.SearchOrderResult, transId?: string, trainNum
|
|||
})
|
||||
}
|
||||
|
||||
function succ() {
|
||||
detailPanelIns.value?.open(orderId)
|
||||
}
|
||||
|
||||
const detailPanelProps = buildDetailPanelProps<OrderTypes.SearchOrderResult>({
|
||||
title: '订单详情',
|
||||
width: '80vw',
|
||||
detailsLoader: OrderApi.detail,
|
||||
detailsLoader(id) {
|
||||
return OrderApi.detail(id, 'YuYue')
|
||||
},
|
||||
})
|
||||
defineExpose({
|
||||
open(data: OrderTypes.TableData) {
|
||||
detailPanelIns.value?.open(data)
|
||||
orderId = data.orderId!
|
||||
detailPanelIns.value?.open(data.orderId!)
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ let transOrgId = ref<string | undefined>(undefined)
|
|||
let sn = ref<string | undefined>(undefined)
|
||||
let trainNum = ref<number | undefined>(undefined)
|
||||
|
||||
const emits = defineEmits([ 'succ' ])
|
||||
const formPanelProps = buildFormPanelProps<OrderTypes.DispatchParam>({
|
||||
title: '派单',
|
||||
labelWidth: '0',
|
||||
|
|
@ -21,12 +22,14 @@ const formPanelProps = buildFormPanelProps<OrderTypes.DispatchParam>({
|
|||
return Promise.resolve({})
|
||||
},
|
||||
doSubmit(data) {
|
||||
return OrderApi.dispatch({
|
||||
orderId: orderId!,
|
||||
transIds: transIds!,
|
||||
return OrderApi.assignmentDriver({
|
||||
orderId: orderId,
|
||||
orderTransId: transIds,
|
||||
driverId: data.driverId,
|
||||
})
|
||||
.then(() => true)
|
||||
.then(() => {
|
||||
emits('succ')
|
||||
})
|
||||
},
|
||||
rules: () => {
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import Book from '@/pages/order/book/Book.vue'
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<Book default-order-category="XiaoShou"/>
|
||||
<Book biz-type="XiaoShou"/>
|
||||
</template>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import Book from '@/pages/order/book/Book.vue'
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<Book default-order-category="HuiShou"/>
|
||||
<Book biz-type="HuiShou"/>
|
||||
</template>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@
|
|||
</ElFormItem>
|
||||
</template>
|
||||
<template #columns>
|
||||
<ElTableColumn fixed="left" label="订单编号" prop="sn" width="140"/>
|
||||
<!-- <ElTableColumn label="下单时间" prop="orderTime"/> -->
|
||||
<!-- <ElTableColumn label="客户姓名" prop="contacts"/> -->
|
||||
<!-- <ElTableColumn label="联系方式" prop="phone"/> -->
|
||||
<ElTableColumn fixed="left" label="订单编号" prop="sn" width="155"/>
|
||||
<ElTableColumn label="下单时间" prop="orderTime"/>
|
||||
<ElTableColumn label="客户姓名" prop="contacts"/>
|
||||
<ElTableColumn label="联系方式" prop="phone"/>
|
||||
<ElTableColumn label="货品名称" prop="goodsName"/>
|
||||
|
||||
<!-- <ElTableColumn label="项目名称" show-overflow-tooltip width="100">
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
<!-- <ElTableColumn label="司机姓名" prop="driverName"/> -->
|
||||
<!-- <ElTableColumn label="司机电话" prop="driverPhone"/> -->
|
||||
|
||||
<ElTableColumn label="毛重" prop="roughWeight">
|
||||
<!-- <ElTableColumn label="毛重" prop="roughWeight">
|
||||
<template #default="{row}">
|
||||
{{ `${row.roughWeight == null ? '' : row.roughWeight + ' 吨'}` }}
|
||||
</template>
|
||||
|
|
@ -70,16 +70,16 @@
|
|||
<template #default="{row}">
|
||||
{{ `${row.settleWeight == null ? '' : row.settleWeight + ' 吨'}` }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="进场时间" prop="inTime" width="175"/>
|
||||
</ElTableColumn> -->
|
||||
<!-- <ElTableColumn label="进场时间" prop="inTime" width="175"/> -->
|
||||
<!-- <ElTableColumn label="开始运输时间" prop="transTime"/> -->
|
||||
<ElTableColumn label="出场时间" prop="outTime" width="175"/>
|
||||
<!-- <ElTableColumn label="出场时间" prop="outTime" width="175"/> -->
|
||||
<!-- <ElTableColumn label="完结时间" prop="finishTime"/> -->
|
||||
<ElTableColumn fixed="right" label="支付状态" prop="paymentStatusTxt" width="90">
|
||||
<!-- <ElTableColumn fixed="right" label="支付状态" prop="paymentStatusTxt" width="120">
|
||||
<template #default="{row}">
|
||||
<ElTag :data-cs="paymentStatusColor.cs(row.paymentStatus)"> {{ row.paymentStatusTxt }}</ElTag>
|
||||
<ElTag :data-cs="paymentStatusColor.cs(row.paymentStatus,'info')"> {{ row.paymentStatusTxt ?? '暂无支付信息' }}</ElTag>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
</ElTableColumn>-->
|
||||
<ElTableColumn fixed="right" label="勘料状态" prop="checkStatusTxt" width="90">
|
||||
<template #default="{row}">
|
||||
<ElTag :data-cs="checkStatusColor.cs(row.checkStatus)"> {{ row.checkStatusTxt }}</ElTag>
|
||||
|
|
@ -105,16 +105,16 @@ import ATablePage, {
|
|||
} from '@/components/a-page/a-table-page/ATablePage.tsx'
|
||||
import {
|
||||
checkStatusColor,
|
||||
paymentStatusColor,
|
||||
transStatusColor,
|
||||
} from '@/pages/order/constants.ts'
|
||||
import { useTemplateRef } from 'vue'
|
||||
import type { R } from '@/common/utils/http-util.ts'
|
||||
import HistoryDetail from '@/pages/order/history/HistoryDetail.vue'
|
||||
import CancelDetail from '@/pages/order/cancel/CancelDetail.vue'
|
||||
import OrderApi from '@/pages/order/order-api.ts'
|
||||
|
||||
const props = defineProps<{
|
||||
defaultOrderCategory: 'XiaoShou' | 'HuiShou' | 'DuanBo'
|
||||
bizType: 'XiaoShou' | 'HuiShou' | 'DuanBo'
|
||||
}>()
|
||||
const tablePageIns = useTemplateRef<ATablePageInstance>('tablePage')
|
||||
const cancelDetailIns = useTemplateRef<InstanceType<typeof HistoryDetail>>('cancelDetail')
|
||||
|
|
@ -132,12 +132,13 @@ const tablePageProps = buildTablePageProps<OrderTypes.SearchOrderParam, OrderTyp
|
|||
},
|
||||
searchForm: {
|
||||
defaultData: {
|
||||
orderCategory: props.defaultOrderCategory,
|
||||
bizType: props.bizType,
|
||||
orderType: 'QuXiao',
|
||||
},
|
||||
highForm: {
|
||||
contentWidth: 342,
|
||||
},
|
||||
/* paging(param: OrderTypes.SearchOrderParam) {
|
||||
paging(param: OrderTypes.SearchOrderParam) {
|
||||
return OrderApi.paging(param)
|
||||
.then(res => {
|
||||
const records = res.data.records
|
||||
|
|
@ -151,93 +152,13 @@ const tablePageProps = buildTablePageProps<OrderTypes.SearchOrderParam, OrderTyp
|
|||
dataList.push({
|
||||
...record,
|
||||
...it,
|
||||
orderId: record.id,
|
||||
rowCount: i === 0 ? transRecodes.length : 0,
|
||||
} as OrderTypes.TableData)
|
||||
}
|
||||
}
|
||||
return res as R<G.PageResult<OrderTypes.TableData>>
|
||||
})
|
||||
}, */
|
||||
paging(param: OrderTypes.SearchOrderParam) {
|
||||
return Promise.resolve({
|
||||
code: 200,
|
||||
data: {
|
||||
current: param.current,
|
||||
size: param.size,
|
||||
total: 100,
|
||||
records: [
|
||||
{
|
||||
rowCount: 3,
|
||||
id: '123',
|
||||
sn: '202308240001',
|
||||
orderTime: '2023-08-24 10:00:00',
|
||||
contacts: '张三',
|
||||
phone: '13800000000',
|
||||
projectName: '项目A',
|
||||
stationName: '站点B',
|
||||
goodsName: '商品X',
|
||||
unit: '吨',
|
||||
customerMemo: '客户备注',
|
||||
estimatedQuantity: 100,
|
||||
estimatedTrainNum: 2,
|
||||
transDistance: 500,
|
||||
orderCategoryTxt: '订单类型A',
|
||||
transStatusTxt: '已进场',
|
||||
transStatus: 'YiJinChang',
|
||||
checkStatus: 'YiKanLiao',
|
||||
checkStatusTxt: '未勘料',
|
||||
paymentStatusTxt: '未支付',
|
||||
truckLicensePlate: '苏A9B905',
|
||||
},
|
||||
{
|
||||
rowCount: 0,
|
||||
id: '123',
|
||||
sn: '202308240001',
|
||||
orderTime: '2023-08-24 10:00:00',
|
||||
contacts: '张三',
|
||||
phone: '13800000000',
|
||||
projectName: '项目A',
|
||||
stationName: '站点B',
|
||||
goodsName: '商品X',
|
||||
unit: '吨',
|
||||
customerMemo: '客户备注',
|
||||
estimatedQuantity: 100,
|
||||
estimatedTrainNum: 2,
|
||||
transDistance: 500,
|
||||
orderCategoryTxt: '订单类型A',
|
||||
transStatusTxt: '运输中',
|
||||
transStatus: 'YunShuZhong',
|
||||
checkStatus: 'WeiKanLiao',
|
||||
checkStatusTxt: '未勘料',
|
||||
paymentStatusTxt: '未支付',
|
||||
truckLicensePlate: '苏A9B905',
|
||||
},
|
||||
{
|
||||
rowCount: 0,
|
||||
id: '123',
|
||||
sn: '202308240001',
|
||||
orderTime: '2023-08-24 10:00:00',
|
||||
contacts: '张三',
|
||||
phone: '13800000000',
|
||||
projectName: '项目A',
|
||||
stationName: '站点B',
|
||||
goodsName: '商品X',
|
||||
unit: '吨',
|
||||
customerMemo: '客户备注',
|
||||
estimatedQuantity: 100,
|
||||
estimatedTrainNum: 2,
|
||||
transDistance: 500,
|
||||
orderCategoryTxt: '订单类型A',
|
||||
transStatusTxt: '已进场',
|
||||
transStatus: 'YiJinChang',
|
||||
checkStatus: 'WeiKanLiao',
|
||||
checkStatusTxt: '未勘料',
|
||||
paymentStatusTxt: '未支付',
|
||||
truckLicensePlate: '苏A9B905',
|
||||
},
|
||||
] as OrderTypes.TableData[],
|
||||
},
|
||||
} as R<G.PageResult<OrderTypes.TableData>>)
|
||||
},
|
||||
},
|
||||
table: {
|
||||
|
|
|
|||
|
|
@ -72,9 +72,9 @@
|
|||
{{ `${row.settleMoney == null ? '' : '¥:' + row.settleMoney + '元'}` }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn fixed="right" label="支付状态" prop="paymentStatusTxt" width="90">
|
||||
<ElTableColumn fixed="right" label="支付状态" prop="paymentStatusTxt" width="120">
|
||||
<template #default="{row}">
|
||||
<ElTag :data-cs="paymentStatusColor.cs(row.paymentStatus)"> {{ row.paymentStatusTxt }}</ElTag>
|
||||
<ElTag :data-cs="paymentStatusColor.cs(row.paymentStatus,'info')"> {{ row.paymentStatusTxt ?? '暂无支付信息' }}</ElTag>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn fixed="right" label="勘料状态" prop="checkStatusTxt" width="90">
|
||||
|
|
@ -132,14 +132,16 @@ import Strings from '@/common/utils/strings.ts'
|
|||
import AIcon from '@/components/a-icon/AIcon.vue'
|
||||
import OrderApi from '@/pages/order/order-api.ts'
|
||||
|
||||
const detailPanelIns = useTemplateRef<ADetailPanelInstance<OrderTypes.TableData>>('detailPanel')
|
||||
const detailPanelIns = useTemplateRef<ADetailPanelInstance>('detailPanel')
|
||||
|
||||
const transRecodeProps = buildTransRecodeProps({})
|
||||
|
||||
const detailPanelProps = buildDetailPanelProps<OrderTypes.SearchOrderResult>({
|
||||
title: '订单详情',
|
||||
width: '80vw',
|
||||
detailsLoader: OrderApi.detail,
|
||||
detailsLoader(id) {
|
||||
return OrderApi.detail(id, 'QuXiao')
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
|
@ -158,7 +160,7 @@ function kanliao(data: OrderTypes.TransRecode) {
|
|||
|
||||
defineExpose({
|
||||
open(data: OrderTypes.TableData) {
|
||||
detailPanelIns.value?.open(data)
|
||||
detailPanelIns.value?.open(data.orderId!)
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import Cancel from '@/pages/order/cancel/Cancel.vue'
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<Cancel default-order-category="XiaoShou"/>
|
||||
<Cancel biz-type="XiaoShou"/>
|
||||
</template>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import Cancel from '@/pages/order/cancel/Cancel.vue'
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<Cancel default-order-category="HuiShou"/>
|
||||
<Cancel biz-type="HuiShou"/>
|
||||
</template>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { createEnum } from '@/common/utils/enums.ts'
|
||||
import type { ColorSchemeType } from '@/common/utils/color-schemes.ts'
|
||||
import buildSummaryMethod, { type SummariesType } from '@/components/a-page/a-table-page/build-summary-method.ts'
|
||||
|
||||
const orderCategoryList = [
|
||||
{
|
||||
|
|
@ -165,3 +166,27 @@ export const paymentStatusColor: {
|
|||
return defaultColorScheme
|
||||
},
|
||||
}
|
||||
|
||||
export const summaries: SummariesType<any> = {
|
||||
roughWeight(data) {
|
||||
const summaryResult = data.map(it => +(it.roughWeight ?? 0)).reduce((a, b) => (a + b), 0)
|
||||
return summaryResult == null ? '-' : (summaryResult / 1000) + ' 吨'
|
||||
},
|
||||
tareWeight(data) {
|
||||
const summaryResult = data.map(it => +(it.tareWeight ?? 0)).reduce((a, b) => (a + b), 0)
|
||||
return summaryResult == null ? '-' : (summaryResult / 1000) + ' 吨'
|
||||
},
|
||||
settleWeight(data) {
|
||||
const summaryResult = data.map(it => +(it.settleWeight ?? 0)).reduce((a, b) => (a + b), 0)
|
||||
return summaryResult == null ? '-' : (summaryResult / 1000) + ' 吨'
|
||||
},
|
||||
settleMoney(data) {
|
||||
const summaryResult = data
|
||||
.map(it => it
|
||||
.paymentRecords?.map((it1: any) => +(it1.settleMoney ?? 0))
|
||||
.reduce((a: number, b: number) => (a + b), 0) ?? 0,
|
||||
).reduce((a, b) => (a + b), 0)
|
||||
return summaryResult == null ? '-' : summaryResult + ' 元'
|
||||
},
|
||||
}
|
||||
export const summaryMethod = buildSummaryMethod(summaries)
|
||||
|
|
|
|||
|
|
@ -36,12 +36,16 @@
|
|||
</ElFormItem>
|
||||
</template>
|
||||
<template #columns>
|
||||
<ElTableColumn fixed="left" label="订单编号" prop="sn" width="140"/>
|
||||
<ElTableColumn fixed="left" label="订单编号" prop="sn" width="155"/>
|
||||
<!-- <ElTableColumn label="下单时间" prop="orderTime"/> -->
|
||||
<!-- <ElTableColumn label="客户姓名" prop="contacts"/> -->
|
||||
<!-- <ElTableColumn label="联系方式" prop="phone"/> -->
|
||||
<ElTableColumn label="货品名称" prop="goodsName"/>
|
||||
|
||||
<ElTableColumn label="货品名称" prop="goodsName" width="120"/>
|
||||
<ElTableColumn label="运距" prop="transDistance" width="100">
|
||||
<template #default="{row}">
|
||||
{{ `${row.transDistance == null ? '' : (row.transDistance / 1000) + ' 公里'}` }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<!-- <ElTableColumn label="项目名称" show-overflow-tooltip width="100">
|
||||
<template #default="{row}">
|
||||
{{ row.projectName ?? '-' }}
|
||||
|
|
@ -56,28 +60,33 @@
|
|||
<!-- <ElTableColumn label="司机姓名" prop="driverName"/> -->
|
||||
<!-- <ElTableColumn label="司机电话" prop="driverPhone"/> -->
|
||||
|
||||
<ElTableColumn label="毛重" prop="roughWeight">
|
||||
<ElTableColumn label="毛重" prop="roughWeight" width="80">
|
||||
<template #default="{row}">
|
||||
{{ `${row.roughWeight == null ? '' : row.roughWeight + ' 吨'}` }}
|
||||
{{ `${row.roughWeight == null ? '' : (row.roughWeight / 1000) + ' 吨'}` }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="皮重" prop="tareWeight">
|
||||
<ElTableColumn label="皮重" prop="tareWeight" width="80">
|
||||
<template #default="{row}">
|
||||
{{ `${row.tareWeight == null ? '' : row.tareWeight + ' 吨'}` }}
|
||||
{{ `${row.tareWeight == null ? '' : (row.tareWeight / 1000) + ' 吨'}` }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="净重" prop="settleWeight">
|
||||
<ElTableColumn label="净重" prop="settleWeight" width="80">
|
||||
<template #default="{row}">
|
||||
{{ `${row.settleWeight == null ? '' : row.settleWeight + ' 吨'}` }}
|
||||
{{ `${row.settleWeight == null ? '' : (row.settleWeight / 1000) + ' 吨'}` }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="进场时间" prop="inTime" width="175"/>
|
||||
<!-- <ElTableColumn label="开始运输时间" prop="transTime"/> -->
|
||||
<ElTableColumn label="出场时间" prop="outTime" width="175"/>
|
||||
<!-- <ElTableColumn label="完结时间" prop="finishTime"/> -->
|
||||
<ElTableColumn fixed="right" label="支付状态" prop="paymentStatusTxt" width="90">
|
||||
<ElTableColumn fixed="right" label="总金额" prop="settleMoney" width="80">
|
||||
<template #default="{row}">
|
||||
<ElTag :data-cs="paymentStatusColor.cs(row.paymentStatus)"> {{ row.paymentStatusTxt }}</ElTag>
|
||||
{{ `${row.settleMoney == null ? '' : row.settleMoney + ' 元'}` }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn fixed="right" label="支付状态" prop="paymentStatusTxt" width="120">
|
||||
<template #default="{row}">
|
||||
<ElTag :data-cs="paymentStatusColor.cs(row.paymentStatus,'info')"> {{ row.paymentStatusTxt ?? '暂无支付信息' }}</ElTag>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn fixed="right" label="勘料状态" prop="checkStatusTxt" width="90">
|
||||
|
|
@ -106,14 +115,16 @@ import ATablePage, {
|
|||
import {
|
||||
checkStatusColor,
|
||||
paymentStatusColor,
|
||||
summaryMethod,
|
||||
transStatusColor,
|
||||
} from '@/pages/order/constants.ts'
|
||||
import { useTemplateRef } from 'vue'
|
||||
import type { R } from '@/common/utils/http-util.ts'
|
||||
import HistoryDetail from '@/pages/order/history/HistoryDetail.vue'
|
||||
import OrderApi from '@/pages/order/order-api.ts'
|
||||
|
||||
const props = defineProps<{
|
||||
defaultOrderCategory: 'XiaoShou' | 'HuiShou' | 'DuanBo'
|
||||
bizType: 'XiaoShou' | 'HuiShou' | 'DuanBo'
|
||||
}>()
|
||||
const tablePageIns = useTemplateRef<ATablePageInstance>('tablePage')
|
||||
const historyDetailIns = useTemplateRef<InstanceType<typeof HistoryDetail>>('historyDetail')
|
||||
|
|
@ -131,12 +142,13 @@ const tablePageProps = buildTablePageProps<OrderTypes.SearchOrderParam, OrderTyp
|
|||
},
|
||||
searchForm: {
|
||||
defaultData: {
|
||||
orderCategory: props.defaultOrderCategory,
|
||||
bizType: props.bizType,
|
||||
orderType: 'LiShi',
|
||||
},
|
||||
highForm: {
|
||||
contentWidth: 342,
|
||||
},
|
||||
/* paging(param: OrderTypes.SearchOrderParam) {
|
||||
paging(param: OrderTypes.SearchOrderParam) {
|
||||
return OrderApi.paging(param)
|
||||
.then(res => {
|
||||
const records = res.data.records
|
||||
|
|
@ -147,96 +159,18 @@ const tablePageProps = buildTablePageProps<OrderTypes.SearchOrderParam, OrderTyp
|
|||
record.transRecodes = undefined
|
||||
for (let i = 0; i < transRecodes.length; i++) {
|
||||
const it = transRecodes[i]
|
||||
const settleMoney = it.paymentRecords?.map(it1 => +(it1.settleMoney ?? 0)).reduce((a: number, b: number) => a + b, 0) ?? 0
|
||||
dataList.push({
|
||||
...record,
|
||||
...it,
|
||||
settleMoney,
|
||||
orderId: record.id,
|
||||
rowCount: i === 0 ? transRecodes.length : 0,
|
||||
} as OrderTypes.TableData)
|
||||
}
|
||||
}
|
||||
return res as R<G.PageResult<OrderTypes.TableData>>
|
||||
})
|
||||
}, */
|
||||
paging(param: OrderTypes.SearchOrderParam) {
|
||||
return Promise.resolve({
|
||||
code: 200,
|
||||
data: {
|
||||
current: param.current,
|
||||
size: param.size,
|
||||
total: 100,
|
||||
records: [
|
||||
{
|
||||
rowCount: 3,
|
||||
id: '123',
|
||||
sn: '202308240001',
|
||||
orderTime: '2023-08-24 10:00:00',
|
||||
contacts: '张三',
|
||||
phone: '13800000000',
|
||||
projectName: '项目A',
|
||||
stationName: '站点B',
|
||||
goodsName: '商品X',
|
||||
unit: '吨',
|
||||
customerMemo: '客户备注',
|
||||
estimatedQuantity: 100,
|
||||
estimatedTrainNum: 2,
|
||||
transDistance: 500,
|
||||
orderCategoryTxt: '订单类型A',
|
||||
transStatusTxt: '已进场',
|
||||
transStatus: 'YiJinChang',
|
||||
checkStatus: 'YiKanLiao',
|
||||
checkStatusTxt: '未勘料',
|
||||
paymentStatusTxt: '未支付',
|
||||
truckLicensePlate: '苏A9B905',
|
||||
},
|
||||
{
|
||||
rowCount: 0,
|
||||
id: '123',
|
||||
sn: '202308240001',
|
||||
orderTime: '2023-08-24 10:00:00',
|
||||
contacts: '张三',
|
||||
phone: '13800000000',
|
||||
projectName: '项目A',
|
||||
stationName: '站点B',
|
||||
goodsName: '商品X',
|
||||
unit: '吨',
|
||||
customerMemo: '客户备注',
|
||||
estimatedQuantity: 100,
|
||||
estimatedTrainNum: 2,
|
||||
transDistance: 500,
|
||||
orderCategoryTxt: '订单类型A',
|
||||
transStatusTxt: '运输中',
|
||||
transStatus: 'YunShuZhong',
|
||||
checkStatus: 'WeiKanLiao',
|
||||
checkStatusTxt: '未勘料',
|
||||
paymentStatusTxt: '未支付',
|
||||
truckLicensePlate: '苏A9B905',
|
||||
},
|
||||
{
|
||||
rowCount: 0,
|
||||
id: '123',
|
||||
sn: '202308240001',
|
||||
orderTime: '2023-08-24 10:00:00',
|
||||
contacts: '张三',
|
||||
phone: '13800000000',
|
||||
projectName: '项目A',
|
||||
stationName: '站点B',
|
||||
goodsName: '商品X',
|
||||
unit: '吨',
|
||||
customerMemo: '客户备注',
|
||||
estimatedQuantity: 100,
|
||||
estimatedTrainNum: 2,
|
||||
transDistance: 500,
|
||||
orderCategoryTxt: '订单类型A',
|
||||
transStatusTxt: '已进场',
|
||||
transStatus: 'YiJinChang',
|
||||
checkStatus: 'WeiKanLiao',
|
||||
checkStatusTxt: '未勘料',
|
||||
paymentStatusTxt: '未支付',
|
||||
truckLicensePlate: '苏A9B905',
|
||||
},
|
||||
] as OrderTypes.TableData[],
|
||||
},
|
||||
} as R<G.PageResult<OrderTypes.TableData>>)
|
||||
},
|
||||
},
|
||||
table: {
|
||||
|
|
@ -252,8 +186,9 @@ const tablePageProps = buildTablePageProps<OrderTypes.SearchOrderParam, OrderTyp
|
|||
colspan: 1,
|
||||
}
|
||||
},
|
||||
summaryMethod,
|
||||
actionColumn: {
|
||||
width: 150,
|
||||
width: 140,
|
||||
tableActions: [
|
||||
{
|
||||
tooltip: '详情',
|
||||
|
|
|
|||
|
|
@ -72,9 +72,9 @@
|
|||
{{ `${row.settleMoney == null ? '' : '¥:' + row.settleMoney + '元'}` }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn fixed="right" label="支付状态" prop="paymentStatusTxt" width="90">
|
||||
<ElTableColumn fixed="right" label="支付状态" prop="paymentStatusTxt" width="120">
|
||||
<template #default="{row}">
|
||||
<ElTag :data-cs="paymentStatusColor.cs(row.paymentStatus)"> {{ row.paymentStatusTxt }}</ElTag>
|
||||
<ElTag :data-cs="paymentStatusColor.cs(row.paymentStatus,'info')"> {{ row.paymentStatusTxt ?? '暂无支付信息' }}</ElTag>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn fixed="right" label="勘料状态" prop="checkStatusTxt" width="90">
|
||||
|
|
@ -132,14 +132,17 @@ import Strings from '@/common/utils/strings.ts'
|
|||
import AIcon from '@/components/a-icon/AIcon.vue'
|
||||
import OrderApi from '@/pages/order/order-api.ts'
|
||||
|
||||
const detailPanelIns = useTemplateRef<ADetailPanelInstance<OrderTypes.TableData>>('detailPanel')
|
||||
|
||||
const transRecodeProps = buildTransRecodeProps({})
|
||||
const detailPanelIns = useTemplateRef<ADetailPanelInstance>('detailPanel')
|
||||
const transRecodeProps = buildTransRecodeProps({
|
||||
enableSummary: true,
|
||||
})
|
||||
|
||||
const detailPanelProps = buildDetailPanelProps<OrderTypes.SearchOrderResult>({
|
||||
title: '订单详情',
|
||||
width: '80vw',
|
||||
detailsLoader: OrderApi.detail,
|
||||
detailsLoader(id) {
|
||||
return OrderApi.detail(id, 'LiShi')
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
|
@ -158,7 +161,7 @@ function kanliao(data: OrderTypes.TransRecode) {
|
|||
|
||||
defineExpose({
|
||||
open(data: OrderTypes.TableData) {
|
||||
detailPanelIns.value?.open(data)
|
||||
detailPanelIns.value?.open(data.orderId!)
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import History from '@/pages/order/history/History.vue'
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<History default-order-category="XiaoShou"/>
|
||||
<History biz-type="XiaoShou"/>
|
||||
</template>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import History from '@/pages/order/history/History.vue'
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<History default-order-category="HuiShou"/>
|
||||
<History biz-type="HuiShou"/>
|
||||
</template>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
|
|
|||
|
|
@ -5,27 +5,39 @@ import {
|
|||
|
||||
export default {
|
||||
paging(data: OrderTypes.SearchOrderParam) {
|
||||
return get<G.PageResult<OrderTypes.SearchOrderResult>>("/order/paging", data);
|
||||
return get<G.PageResult<OrderTypes.SearchOrderResult>>('/order/paging', data)
|
||||
},
|
||||
detail(id: string) {
|
||||
return get<OrderTypes.SearchOrderResult>("/order/detail", { id });
|
||||
detail(id: string, orderType?: 'YuYue' | 'ShiShi' | 'LiShi' | 'QuXiao') {
|
||||
return get<OrderTypes.SearchOrderResult>('/order/detail', {id, orderType})
|
||||
},
|
||||
add(data: OrderTypes.AddOrderParam) {
|
||||
return post("/order/add", data);
|
||||
return post('/order/add', data)
|
||||
},
|
||||
modify(data: OrderTypes.ModifyOrderParam) {
|
||||
return post("/order/modify", data);
|
||||
return post('/order/modify', data)
|
||||
},
|
||||
del(ids: string[]) {
|
||||
return post("/order/del", ids);
|
||||
return post('/order/del', ids)
|
||||
},
|
||||
dispatch(data: OrderTypes.DispatchParam) {
|
||||
return post('/order/dispatch', data)
|
||||
},
|
||||
assignmentOrg(data: any) {
|
||||
return post("/order/assignmentOrg", data);
|
||||
return post('/order/assignmentOrg', data)
|
||||
},
|
||||
orderTrans(data: OrderTypes.SearchOrderParam) {
|
||||
return get<G.PageResult<OrderTypes.SearchOrderResult>>("/order_trans/paging", data);
|
||||
return get<G.PageResult<OrderTypes.SearchOrderResult>>('/order_trans/paging', data)
|
||||
},
|
||||
};
|
||||
assignmentDriver(data: OrderTypes.AssignmentDriver) {
|
||||
return post('/order/assignmentDriver', data)
|
||||
},
|
||||
truckComing(data: OrderTypes.TruckComingLeavingParam) {
|
||||
return post('/order/truck_coming', data)
|
||||
},
|
||||
truckLeaving(data: OrderTypes.TruckComingLeavingParam) {
|
||||
return post('/order/truck_leaving', data)
|
||||
},
|
||||
check(data: OrderTypes.CheckParam) {
|
||||
return post('/order/check', data)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -248,6 +248,7 @@ declare global {
|
|||
rowCount: number
|
||||
// Id
|
||||
id?: string
|
||||
orderId?: string
|
||||
// 订单编号
|
||||
sn?: string
|
||||
// 下单时间
|
||||
|
|
@ -408,5 +409,24 @@ declare global {
|
|||
// 是否删除; 0-->未删除、1-->已删除
|
||||
deleted?: boolean
|
||||
}
|
||||
|
||||
interface AssignmentDriver {
|
||||
orderId?: string
|
||||
orderTransId?: string[]
|
||||
driverId?: string
|
||||
}
|
||||
|
||||
interface TruckComingLeavingParam {
|
||||
orderTransId?: string
|
||||
weight?: number
|
||||
frontPhoto?: string
|
||||
bodyPhoto?: string
|
||||
}
|
||||
|
||||
interface CheckParam {
|
||||
orderTransId?: string
|
||||
checkPhoto?: string[]
|
||||
checkerMemo?: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
<script lang="ts" setup>
|
||||
import Uploader from '@/components/uploader/Uploader.vue'
|
||||
import Utils from '@/common/utils'
|
||||
import ADialog from '@/components/a-dialog/ADialog.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import OrderApi from '@/pages/order/order-api.ts'
|
||||
|
||||
const orderData = Utils.resetAble(reactive<{
|
||||
id: string
|
||||
licensePlate: string,
|
||||
}>({
|
||||
id: '',
|
||||
licensePlate: '',
|
||||
}))
|
||||
const title = computed(() => {
|
||||
return `${orderData.licensePlate} 勘料`
|
||||
})
|
||||
|
||||
const emits = defineEmits([ 'succ' ])
|
||||
|
||||
// const formIns = useTemplateRef<FormInstance>('formRef')
|
||||
|
||||
const inOutData = Utils.resetAble(reactive({
|
||||
checkerMemo: '',
|
||||
checkPhoto: [],
|
||||
}))
|
||||
const showDialog = ref(false)
|
||||
const submiting = ref(false)
|
||||
|
||||
function dialogCloseHandler() {
|
||||
inOutData.$reset()
|
||||
}
|
||||
|
||||
function submitHandler() {
|
||||
submiting.value = true
|
||||
const data = {
|
||||
orderTransId: orderData.id,
|
||||
checkPhoto: inOutData.checkPhoto,
|
||||
checkerMemo: inOutData.checkerMemo,
|
||||
}
|
||||
OrderApi.check(data)
|
||||
.then(() => {
|
||||
ElMessage.success(`${title.value}成功`)
|
||||
showDialog.value = false
|
||||
emits('succ')
|
||||
})
|
||||
.finally(() => {
|
||||
submiting.value = false
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open(id: string, licensePlate: string) {
|
||||
orderData.$reset({
|
||||
id,
|
||||
licensePlate,
|
||||
})
|
||||
showDialog.value = true
|
||||
},
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ADialog
|
||||
v-model:show="showDialog"
|
||||
:closed="dialogCloseHandler"
|
||||
:submit-handler="submitHandler"
|
||||
:title="title"
|
||||
>
|
||||
<ElForm ref="formRef"
|
||||
class="check-panel-form"
|
||||
@submit.prevent>
|
||||
<ElFormItem label="勘料照片" prop="headerPhoto">
|
||||
<Uploader v-model:files="inOutData.checkPhoto"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="勘料备注" prop="headerPhoto">
|
||||
<ElInput v-model="inOutData.checkerMemo"/>
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
<template #footer>
|
||||
<ElButton @click="showDialog = false">关闭</ElButton>
|
||||
<ElButton type="danger" @click="showDialog = false">拒收</ElButton>
|
||||
<ElButton :loading="submiting" type="primary" @click="submitHandler">确认勘料</ElButton>
|
||||
</template>
|
||||
</ADialog>
|
||||
</template>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.check-panel-form {
|
||||
display grid
|
||||
grid-template-areas "weight weight" \
|
||||
"headerPhoto bodyPhoto"
|
||||
gap: 0 20px;
|
||||
padding: 10px;
|
||||
|
||||
:deep(.el-input-number) {
|
||||
.el-input__suffix-inner {
|
||||
padding-left 10px
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-form-item) {
|
||||
&:nth-child(1) {
|
||||
grid-area weight
|
||||
}
|
||||
|
||||
&:nth-child(2) {
|
||||
grid-area headerPhoto
|
||||
}
|
||||
|
||||
&:nth-child(3) {
|
||||
grid-area bodyPhoto
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -7,6 +7,7 @@ import {
|
|||
ElMessage,
|
||||
type FormInstance,
|
||||
} from 'element-plus'
|
||||
import OrderApi from '@/pages/order/order-api.ts'
|
||||
|
||||
const orderData = Utils.resetAble(reactive<{
|
||||
id: string
|
||||
|
|
@ -21,6 +22,8 @@ const title = computed(() => {
|
|||
return `${orderData.licensePlate} ${orderData.state}`
|
||||
})
|
||||
|
||||
const emits = defineEmits([ 'succ' ])
|
||||
|
||||
const formIns = useTemplateRef<FormInstance>('formRef')
|
||||
|
||||
const inOutData = Utils.resetAble(reactive({
|
||||
|
|
@ -37,12 +40,25 @@ function dialogCloseHandler() {
|
|||
|
||||
function submitHandler() {
|
||||
submiting.value = true
|
||||
FormUtil.submit(formIns, () => Promise.resolve())
|
||||
const data = {
|
||||
orderTransId: orderData.id,
|
||||
weight: (inOutData.weight ?? 0) * 1000,
|
||||
frontPhoto: inOutData.headerPhoto,
|
||||
bodyPhoto: inOutData.bodyPhoto,
|
||||
}
|
||||
FormUtil.submit(formIns, () => {
|
||||
if (orderData.state === '进场') {
|
||||
return OrderApi.truckComing(data).then(() => true)
|
||||
} else {
|
||||
return OrderApi.truckLeaving(data).then(() => true)
|
||||
}
|
||||
})
|
||||
.then(res => {
|
||||
ElMessage.success(`${title.value}成功`)
|
||||
if ((res ?? true)) {
|
||||
showDialog.value = false
|
||||
}
|
||||
emits('succ')
|
||||
})
|
||||
.finally(() => {
|
||||
submiting.value = false
|
||||
|
|
|
|||
|
|
@ -36,11 +36,11 @@
|
|||
</ElFormItem>
|
||||
</template>
|
||||
<template #columns>
|
||||
<ElTableColumn fixed="left" label="订单编号" prop="sn" width="140"/>
|
||||
<ElTableColumn fixed="left" label="订单编号" prop="sn" width="155"/>
|
||||
<!-- <ElTableColumn label="下单时间" prop="orderTime"/> -->
|
||||
<!-- <ElTableColumn label="客户姓名" prop="contacts"/> -->
|
||||
<!-- <ElTableColumn label="联系方式" prop="phone"/> -->
|
||||
<ElTableColumn label="货品名称" prop="goodsName"/>
|
||||
<ElTableColumn label="货品名称" prop="goodsName" width="120"/>
|
||||
|
||||
<!-- <ElTableColumn label="项目名称" show-overflow-tooltip width="100">
|
||||
<template #default="{row}">
|
||||
|
|
@ -50,34 +50,57 @@
|
|||
<!-- <ElTableColumn label="站点名称" prop="stationName" width="120"/> -->
|
||||
<!-- <ElTableColumn label="运输单位" prop="transOrgName" show-overflow-tooltip width="140"/> -->
|
||||
<!-- <ElTableColumn label="运距(米)" prop="transDistance"/> -->
|
||||
|
||||
<ElTableColumn label="运距" prop="transDistance" width="100">
|
||||
<template #default="{row}">
|
||||
{{ `${row.transDistance == null ? '' : (row.transDistance / 1000) + ' 公里'}` }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="车次" prop="trainNum" width="70"/>
|
||||
<ElTableColumn label="车牌号" prop="licensePlate" width="120"/>
|
||||
<ElTableColumn label="司机姓名" prop="driverName" width="120">
|
||||
<template #default="{row}">
|
||||
<span> {{ row.driverName ?? '-' }}</span>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="司机电话" prop="driverPhone" width="120">
|
||||
<template #default="{row}">
|
||||
<span> {{ row.driverName ?? '-' }}</span>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="车牌号" prop="truckLicensePlate" width="120">
|
||||
<template #default="{row}">
|
||||
<span> {{ row.truckLicensePlate ?? '-' }}</span>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<!-- <ElTableColumn label="司机姓名" prop="driverName"/> -->
|
||||
<!-- <ElTableColumn label="司机电话" prop="driverPhone"/> -->
|
||||
|
||||
<ElTableColumn label="毛重" prop="roughWeight">
|
||||
<ElTableColumn label="毛重" prop="roughWeight" width="80">
|
||||
<template #default="{row}">
|
||||
{{ `${row.roughWeight == null ? '' : row.roughWeight + ' 吨'}` }}
|
||||
{{ `${row.roughWeight == null ? '' : (row.roughWeight / 1000) + ' 吨'}` }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="皮重" prop="tareWeight">
|
||||
<ElTableColumn label="皮重" prop="tareWeight" width="80">
|
||||
<template #default="{row}">
|
||||
{{ `${row.tareWeight == null ? '' : row.tareWeight + ' 吨'}` }}
|
||||
{{ `${row.tareWeight == null ? '' : (row.tareWeight / 1000) + ' 吨'}` }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="净重" prop="settleWeight">
|
||||
<ElTableColumn label="净重" prop="settleWeight" width="80">
|
||||
<template #default="{row}">
|
||||
{{ `${row.settleWeight == null ? '' : row.settleWeight + ' 吨'}` }}
|
||||
{{ `${row.settleWeight == null ? '' : (row.settleWeight / 1000) + ' 吨'}` }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="进场时间" prop="inTime" width="175"/>
|
||||
<!-- <ElTableColumn label="开始运输时间" prop="transTime"/> -->
|
||||
<ElTableColumn label="出场时间" prop="outTime" width="175"/>
|
||||
<!-- <ElTableColumn label="完结时间" prop="finishTime"/> -->
|
||||
<ElTableColumn fixed="right" label="支付状态" prop="paymentStatusTxt" width="90">
|
||||
<ElTableColumn fixed="right" label="支付状态" prop="paymentStatusTxt" width="120">
|
||||
<template #default="{row}">
|
||||
<ElTag :data-cs="paymentStatusColor.cs(row.paymentStatus)"> {{ row.paymentStatusTxt }}</ElTag>
|
||||
<ElTag :data-cs="paymentStatusColor.cs(row.paymentStatus,'info')"> {{ row.paymentStatusTxt ?? '暂无支付信息' }}</ElTag>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn fixed="right" label="总金额" prop="settleMoney" width="80">
|
||||
<template #default="{row}">
|
||||
{{ `${row.settleMoney == null ? '' : row.settleMoney + ' 元'}` }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn fixed="right" label="勘料状态" prop="checkStatusTxt" width="90">
|
||||
|
|
@ -94,7 +117,8 @@
|
|||
<!-- <ElTableColumn label="客户备注" prop="customerMemo"/> -->
|
||||
</template>
|
||||
<RealtimeDetail ref="realtimeDetail"/>
|
||||
<InOutPanel ref="inOutPanel"/>
|
||||
<InOutPanel ref="inOutPanel" @succ="research"/>
|
||||
<CheckPanel ref="checkPanel" @succ="research"/>
|
||||
</ATablePage>
|
||||
</template>
|
||||
|
||||
|
|
@ -108,21 +132,24 @@ import {
|
|||
checkStatus,
|
||||
checkStatusColor,
|
||||
paymentStatusColor,
|
||||
summaryMethod,
|
||||
transStatus,
|
||||
transStatusColor,
|
||||
} from '@/pages/order/constants.ts'
|
||||
import InOutPanel from '@/pages/order/realtime/InOutPanel.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useTemplateRef } from 'vue'
|
||||
import type { R } from '@/common/utils/http-util.ts'
|
||||
import RealtimeDetail from '@/pages/order/realtime/RealtimeDetail.vue'
|
||||
import CheckPanel from '@/pages/order/realtime/CheckPanel.vue'
|
||||
import OrderApi from '@/pages/order/order-api.ts'
|
||||
|
||||
const props = defineProps<{
|
||||
defaultOrderCategory: 'XiaoShou' | 'HuiShou' | 'DuanBo'
|
||||
bizType: 'XiaoShou' | 'HuiShou' | 'DuanBo'
|
||||
}>()
|
||||
const tablePageIns = useTemplateRef<ATablePageInstance>('tablePage')
|
||||
const realtimeDetailIns = useTemplateRef<InstanceType<typeof RealtimeDetail>>('realtimeDetail')
|
||||
const inOutPanelIns = useTemplateRef<InstanceType<typeof InOutPanel>>('inOutPanel')
|
||||
const checkPanelIns = useTemplateRef<InstanceType<typeof CheckPanel>>('checkPanel')
|
||||
|
||||
function research() {
|
||||
tablePageIns.value?.doSearch()
|
||||
|
|
@ -137,112 +164,35 @@ const tablePageProps = buildTablePageProps<OrderTypes.SearchOrderParam, OrderTyp
|
|||
},
|
||||
searchForm: {
|
||||
defaultData: {
|
||||
orderCategory: props.defaultOrderCategory,
|
||||
bizType: props.bizType,
|
||||
orderType: 'ShiShi',
|
||||
},
|
||||
highForm: {
|
||||
contentWidth: 342,
|
||||
},
|
||||
/* paging(param: OrderTypes.SearchOrderParam) {
|
||||
paging(param: OrderTypes.SearchOrderParam) {
|
||||
return OrderApi.paging(param)
|
||||
.then(res => {
|
||||
const records = res.data.records
|
||||
const dataList: OrderTypes.TableData[] = []
|
||||
res.data.records = dataList
|
||||
for (const record of records) {
|
||||
const transRecodes = record.transRecodes ?? []
|
||||
const transRecodes = (record.transRecodes ?? []) as TransRecode[]
|
||||
record.transRecodes = undefined
|
||||
for (let i = 0; i < transRecodes.length; i++) {
|
||||
const it = transRecodes[i]
|
||||
const it = transRecodes[i] as TransRecode
|
||||
const settleMoney = it.paymentRecords?.map(it1 => +(it1.settleMoney ?? 0)).reduce((a: number, b: number) => a + b, 0) ?? 0
|
||||
dataList.push({
|
||||
...record,
|
||||
...it,
|
||||
settleMoney,
|
||||
orderId: record.id,
|
||||
rowCount: i === 0 ? transRecodes.length : 0,
|
||||
} as OrderTypes.TableData)
|
||||
}
|
||||
}
|
||||
return res as R<G.PageResult<OrderTypes.TableData>>
|
||||
})
|
||||
}, */
|
||||
paging(param: OrderTypes.SearchOrderParam) {
|
||||
return Promise.resolve({
|
||||
code: 200,
|
||||
data: {
|
||||
current: param.current,
|
||||
size: param.size,
|
||||
total: 100,
|
||||
records: [
|
||||
{
|
||||
rowCount: 3,
|
||||
id: '123',
|
||||
sn: '202308240001',
|
||||
orderTime: '2023-08-24 10:00:00',
|
||||
contacts: '张三',
|
||||
phone: '13800000000',
|
||||
projectName: '项目A',
|
||||
stationName: '站点B',
|
||||
goodsName: '商品X',
|
||||
unit: '吨',
|
||||
customerMemo: '客户备注',
|
||||
estimatedQuantity: 100,
|
||||
estimatedTrainNum: 2,
|
||||
transDistance: 500,
|
||||
orderCategoryTxt: '订单类型A',
|
||||
transStatusTxt: '已进场',
|
||||
transStatus: 'YiJinChang',
|
||||
checkStatus: 'YiKanLiao',
|
||||
checkStatusTxt: '未勘料',
|
||||
paymentStatusTxt: '未支付',
|
||||
truckLicensePlate: '苏A9B905',
|
||||
},
|
||||
{
|
||||
rowCount: 0,
|
||||
id: '123',
|
||||
sn: '202308240001',
|
||||
orderTime: '2023-08-24 10:00:00',
|
||||
contacts: '张三',
|
||||
phone: '13800000000',
|
||||
projectName: '项目A',
|
||||
stationName: '站点B',
|
||||
goodsName: '商品X',
|
||||
unit: '吨',
|
||||
customerMemo: '客户备注',
|
||||
estimatedQuantity: 100,
|
||||
estimatedTrainNum: 2,
|
||||
transDistance: 500,
|
||||
orderCategoryTxt: '订单类型A',
|
||||
transStatusTxt: '运输中',
|
||||
transStatus: 'YunShuZhong',
|
||||
checkStatus: 'WeiKanLiao',
|
||||
checkStatusTxt: '未勘料',
|
||||
paymentStatusTxt: '未支付',
|
||||
truckLicensePlate: '苏A9B905',
|
||||
},
|
||||
{
|
||||
rowCount: 0,
|
||||
id: '123',
|
||||
sn: '202308240001',
|
||||
orderTime: '2023-08-24 10:00:00',
|
||||
contacts: '张三',
|
||||
phone: '13800000000',
|
||||
projectName: '项目A',
|
||||
stationName: '站点B',
|
||||
goodsName: '商品X',
|
||||
unit: '吨',
|
||||
customerMemo: '客户备注',
|
||||
estimatedQuantity: 100,
|
||||
estimatedTrainNum: 2,
|
||||
transDistance: 500,
|
||||
orderCategoryTxt: '订单类型A',
|
||||
transStatusTxt: '已进场',
|
||||
transStatus: 'YiJinChang',
|
||||
checkStatus: 'WeiKanLiao',
|
||||
checkStatusTxt: '未勘料',
|
||||
paymentStatusTxt: '未支付',
|
||||
truckLicensePlate: '苏A9B905',
|
||||
},
|
||||
] as OrderTypes.TableData[],
|
||||
},
|
||||
} as R<G.PageResult<OrderTypes.TableData>>)
|
||||
},
|
||||
},
|
||||
table: {
|
||||
|
|
@ -258,8 +208,9 @@ const tablePageProps = buildTablePageProps<OrderTypes.SearchOrderParam, OrderTyp
|
|||
colspan: 1,
|
||||
}
|
||||
},
|
||||
summaryMethod,
|
||||
actionColumn: {
|
||||
width: 100,
|
||||
width: 185,
|
||||
foldLimit: 5,
|
||||
tableActions: [
|
||||
{
|
||||
|
|
@ -296,14 +247,11 @@ const tablePageProps = buildTablePageProps<OrderTypes.SearchOrderParam, OrderTyp
|
|||
tooltip: '勘料',
|
||||
type: 'warning',
|
||||
icon: 'chakanliaodan',
|
||||
confirm: {
|
||||
title: '是否确认勘料',
|
||||
},
|
||||
show({row}) {
|
||||
return row.transStatus === transStatus.YiJinChang && row.checkStatus === checkStatus.WeiKanLiao
|
||||
},
|
||||
action({row}) {
|
||||
ElMessage.success(`${row.truckLicensePlate!}勘料成功`)
|
||||
checkPanelIns.value?.open(row.id!, row.truckLicensePlate!)
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -44,9 +44,21 @@
|
|||
<ElDescriptionsItem :span="1">
|
||||
<TransRecode :trans-recodes="detailData.transRecodes" v-bind="transRecodeProps">
|
||||
<ElTableColumn label="车次" prop="trainNum" width="60"/>
|
||||
<ElTableColumn label="司机姓名" prop="driverName" width="100"/>
|
||||
<ElTableColumn label="司机电话" prop="driverPhone" width="120"/>
|
||||
<ElTableColumn label="车牌号" prop="truckLicensePlate" width="120"/>
|
||||
<ElTableColumn label="司机姓名" prop="driverName" width="120">
|
||||
<template #default="{row}">
|
||||
<span> {{ row.driverName ?? '-' }}</span>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="司机电话" prop="driverPhone" width="120">
|
||||
<template #default="{row}">
|
||||
<span> {{ row.driverName ?? '-' }}</span>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="车牌号" prop="truckLicensePlate" width="120">
|
||||
<template #default="{row}">
|
||||
<span> {{ row.truckLicensePlate ?? '-' }}</span>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="毛重" prop="roughWeight">
|
||||
<template #default="{row}">
|
||||
{{ `${row.roughWeight == null ? '' : row.roughWeight + ' 吨'}` }}
|
||||
|
|
@ -72,9 +84,9 @@
|
|||
{{ `${row.settleMoney == null ? '' : '¥:' + row.settleMoney + '元'}` }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn fixed="right" label="支付状态" prop="paymentStatusTxt" width="90">
|
||||
<ElTableColumn fixed="right" label="支付状态" prop="paymentStatusTxt" width="120">
|
||||
<template #default="{row}">
|
||||
<ElTag :data-cs="paymentStatusColor.cs(row.paymentStatus)"> {{ row.paymentStatusTxt }}</ElTag>
|
||||
<ElTag :data-cs="paymentStatusColor.cs(row.paymentStatus,'info')"> {{ row.paymentStatusTxt ?? '暂无支付信息' }}</ElTag>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn fixed="right" label="勘料状态" prop="checkStatusTxt" width="90">
|
||||
|
|
@ -132,14 +144,19 @@ import Strings from '@/common/utils/strings.ts'
|
|||
import AIcon from '@/components/a-icon/AIcon.vue'
|
||||
import OrderApi from '@/pages/order/order-api.ts'
|
||||
|
||||
const detailPanelIns = useTemplateRef<ADetailPanelInstance<OrderTypes.TableData>>('detailPanel')
|
||||
const detailPanelIns = useTemplateRef<ADetailPanelInstance>('detailPanel')
|
||||
|
||||
const transRecodeProps = buildTransRecodeProps({})
|
||||
const transRecodeProps = buildTransRecodeProps({
|
||||
enableSummary: true,
|
||||
})
|
||||
|
||||
const detailPanelProps = buildDetailPanelProps<OrderTypes.SearchOrderResult>({
|
||||
title: '订单详情',
|
||||
width: '80vw',
|
||||
detailsLoader: OrderApi.detail,
|
||||
detailsLoader(id) {
|
||||
return OrderApi.detail(id, 'ShiShi')
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
|
@ -158,7 +175,7 @@ function kanliao(data: OrderTypes.TransRecode) {
|
|||
|
||||
defineExpose({
|
||||
open(data: OrderTypes.TableData) {
|
||||
detailPanelIns.value?.open(data)
|
||||
detailPanelIns.value?.open(data.orderId!)
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import Realtime from '@/pages/order/realtime/Realtime.vue'
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<Realtime default-order-category="XiaoShou"/>
|
||||
<Realtime biz-type="XiaoShou"/>
|
||||
</template>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import Realtime from '@/pages/order/realtime/Realtime.vue'
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<Realtime default-order-category="HuiShou"/>
|
||||
<Realtime biz-type="HuiShou"/>
|
||||
</template>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
|
|
|||
|
|
@ -7,24 +7,18 @@ import {
|
|||
ElTable,
|
||||
ElTableColumn,
|
||||
} from 'element-plus'
|
||||
|
||||
|
||||
interface SummaryMethodProps {
|
||||
columns: TableColumnCtx<OrderTypes.TransRecode>[]
|
||||
data: OrderTypes.TransRecode[]
|
||||
}
|
||||
import { type SummaryMethodProps } from '@/components/a-page/a-table-page/build-summary-method.ts'
|
||||
import { summaryMethod } from '@/pages/order/constants.ts'
|
||||
|
||||
interface TransRecode {
|
||||
transRecodes: OrderTypes.TransRecode[]
|
||||
selectable: boolean
|
||||
disabledRowsMethod: (rows?: OrderTypes.TransRecode[]) => string[] | undefined
|
||||
summaries: string[]
|
||||
moduleValue: string[]
|
||||
'onUpdate:moduleValue': (value: string[]) => void
|
||||
summaryMethod: (data: SummaryMethodProps) => (string | VNode)[]
|
||||
summaryMethod?: (data: SummaryMethodProps<OrderTypes.TransRecode>) => (string | VNode)[]
|
||||
}
|
||||
|
||||
|
||||
const component = defineComponent(
|
||||
(props: TransRecode, ctx) => {
|
||||
const transRecodes = computed(() => {
|
||||
|
|
@ -67,7 +61,6 @@ const component = defineComponent(
|
|||
ctx.emit('update:moduleValue', selectRows.$clone())
|
||||
}
|
||||
|
||||
|
||||
return () => (<ElTable
|
||||
cell-class-name="table-cell"
|
||||
empty-text="暂无数据"
|
||||
|
|
@ -76,7 +69,7 @@ const component = defineComponent(
|
|||
data={transRecodes.value}
|
||||
class={[ 'data-table', props.selectable ? styles.selectable : '' ]}
|
||||
summary-method={props.summaryMethod}
|
||||
show-summary={props.summaries.length > 0}
|
||||
show-summary={props.summaryMethod != null}
|
||||
onRow-click={rowClick}>
|
||||
{{
|
||||
default: () => {
|
||||
|
|
@ -106,29 +99,32 @@ const component = defineComponent(
|
|||
},
|
||||
{
|
||||
name: 'TransRecode',
|
||||
props: [ 'transRecodes', 'selectable', 'summaries', 'disabledRowsMethod', 'summaryMethod', 'moduleValue' ],
|
||||
props: [ 'transRecodes', 'selectable', 'disabledRowsMethod', 'summaryMethod', 'moduleValue' ],
|
||||
emits: [ 'update:moduleValue' ],
|
||||
},
|
||||
)
|
||||
|
||||
type BuildTransRecodePropsParam = DeepPartial<Exclude<TransRecode, 'summaryMethod' | 'transRecodes'>> & {
|
||||
enableSummary?: boolean
|
||||
}
|
||||
|
||||
export function buildTransRecodeProps({
|
||||
selectable,
|
||||
summaries,
|
||||
moduleValue,
|
||||
summaryMethod,
|
||||
enableSummary = false,
|
||||
disabledRowsMethod,
|
||||
['onUpdate:moduleValue']: onUpdateModuleValue,
|
||||
}: DeepPartial<Exclude<TransRecode, 'transRecodes'>>) {
|
||||
}: BuildTransRecodePropsParam,
|
||||
) {
|
||||
const props = reactive({
|
||||
selectable: selectable ?? false,
|
||||
summaries: summaries ?? [],
|
||||
moduleValue: moduleValue ?? [],
|
||||
'onUpdate:moduleValue': onUpdateModuleValue ?? (value => {
|
||||
props.moduleValue = value
|
||||
}),
|
||||
disabledRowsMethod: disabledRowsMethod ?? (() => []),
|
||||
summaryMethod: summaryMethod ?? (() => []),
|
||||
} as Exclude<TransRecode, 'transRecodes'>)
|
||||
summaryMethod: enableSummary ? summaryMethod : undefined,
|
||||
})
|
||||
return props
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue