zth
lijingjia 4 weeks ago
parent 7d77f55ffe
commit 01dd356a35

@ -111,6 +111,7 @@ import { formatParams } from '/@/hooks/web/common'
const appStore = useAppStore()
const { createMessage } = useMessage()
const go = useGo()
const tableData = ref([])
//
const calcColumns = [
{
@ -201,88 +202,91 @@ const calcColumns = [
]
//
const calcData = ref([{}])
const [registerTable, { reload, getForm, setLoading, getSelectRows, setColumns }] = useTable({
title: '',
api: async (p) => {
//
updateTableField(setColumns)
const res: API.DataResult = await PageDataByBooking(p)
calcData.value = [res.data?.dataTotal]
return new Promise((resolve) => {
res.data?.list.forEach((item) => {
item.stlDate = formatTableData(item.stlDate)
item.etd = formatTableData(item.etd)
item.closingDate = formatTableData(item.closingDate)
item.eta = formatTableData(item.eta)
item.issueDate = formatTableData(item.issueDate)
item.customDate = formatTableData(item.customDate)
item.inspectionDate = formatTableData(item.inspectionDate)
const bookstatus = [
{ statusCode: 'status_cangdan', isChecked: false, statusName: '舱单' },
{ statusCode: 'status_haifang', isChecked: false, statusName: '海放' },
{ statusCode: 'status_zhuangzai', isChecked: false, statusName: '装载' },
{ statusCode: 'status_mafang', isChecked: false, statusName: '码放' },
{ statusCode: 'status_zhuangchuan', isChecked: false, statusName: '装船' },
{ statusCode: 'status_atd', isChecked: false, statusName: '离港' }
]
if (item.bookingStatus && item.bookingStatus.length > 0) {
bookstatus.map((book, bindex) => {
item.bookingStatus.map((ite, index) => {
if (ite.statusCode == book.statusCode) {
bookstatus[bindex] = ite
bookstatus[bindex].isChecked = true
}
})
})
}
item.bookingStatus = bookstatus
})
if (res?.data?.list) {
const ids = res.data.list.map((item) => {
return item.id
})
appStore.setIds(ids, 'hyck')
}
resolve({ data: [...res.data.list], total: res.data.totalCount })
})
},
//
beforeFetch: (p) => {
return formatParams(p)
},
afterFetch: () => {
isAdvancedQuery.value = false
moreNumVisible.value = false
moreNumVal.value = ''
},
columns,
formConfig: {
labelWidth: 120,
//
schemas: searchFormSchema,
// ()
useAdvancedSearch: true,
},
isTreeTable: false,
pagination: true,
striped: true,
useSearchForm: true,
showTableSetting: true,
bordered: true,
showIndexColumn: true,
indexColumnProps: {
width: 60,
},
canResize: true,
resizeHeightOffset: 75,
immediate: false,
actionColumn: {
width: 60,
title: '操作',
dataIndex: 'action',
fixed: 'right'
}
})
// const [registerTable, { reload, getForm, setLoading, getSelectRows, setColumns }] = useTable({
// title: '',
// api: async (p) => {
// //
// updateTableField(setColumns)
// const res: API.DataResult = await PageDataByBooking(p)
// calcData.value = [res.data?.dataTotal]
// return new Promise((resolve) => {
// res.data?.list.forEach((item) => {
// item.stlDate = formatTableData(item.stlDate)
// item.etd = formatTableData(item.etd)
// item.closingDate = formatTableData(item.closingDate)
// item.eta = formatTableData(item.eta)
// item.issueDate = formatTableData(item.issueDate)
// item.customDate = formatTableData(item.customDate)
// item.inspectionDate = formatTableData(item.inspectionDate)
// const bookstatus = [
// { statusCode: 'status_cangdan', isChecked: false, statusName: '' },
// { statusCode: 'status_haifang', isChecked: false, statusName: '' },
// { statusCode: 'status_zhuangzai', isChecked: false, statusName: '' },
// { statusCode: 'status_mafang', isChecked: false, statusName: '' },
// { statusCode: 'status_zhuangchuan', isChecked: false, statusName: '' },
// { statusCode: 'status_atd', isChecked: false, statusName: '' }
// ]
// if (item.bookingStatus && item.bookingStatus.length > 0) {
// bookstatus.map((book, bindex) => {
// item.bookingStatus.map((ite, index) => {
// if (ite.statusCode == book.statusCode) {
// bookstatus[bindex] = ite
// bookstatus[bindex].isChecked = true
// }
// })
// })
// }
// item.bookingStatus = bookstatus
// })
// if (res?.data?.list) {
// const ids = res.data.list.map((item) => {
// return item.id
// })
// appStore.setIds(ids, 'hyck')
// }
// resolve({ data: [...res.data.list], total: res.data.totalCount })
// })
// },
// //
// beforeFetch: (p) => {
// return formatParams(p)
// },
// afterFetch: () => {
// isAdvancedQuery.value = false
// moreNumVisible.value = false
// moreNumVal.value = ''
// },
// columns,
// formConfig: {
// labelWidth: 120,
// //
// schemas: searchFormSchema,
// // ()
// useAdvancedSearch: true,
// },
// isTreeTable: false,
// pagination: true,
// striped: true,
// useSearchForm: true,
// showTableSetting: true,
// bordered: true,
// showIndexColumn: true,
// indexColumnProps: {
// width: 60,
// },
// canResize: true,
// resizeHeightOffset: 75,
// immediate: false,
// actionColumn: {
// width: 60,
// title: '',
// dataIndex: 'action',
// fixed: 'right'
// }
// })
const init = () => {
}
function editColumns(row) {
if (row.mblno) {
go(`/BookingDetail?id=${row.id}&source=edit&mblno=${row.mblno}`)

Loading…
Cancel
Save