|
|
@ -4,105 +4,104 @@
|
|
|
|
* @Date: 2024-04-29 11:54:04
|
|
|
|
* @Date: 2024-04-29 11:54:04
|
|
|
|
-->
|
|
|
|
-->
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<a-modal
|
|
|
|
<a-modal title="引入舱位" @cancel="visible = false" @ok="handleOk" v-if="visible" :visible="visible" width="80%"
|
|
|
|
title="引入舱位"
|
|
|
|
:confirmLoading="loading">
|
|
|
|
@cancel="visible = false"
|
|
|
|
|
|
|
|
@ok="handleOk"
|
|
|
|
|
|
|
|
v-if="visible"
|
|
|
|
|
|
|
|
:visible="visible"
|
|
|
|
|
|
|
|
width="80%"
|
|
|
|
|
|
|
|
:confirmLoading="loading"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<a-spin :spinning="loading">
|
|
|
|
<a-spin :spinning="loading">
|
|
|
|
<BasicTable
|
|
|
|
<BasicTable class="ds-table-detail" @register="registerTable" />
|
|
|
|
class="ds-table-detail"
|
|
|
|
|
|
|
|
@register="registerTable"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</a-spin>
|
|
|
|
</a-spin>
|
|
|
|
</a-modal>
|
|
|
|
</a-modal>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { defineExpose, ref, defineProps, defineEmits } from 'vue'
|
|
|
|
import { defineExpose, ref, defineProps, defineEmits } from 'vue'
|
|
|
|
import { BasicTable, useTable } from '/@/components/Table'
|
|
|
|
import { BasicTable, useTable } from '/@/components/Table'
|
|
|
|
import { GetAvailableBookingSlots, BringInBookingSlotToOrder } from '../../api/BookingLedger.js'
|
|
|
|
import { GetAvailableBookingSlots, BringInBookingSlotToOrder } from '../../api/BookingLedger.js'
|
|
|
|
import { storageColumns, storageSearchFormSchema } from './ladingInfo'
|
|
|
|
import { storageColumns, storageSearchFormSchema } from './ladingInfo'
|
|
|
|
// 引入提示信息
|
|
|
|
// 引入提示信息
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
const { createMessage } = useMessage()
|
|
|
|
const { createMessage } = useMessage()
|
|
|
|
import { useI18n } from '/@/hooks/web/useI18n'
|
|
|
|
import { useI18n } from '/@/hooks/web/useI18n'
|
|
|
|
const { t } = useI18n()
|
|
|
|
const { t } = useI18n()
|
|
|
|
const props = defineProps({
|
|
|
|
const props = defineProps({
|
|
|
|
// 业务id
|
|
|
|
// 业务id
|
|
|
|
id: {
|
|
|
|
id: {
|
|
|
|
type: String
|
|
|
|
type: String
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 提单信息表
|
|
|
|
// 提单信息表
|
|
|
|
reload: {
|
|
|
|
reload: {
|
|
|
|
type: Function
|
|
|
|
type: Function
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
const emit = defineEmits(['createTask'])
|
|
|
|
|
|
|
|
// 引入处理入参方法
|
|
|
|
|
|
|
|
import { formatParams } from '/@/hooks/web/common'
|
|
|
|
|
|
|
|
const [registerTable, { reload, getSelectRows }] = useTable({
|
|
|
|
|
|
|
|
title: '',
|
|
|
|
|
|
|
|
api: async (p) => {
|
|
|
|
|
|
|
|
const res: API.DataResult = await GetAvailableBookingSlots(p)
|
|
|
|
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
|
|
|
|
resolve({ data: [...res.data], total: res.count })
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 请求前的参数格式化
|
|
|
|
|
|
|
|
beforeFetch: (p) => {
|
|
|
|
|
|
|
|
return formatParams(p)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
columns: storageColumns,
|
|
|
|
|
|
|
|
formConfig: {
|
|
|
|
|
|
|
|
labelWidth: 120,
|
|
|
|
|
|
|
|
// 表格表单需要的过滤字段集合
|
|
|
|
|
|
|
|
schemas: storageSearchFormSchema,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
maxHeight: 600,
|
|
|
|
|
|
|
|
isTreeTable: false,
|
|
|
|
|
|
|
|
pagination: true,
|
|
|
|
|
|
|
|
useSearchForm: true,
|
|
|
|
|
|
|
|
showTableSetting: false,
|
|
|
|
|
|
|
|
bordered: true,
|
|
|
|
|
|
|
|
showIndexColumn: true,
|
|
|
|
|
|
|
|
indexColumnProps: {
|
|
|
|
|
|
|
|
width: 60,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
rowSelection: {
|
|
|
|
|
|
|
|
type: 'radio'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
canResize: true,
|
|
|
|
|
|
|
|
resizeHeightOffset: 80
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
const visible = ref(false)
|
|
|
|
|
|
|
|
// 初始化组件
|
|
|
|
|
|
|
|
const init = () => {
|
|
|
|
|
|
|
|
visible.value = true
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const loading = ref(false)
|
|
|
|
})
|
|
|
|
const handleOk = () => {
|
|
|
|
const emit = defineEmits(['createTask'])
|
|
|
|
const slots = getSelectRows()
|
|
|
|
// 引入处理入参方法
|
|
|
|
if (!slots.length) return createMessage.warning('请选择舱位!')
|
|
|
|
import { formatParams } from '/@/hooks/web/common'
|
|
|
|
loading.value = true
|
|
|
|
const [registerTable, { getForm, reload, getSelectRows }] = useTable({
|
|
|
|
BringInBookingSlotToOrder({ seaExportId: props.id, slots }).then(res => {
|
|
|
|
title: '',
|
|
|
|
// createMessage.success(res.data)
|
|
|
|
api: async (p) => {
|
|
|
|
emit('createTask', 'WAIT_BOOKING')
|
|
|
|
const res: API.DataResult = await GetAvailableBookingSlots(p)
|
|
|
|
visible.value = false
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
loading.value = false
|
|
|
|
resolve({ data: [...res.data], total: res.count })
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
|
|
visible.value = false
|
|
|
|
|
|
|
|
loading.value = false
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
defineExpose({
|
|
|
|
// 请求前的参数格式化
|
|
|
|
init
|
|
|
|
beforeFetch: (p) => {
|
|
|
|
|
|
|
|
const data = formatParams(p)
|
|
|
|
|
|
|
|
const queryData = JSON.parse(formatParams(p).queryCondition)
|
|
|
|
|
|
|
|
let i = queryData.length
|
|
|
|
|
|
|
|
while (i--) {
|
|
|
|
|
|
|
|
if (queryData[i].FieldName === 'slotNo') {
|
|
|
|
|
|
|
|
queryData.splice(i, 1)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
data.queryCondition = JSON.stringify(queryData)
|
|
|
|
|
|
|
|
data.otherQueryCondition = {}
|
|
|
|
|
|
|
|
data.otherQueryCondition = getForm().getFieldsValue().slotNo
|
|
|
|
|
|
|
|
return data
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
columns: storageColumns,
|
|
|
|
|
|
|
|
formConfig: {
|
|
|
|
|
|
|
|
labelWidth: 120,
|
|
|
|
|
|
|
|
// 表格表单需要的过滤字段集合
|
|
|
|
|
|
|
|
schemas: storageSearchFormSchema,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
maxHeight: 600,
|
|
|
|
|
|
|
|
isTreeTable: false,
|
|
|
|
|
|
|
|
pagination: true,
|
|
|
|
|
|
|
|
useSearchForm: true,
|
|
|
|
|
|
|
|
showTableSetting: false,
|
|
|
|
|
|
|
|
bordered: true,
|
|
|
|
|
|
|
|
showIndexColumn: true,
|
|
|
|
|
|
|
|
indexColumnProps: {
|
|
|
|
|
|
|
|
width: 60,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
rowSelection: {
|
|
|
|
|
|
|
|
type: 'radio'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
canResize: true,
|
|
|
|
|
|
|
|
resizeHeightOffset: 80
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
const visible = ref(false)
|
|
|
|
|
|
|
|
// 初始化组件
|
|
|
|
|
|
|
|
const init = () => {
|
|
|
|
|
|
|
|
visible.value = true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
|
|
|
const handleOk = () => {
|
|
|
|
|
|
|
|
const slots = getSelectRows()
|
|
|
|
|
|
|
|
if (!slots.length) return createMessage.warning('请选择舱位!')
|
|
|
|
|
|
|
|
loading.value = true
|
|
|
|
|
|
|
|
BringInBookingSlotToOrder({ seaExportId: props.id, slots }).then(res => {
|
|
|
|
|
|
|
|
// createMessage.success(res.data)
|
|
|
|
|
|
|
|
emit('createTask', 'WAIT_BOOKING')
|
|
|
|
|
|
|
|
visible.value = false
|
|
|
|
|
|
|
|
loading.value = false
|
|
|
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
|
|
visible.value = false
|
|
|
|
|
|
|
|
loading.value = false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
defineExpose({
|
|
|
|
|
|
|
|
init
|
|
|
|
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="less">
|
|
|
|
<style lang="less"></style>
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|