|
@@ -37,10 +37,10 @@ const handleColumns = (columns: any, status?: string) => {
|
|
|
...curColumn,
|
|
...curColumn,
|
|
|
slots: { default: 'status' }
|
|
slots: { default: 'status' }
|
|
|
}
|
|
}
|
|
|
- } else if (item.type === 'link' && status !== 'all') {
|
|
|
|
|
|
|
+ } else if (item.type === 'multiple_link') {
|
|
|
curColumn = {
|
|
curColumn = {
|
|
|
...curColumn,
|
|
...curColumn,
|
|
|
- slots: { default: 'link' }
|
|
|
|
|
|
|
+ slots: { default: 'multLink' }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// 格式化
|
|
// 格式化
|
|
@@ -49,6 +49,17 @@ const handleColumns = (columns: any, status?: string) => {
|
|
|
...curColumn,
|
|
...curColumn,
|
|
|
formatter: ({ cellValue }: any) => formatTimezone(cellValue)
|
|
formatter: ({ cellValue }: any) => formatTimezone(cellValue)
|
|
|
}
|
|
}
|
|
|
|
|
+ } else if (item.formatter === 'range') {
|
|
|
|
|
+ curColumn = {
|
|
|
|
|
+ ...curColumn,
|
|
|
|
|
+ formatter: ({ cellValue }: any) => {
|
|
|
|
|
+ if (!cellValue) return '--'
|
|
|
|
|
+ const rangeData = cellValue.split(';')
|
|
|
|
|
+ const leftDate = rangeData[0] ? formatTimezone(rangeData[0]) : '_'
|
|
|
|
|
+ const rightDate = rangeData[1] ? formatTimezone(rangeData[0]) : '_'
|
|
|
|
|
+ return leftDate + ' -- ' + rightDate
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
return curColumn
|
|
return curColumn
|
|
|
})
|
|
})
|
|
@@ -60,16 +71,12 @@ const getTableColumns = async () => {
|
|
|
tableLoadingColumn.value = true
|
|
tableLoadingColumn.value = true
|
|
|
await $api.getDeliveryBookingTableColumn().then((res: any) => {
|
|
await $api.getDeliveryBookingTableColumn().then((res: any) => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
- tableData.value.columns = [
|
|
|
|
|
- { type: 'checkbox', width: 50, fixed: 'left' },
|
|
|
|
|
- ...handleColumns(res.data.TrackingTableColumns)
|
|
|
|
|
- ]
|
|
|
|
|
- console.log('tableData.value.columns', tableData.value.columns)
|
|
|
|
|
|
|
+ tableData.value.columns = [...handleColumns(res.data.TrackingTableColumns)]
|
|
|
const index = tableData.value.columns.findIndex((item: any) => item.title === 'Action')
|
|
const index = tableData.value.columns.findIndex((item: any) => item.title === 'Action')
|
|
|
if (index === -1) {
|
|
if (index === -1) {
|
|
|
tableData.value.columns.push({
|
|
tableData.value.columns.push({
|
|
|
title: 'Action',
|
|
title: 'Action',
|
|
|
- fixed: 'right',
|
|
|
|
|
|
|
+ fixed: 'left',
|
|
|
width: 130,
|
|
width: 130,
|
|
|
slots: { default: 'action' }
|
|
slots: { default: 'action' }
|
|
|
})
|
|
})
|
|
@@ -97,7 +104,7 @@ const assignTableData = (data: any) => {
|
|
|
if (index === -1) {
|
|
if (index === -1) {
|
|
|
tableData.value.columns.push({
|
|
tableData.value.columns.push({
|
|
|
title: 'Action',
|
|
title: 'Action',
|
|
|
- fixed: 'right',
|
|
|
|
|
|
|
+ fixed: 'left',
|
|
|
width: 130,
|
|
width: 130,
|
|
|
slots: { default: 'action' }
|
|
slots: { default: 'action' }
|
|
|
})
|
|
})
|
|
@@ -105,7 +112,7 @@ const assignTableData = (data: any) => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const isEmployeeRole = ref(true)
|
|
|
|
|
|
|
+const isEmployeeRole = ref(null)
|
|
|
|
|
|
|
|
const emit = defineEmits(['getNumberCards'])
|
|
const emit = defineEmits(['getNumberCards'])
|
|
|
const rtnNumberCards = (data) => {
|
|
const rtnNumberCards = (data) => {
|
|
@@ -156,7 +163,7 @@ const getTableData = async (isPageChange?: boolean) => {
|
|
|
})
|
|
})
|
|
|
.then((res: any) => {
|
|
.then((res: any) => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
- isEmployeeRole.value = res.data.is_employee
|
|
|
|
|
|
|
+ isEmployeeRole.value = res.data.is_employee || false
|
|
|
assignTableData(res.data)
|
|
assignTableData(res.data)
|
|
|
rtnNumberCards(res.data)
|
|
rtnNumberCards(res.data)
|
|
|
}
|
|
}
|
|
@@ -180,7 +187,7 @@ const SearchOperationLog = () => {
|
|
|
})
|
|
})
|
|
|
.then((res: any) => {
|
|
.then((res: any) => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
- isEmployeeRole.value = res.data.is_employee
|
|
|
|
|
|
|
+ isEmployeeRole.value = res.data.is_employee || false
|
|
|
assignTableData(res.data)
|
|
assignTableData(res.data)
|
|
|
rtnNumberCards(res.data)
|
|
rtnNumberCards(res.data)
|
|
|
}
|
|
}
|
|
@@ -273,30 +280,6 @@ const tableData = ref<VxeGridProps<any>>({
|
|
|
// 实现行点击样式
|
|
// 实现行点击样式
|
|
|
useRowClickStyle(tableRef)
|
|
useRowClickStyle(tableRef)
|
|
|
|
|
|
|
|
-const CustomizeColumnsRef = ref()
|
|
|
|
|
-// 打开定制表格弹窗
|
|
|
|
|
-const handleCustomizeColumns = () => {
|
|
|
|
|
- const params = {
|
|
|
|
|
- getData: {
|
|
|
|
|
- action: 'ocean_booking',
|
|
|
|
|
- operate: 'setting_display'
|
|
|
|
|
- },
|
|
|
|
|
- saveData: {
|
|
|
|
|
- action: 'ajax',
|
|
|
|
|
- operate: 'save_setting_display',
|
|
|
|
|
- model_name: 'Booking_Search'
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- CustomizeColumnsRef.value.openDialog(params, -220)
|
|
|
|
|
-}
|
|
|
|
|
-// 定制表格
|
|
|
|
|
-const customizeColumns = async () => {
|
|
|
|
|
- await getTableColumns()
|
|
|
|
|
- nextTick(() => {
|
|
|
|
|
- tableRef.value && autoWidth(tableData.value, tableRef.value)
|
|
|
|
|
- })
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
const tableLoadingColumn = ref(false)
|
|
const tableLoadingColumn = ref(false)
|
|
|
const tableLoadingTableData = ref(false)
|
|
const tableLoadingTableData = ref(false)
|
|
|
|
|
|
|
@@ -316,7 +299,7 @@ const clickEmailBtn = (row: any) => {
|
|
|
const handleEdit = (row: any) => {
|
|
const handleEdit = (row: any) => {
|
|
|
router.push({
|
|
router.push({
|
|
|
path: '/destination-delivery/CreateNewBooking',
|
|
path: '/destination-delivery/CreateNewBooking',
|
|
|
- query: { a: row._serial_no}
|
|
|
|
|
|
|
+ query: { a: row._serial_no }
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -324,28 +307,35 @@ const handleCreate = () => {
|
|
|
router.push({ name: 'Create New Booking' })
|
|
router.push({ name: 'Create New Booking' })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const handleLinkClick = (row: any, column: any) => {
|
|
|
|
|
- if (column.title === 'Booking No.') {
|
|
|
|
|
- router.push({
|
|
|
|
|
- path: '/booking/detail',
|
|
|
|
|
- query: { a: row.__serial_no, _schemas: row._schemas, status: row.Status }
|
|
|
|
|
- })
|
|
|
|
|
- // visitedRowState.setBookingTableData(row['__serial_no'])
|
|
|
|
|
- } else if (column.title === 'HBOL/HAWB No.') {
|
|
|
|
|
- router.push({
|
|
|
|
|
- path: '/tracking/detail',
|
|
|
|
|
- query: { a: row.__serial_no, _schemas: row._schemas }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+const testData = [
|
|
|
|
|
+ {
|
|
|
|
|
+ key: 'A1703530062',
|
|
|
|
|
+ value: 'CD1Xeh4rG%2FPmYIiCHAw2%2B0Gw8BFZ8k%2F2pQDkYX3vuf6iZ3kcQXj%2BzQ'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ key: 'A1703530062',
|
|
|
|
|
+ value: 'CD1Xeh4rG%2FPmYIiCHAw2%2B0Gw8BFZ8k%2F2pQDkYX3vuf6iZ3kcQXj%2BzQ'
|
|
|
}
|
|
}
|
|
|
|
|
+]
|
|
|
|
|
+
|
|
|
|
|
+const handleMultLinkClick = (item: any) => {
|
|
|
|
|
+ router.push({
|
|
|
|
|
+ path: '/tracking/detail',
|
|
|
|
|
+ query: { a: item.value, _schemas: item.order_from }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const tipsDialogRef = ref()
|
|
const tipsDialogRef = ref()
|
|
|
-const handleTips = (type: string) => {
|
|
|
|
|
- tipsDialogRef.value.openDialog(type)
|
|
|
|
|
|
|
+const handleTips = (type: string, row: any) => {
|
|
|
|
|
+ tipsDialogRef.value.openDialog(type, row)
|
|
|
|
|
+}
|
|
|
|
|
+const handleChangeRowState = () => {
|
|
|
|
|
+ SearchOperationLog()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
defineExpose({
|
|
defineExpose({
|
|
|
- SearchOperationLog
|
|
|
|
|
|
|
+ SearchOperationLog,
|
|
|
|
|
+ isEmployeeRole
|
|
|
})
|
|
})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
@@ -359,12 +349,6 @@ defineExpose({
|
|
|
>
|
|
>
|
|
|
<div class="table-tools">
|
|
<div class="table-tools">
|
|
|
<div class="left-total-records">Booking List</div>
|
|
<div class="left-total-records">Booking List</div>
|
|
|
- <div class="right-tools-btn">
|
|
|
|
|
- <el-button type="default" @click="handleCustomizeColumns">
|
|
|
|
|
- <span style="margin-right: 8px" class="font_family icon-icon_column_b"></span>
|
|
|
|
|
- Customize Columns
|
|
|
|
|
- </el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
<vxe-grid
|
|
<vxe-grid
|
|
|
ref="tableRef"
|
|
ref="tableRef"
|
|
@@ -383,6 +367,7 @@ defineExpose({
|
|
|
<p>ensure smooth last-mile delivery.</p>
|
|
<p>ensure smooth last-mile delivery.</p>
|
|
|
<el-button
|
|
<el-button
|
|
|
style="height: 40px"
|
|
style="height: 40px"
|
|
|
|
|
+ v-if="isEmployeeRole === false"
|
|
|
class="el-button--main el-button--pain-theme"
|
|
class="el-button--main el-button--pain-theme"
|
|
|
@click="handleCreate"
|
|
@click="handleCreate"
|
|
|
>
|
|
>
|
|
@@ -392,8 +377,8 @@ defineExpose({
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<!-- action操作的插槽 -->
|
|
<!-- action操作的插槽 -->
|
|
|
- <template #action="{ row }">
|
|
|
|
|
- <!-- view -->
|
|
|
|
|
|
|
+ <template #action="{ row, rowIndex }">
|
|
|
|
|
+ <!-- view -->
|
|
|
<el-button
|
|
<el-button
|
|
|
@click="clickViewBtn(row)"
|
|
@click="clickViewBtn(row)"
|
|
|
class="action-btn el-button--blue"
|
|
class="action-btn el-button--blue"
|
|
@@ -403,10 +388,10 @@ defineExpose({
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<!-- email -->
|
|
<!-- email -->
|
|
|
<el-button
|
|
<el-button
|
|
|
|
|
+ v-if="!isEmployeeRole && row.status === 'Approved'"
|
|
|
@click="clickEmailBtn(row)"
|
|
@click="clickEmailBtn(row)"
|
|
|
class="action-btn el-button--blue"
|
|
class="action-btn el-button--blue"
|
|
|
style="height: 24px; width: 24px"
|
|
style="height: 24px; width: 24px"
|
|
|
- v-if="isEmployeeRole && row.status === 'Approved'"
|
|
|
|
|
>
|
|
>
|
|
|
<span class="font_family icon-icon_email_b"> </span>
|
|
<span class="font_family icon-icon_email_b"> </span>
|
|
|
</el-button>
|
|
</el-button>
|
|
@@ -415,32 +400,32 @@ defineExpose({
|
|
|
@click="handleEdit(row)"
|
|
@click="handleEdit(row)"
|
|
|
class="action-btn el-button--blue"
|
|
class="action-btn el-button--blue"
|
|
|
style="height: 24px; width: 24px"
|
|
style="height: 24px; width: 24px"
|
|
|
- v-if="isEmployeeRole && row.status === 'Pending Approval'"
|
|
|
|
|
|
|
+ v-if="!isEmployeeRole && row.status === 'Pending Approval'"
|
|
|
>
|
|
>
|
|
|
<span class="font_family icon-icon_edit_b"> </span>
|
|
<span class="font_family icon-icon_edit_b"> </span>
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<!-- cancel -->
|
|
<!-- cancel -->
|
|
|
<el-button
|
|
<el-button
|
|
|
- @click="handleTips('cancel')"
|
|
|
|
|
|
|
+ @click="handleTips('cancel', row)"
|
|
|
class="action-btn el-button--blue"
|
|
class="action-btn el-button--blue"
|
|
|
style="height: 24px; width: 24px"
|
|
style="height: 24px; width: 24px"
|
|
|
- v-if="isEmployeeRole && row.status === 'Pending Approval'"
|
|
|
|
|
|
|
+ v-if="!isEmployeeRole && row.status === 'Pending Approval'"
|
|
|
>
|
|
>
|
|
|
<span class="font_family icon-icon_cancelled_b"> </span>
|
|
<span class="font_family icon-icon_cancelled_b"> </span>
|
|
|
</el-button>
|
|
</el-button>
|
|
|
- <!-- confirm -->
|
|
|
|
|
|
|
+ <!-- approve -->
|
|
|
<el-button
|
|
<el-button
|
|
|
- v-if="!isEmployeeRole && row.status === 'Pending Approval'"
|
|
|
|
|
- @click="handleTips('confirm')"
|
|
|
|
|
|
|
+ @click="handleTips('approve', row)"
|
|
|
class="action-btn el-button--blue"
|
|
class="action-btn el-button--blue"
|
|
|
|
|
+ v-if="isEmployeeRole && row.status === 'Pending Approval'"
|
|
|
style="height: 24px; width: 24px"
|
|
style="height: 24px; width: 24px"
|
|
|
>
|
|
>
|
|
|
<span class="font_family icon-icon_confirm_b"> </span>
|
|
<span class="font_family icon-icon_confirm_b"> </span>
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<!-- reject -->
|
|
<!-- reject -->
|
|
|
<el-button
|
|
<el-button
|
|
|
- v-if="!isEmployeeRole && row.status === 'Pending Approval'"
|
|
|
|
|
- @click="handleTips('reject')"
|
|
|
|
|
|
|
+ v-if="isEmployeeRole && row.status === 'Pending Approval'"
|
|
|
|
|
+ @click="handleTips('reject', row)"
|
|
|
class="action-btn el-button--blue"
|
|
class="action-btn el-button--blue"
|
|
|
style="height: 24px; width: 24px"
|
|
style="height: 24px; width: 24px"
|
|
|
>
|
|
>
|
|
@@ -452,13 +437,19 @@ defineExpose({
|
|
|
<VTag :type="row[column.field]">{{ row[column.field] }}</VTag>
|
|
<VTag :type="row[column.field]">{{ row[column.field] }}</VTag>
|
|
|
</template>
|
|
</template>
|
|
|
<!-- Booking No字段的插槽 -->
|
|
<!-- Booking No字段的插槽 -->
|
|
|
- <template #link="{ row, column }">
|
|
|
|
|
- <span
|
|
|
|
|
- style="color: var(--color-theme); cursor: pointer"
|
|
|
|
|
- @click="handleLinkClick(row, column)"
|
|
|
|
|
|
|
+ <template #multLink="{ row, column }">
|
|
|
|
|
+ <div
|
|
|
|
|
+ style="display: inline-block"
|
|
|
|
|
+ v-for="(item, index) in row[column.field]"
|
|
|
|
|
+ :key="item.key"
|
|
|
>
|
|
>
|
|
|
- {{ row[column.field] }}
|
|
|
|
|
- </span>
|
|
|
|
|
|
|
+ <span v-if="index > 0">、</span>
|
|
|
|
|
+ <span
|
|
|
|
|
+ style="color: var(--color-theme); cursor: pointer"
|
|
|
|
|
+ @click="handleMultLinkClick(item)"
|
|
|
|
|
+ >{{ item.key }}</span
|
|
|
|
|
+ >
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-grid>
|
|
</vxe-grid>
|
|
|
|
|
|
|
@@ -479,10 +470,9 @@ defineExpose({
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <CustomizeColumns @customize="customizeColumns" ref="CustomizeColumnsRef" />
|
|
|
|
|
<BookingDetailDialog ref="bookingDetailDiaRef" />
|
|
<BookingDetailDialog ref="bookingDetailDiaRef" />
|
|
|
<EmailDialog ref="emailDialogRef" />
|
|
<EmailDialog ref="emailDialogRef" />
|
|
|
- <TipsDialog ref="tipsDialogRef" type="reject" booking-no="123" />
|
|
|
|
|
|
|
+ <TipsDialog ref="tipsDialogRef" @state-change="handleChangeRowState" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|