|
|
|
@ -9,12 +9,7 @@
|
|
|
|
|
<span class="iconfont icon-new_document"></span>
|
|
|
|
|
新建
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-popconfirm
|
|
|
|
|
title="确定删除当前选中订舱?"
|
|
|
|
|
ok-text="是"
|
|
|
|
|
cancel-text="否"
|
|
|
|
|
@confirm="removeMoreFun"
|
|
|
|
|
>
|
|
|
|
|
<a-popconfirm title="确定删除当前选中订舱?" ok-text="是" cancel-text="否" @confirm="removeMoreFun">
|
|
|
|
|
<a-button type="link">
|
|
|
|
|
<span class="iconfont icon-shanchu1"></span>
|
|
|
|
|
删除
|
|
|
|
@ -33,25 +28,14 @@
|
|
|
|
|
<span class="iconfont icon-a-xiaopiaofapiao-01"></span>
|
|
|
|
|
小票状态
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-modal
|
|
|
|
|
title="输入复制数量"
|
|
|
|
|
:visible="copyMoreFlag"
|
|
|
|
|
:footer="null"
|
|
|
|
|
@cancel="copyMoreFlag = false"
|
|
|
|
|
>
|
|
|
|
|
<a-form
|
|
|
|
|
ref="RefcopyMoreForm"
|
|
|
|
|
:model="copyMoreForm"
|
|
|
|
|
:label-col="{ span: 5 }"
|
|
|
|
|
:wrapper-col="{ span: 12 }"
|
|
|
|
|
@submit="handleSubmitCopyMore"
|
|
|
|
|
:style="{ padding: '10px' }"
|
|
|
|
|
>
|
|
|
|
|
<a-form-item
|
|
|
|
|
label="数量"
|
|
|
|
|
name="number"
|
|
|
|
|
:rules="[{ required: true, message: '请输入数量' }]"
|
|
|
|
|
>
|
|
|
|
|
<a-button type="link" @click="openYz">
|
|
|
|
|
<span class="iconfont icon-a-xiaopiaofapiao-01"></span>
|
|
|
|
|
运踪订阅
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-modal title="输入复制数量" :visible="copyMoreFlag" :footer="null" @cancel="copyMoreFlag = false">
|
|
|
|
|
<a-form ref="RefcopyMoreForm" :model="copyMoreForm" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }"
|
|
|
|
|
@submit="handleSubmitCopyMore" :style="{ padding: '10px' }">
|
|
|
|
|
<a-form-item label="数量" name="number" :rules="[{ required: true, message: '请输入数量' }]">
|
|
|
|
|
<a-input-number :min="1" :max="10" v-model:value="copyMoreForm.number" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-form-item :wrapper-col="{ span: 12, offset: 5 }">
|
|
|
|
@ -59,151 +43,229 @@
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form>
|
|
|
|
|
</a-modal>
|
|
|
|
|
<!-- 运踪弹窗 -->
|
|
|
|
|
<a-modal width="500px" class="ds-modal-small" :maskClosable="false" v-model:visible="traceModalVisible"
|
|
|
|
|
title="运踪订阅">
|
|
|
|
|
<div class="modal-card">
|
|
|
|
|
<a-form ref="traceRef" class="ds-detail-form" layout="vertical" :model="traceForm" :rules="rules">
|
|
|
|
|
<a-form-item label="请选择订阅内容" name="traceValue">
|
|
|
|
|
<a-checkbox-group class="trace-check" v-model:value="traceForm.traceValue" :options="traceOptions" />
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form>
|
|
|
|
|
</div>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<a-button @click="traceModalVisible = false">关闭</a-button>
|
|
|
|
|
<a-button :loading="tloading" type="primary" @click="traceSend">订阅</a-button>
|
|
|
|
|
</template>
|
|
|
|
|
</a-modal>
|
|
|
|
|
<BatchModification @register="registerModal" @success="BMSuccess" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { onMounted, ref, defineProps, reactive } from 'vue'
|
|
|
|
|
import { useGo } from '/@/hooks/web/usePage'
|
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
|
import { useRouter } from 'vue-router'
|
|
|
|
|
import { useModal } from '/@/components/Modal'
|
|
|
|
|
import { SeaExportBatchDel, SaveBookingTxxp, CommonExcelExport } from '../api/BookingLedger.js'
|
|
|
|
|
import BatchModification from '../modules/BatchModification.vue'
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
const { createMessage } = useMessage()
|
|
|
|
|
const go = useGo()
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
selectRow: {
|
|
|
|
|
type: Function,
|
|
|
|
|
},
|
|
|
|
|
reload: {
|
|
|
|
|
type: Function,
|
|
|
|
|
import { onMounted, ref, defineProps, reactive } from 'vue'
|
|
|
|
|
import { useGo } from '/@/hooks/web/usePage'
|
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'
|
|
|
|
|
import { useRouter } from 'vue-router'
|
|
|
|
|
import { useModal } from '/@/components/Modal'
|
|
|
|
|
import { SeaExportBatchDel, SaveBookingTxxp, CommonExcelExport,SendTrace } from '../api/BookingLedger.js'
|
|
|
|
|
import BatchModification from '../modules/BatchModification.vue'
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
const { createMessage } = useMessage()
|
|
|
|
|
const go = useGo()
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
selectRow: {
|
|
|
|
|
type: Function,
|
|
|
|
|
},
|
|
|
|
|
reload: {
|
|
|
|
|
type: Function,
|
|
|
|
|
},
|
|
|
|
|
columns: {
|
|
|
|
|
type: Array,
|
|
|
|
|
default: () => {
|
|
|
|
|
return []
|
|
|
|
|
},
|
|
|
|
|
columns: {
|
|
|
|
|
type: Array,
|
|
|
|
|
default: () => {
|
|
|
|
|
return []
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
queryData: {
|
|
|
|
|
type: Object,
|
|
|
|
|
default: {},
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
// 新建
|
|
|
|
|
function addBooking() {
|
|
|
|
|
const addNum = Math.round(Math.random() * 1000)
|
|
|
|
|
go(`/BookingDetail?addNum=${addNum}`)
|
|
|
|
|
},
|
|
|
|
|
queryData: {
|
|
|
|
|
type: Object,
|
|
|
|
|
default: {},
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
// 新建
|
|
|
|
|
function addBooking() {
|
|
|
|
|
const addNum = Math.round(Math.random() * 1000)
|
|
|
|
|
go(`/BookingDetail?addNum=${addNum}`)
|
|
|
|
|
}
|
|
|
|
|
const copyMoreFlag = ref(false)
|
|
|
|
|
const copyMoreForm = reactive({
|
|
|
|
|
number: 1,
|
|
|
|
|
})
|
|
|
|
|
// 批量编辑 弹窗
|
|
|
|
|
const [registerModal, { openModal }] = useModal()
|
|
|
|
|
// 批量编辑开关
|
|
|
|
|
const batchFlag = ref(false)
|
|
|
|
|
// 批量编辑
|
|
|
|
|
function batchEditing() {
|
|
|
|
|
const select = props.selectRow()
|
|
|
|
|
if (select.length === 0) {
|
|
|
|
|
createMessage.warning('请选择操作订单!')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
const copyMoreFlag = ref(false)
|
|
|
|
|
const copyMoreForm = reactive({
|
|
|
|
|
number: 1,
|
|
|
|
|
const removeArr = select.map((item) => {
|
|
|
|
|
return item.id
|
|
|
|
|
})
|
|
|
|
|
// 批量编辑 弹窗
|
|
|
|
|
const [registerModal, { openModal }] = useModal()
|
|
|
|
|
// 批量编辑开关
|
|
|
|
|
const batchFlag = ref(false)
|
|
|
|
|
// 批量编辑
|
|
|
|
|
function batchEditing() {
|
|
|
|
|
const select = props.selectRow()
|
|
|
|
|
if (select.length === 0) {
|
|
|
|
|
createMessage.warning('请选择操作订单!')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
const removeArr = select.map((item) => {
|
|
|
|
|
return item.id
|
|
|
|
|
})
|
|
|
|
|
batchFlag.value = true
|
|
|
|
|
openModal(true, { removeArr, flag: true })
|
|
|
|
|
}
|
|
|
|
|
function BMSuccess() {
|
|
|
|
|
props.reload()
|
|
|
|
|
}
|
|
|
|
|
// 删除
|
|
|
|
|
function removeMoreFun() {
|
|
|
|
|
const select = props.selectRow()
|
|
|
|
|
if (select.length === 0) {
|
|
|
|
|
createMessage.warning('请选择操作订单!')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
const removeArr = select.map((item) => {
|
|
|
|
|
return item.id
|
|
|
|
|
})
|
|
|
|
|
deleteBookingOrder(removeArr)
|
|
|
|
|
batchFlag.value = true
|
|
|
|
|
openModal(true, { removeArr, flag: true })
|
|
|
|
|
}
|
|
|
|
|
function BMSuccess() {
|
|
|
|
|
props.reload()
|
|
|
|
|
}
|
|
|
|
|
// 删除
|
|
|
|
|
function removeMoreFun() {
|
|
|
|
|
const select = props.selectRow()
|
|
|
|
|
if (select.length === 0) {
|
|
|
|
|
createMessage.warning('请选择操作订单!')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
const eLoading = ref(false)
|
|
|
|
|
// 批量导出excel
|
|
|
|
|
const exportExcel = () => {
|
|
|
|
|
const postData = {
|
|
|
|
|
url: 'http://118.190.144.189:3008/opApi/SeaExport/GetSeaExportList',
|
|
|
|
|
queryRequest: props.queryData,
|
|
|
|
|
columnSets: props.columns,
|
|
|
|
|
}
|
|
|
|
|
postData.queryRequest.pageCondition['isExport'] = true
|
|
|
|
|
eLoading.value = true
|
|
|
|
|
CommonExcelExport(postData)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
eLoading.value = false
|
|
|
|
|
const xlsUrl = window.URL.createObjectURL(
|
|
|
|
|
new Blob([res], {
|
|
|
|
|
type: 'application/vnd.ms-excel;charset=utf-8',
|
|
|
|
|
}),
|
|
|
|
|
)
|
|
|
|
|
const fname = '订舱台账.xlsx'
|
|
|
|
|
const link = document.createElement('a')
|
|
|
|
|
link.href = xlsUrl
|
|
|
|
|
link.setAttribute('download', fname)
|
|
|
|
|
document.body.appendChild(link)
|
|
|
|
|
link.click()
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
eLoading.value = false
|
|
|
|
|
})
|
|
|
|
|
const removeArr = select.map((item) => {
|
|
|
|
|
return item.id
|
|
|
|
|
})
|
|
|
|
|
deleteBookingOrder(removeArr)
|
|
|
|
|
}
|
|
|
|
|
const eLoading = ref(false)
|
|
|
|
|
// 批量导出excel
|
|
|
|
|
const exportExcel = () => {
|
|
|
|
|
const postData = {
|
|
|
|
|
url: 'http://118.190.144.189:3008/opApi/SeaExport/GetSeaExportList',
|
|
|
|
|
queryRequest: props.queryData,
|
|
|
|
|
columnSets: props.columns,
|
|
|
|
|
}
|
|
|
|
|
// 删除方法
|
|
|
|
|
function deleteBookingOrder(arr) {
|
|
|
|
|
let api = []
|
|
|
|
|
arr.forEach((e, i) => {
|
|
|
|
|
api.push(e)
|
|
|
|
|
postData.queryRequest.pageCondition['isExport'] = true
|
|
|
|
|
eLoading.value = true
|
|
|
|
|
CommonExcelExport(postData)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
eLoading.value = false
|
|
|
|
|
const xlsUrl = window.URL.createObjectURL(
|
|
|
|
|
new Blob([res], {
|
|
|
|
|
type: 'application/vnd.ms-excel;charset=utf-8',
|
|
|
|
|
}),
|
|
|
|
|
)
|
|
|
|
|
const fname = '订舱台账.xlsx'
|
|
|
|
|
const link = document.createElement('a')
|
|
|
|
|
link.href = xlsUrl
|
|
|
|
|
link.setAttribute('download', fname)
|
|
|
|
|
document.body.appendChild(link)
|
|
|
|
|
link.click()
|
|
|
|
|
})
|
|
|
|
|
SeaExportBatchDel({ ids: api })
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
createMessage.success('删除成功!')
|
|
|
|
|
props.reload()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const xGrid = ref()
|
|
|
|
|
const txxpForm = ref({})
|
|
|
|
|
const test = () => {
|
|
|
|
|
createMessage.warning('开发中!')
|
|
|
|
|
}
|
|
|
|
|
// 小票状态
|
|
|
|
|
function handleSearchTxxp() {
|
|
|
|
|
return
|
|
|
|
|
const select = xGrid.value.getCheckboxRecords()
|
|
|
|
|
if (select.length === 0) {
|
|
|
|
|
createMessage.warning('请选择操作订单!')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
const pkIdArr = select.map((item, index) => {
|
|
|
|
|
return item.id
|
|
|
|
|
.catch(() => {
|
|
|
|
|
eLoading.value = false
|
|
|
|
|
})
|
|
|
|
|
SaveBookingTxxp({ Id: pkIdArr[0] }).then((res) => {
|
|
|
|
|
}
|
|
|
|
|
// 删除方法
|
|
|
|
|
function deleteBookingOrder(arr) {
|
|
|
|
|
let api = []
|
|
|
|
|
arr.forEach((e, i) => {
|
|
|
|
|
api.push(e)
|
|
|
|
|
})
|
|
|
|
|
SeaExportBatchDel({ ids: api })
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
txxpForm.value = res.data
|
|
|
|
|
createMessage.success('删除成功!')
|
|
|
|
|
props.reload()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
console.log(err)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const xGrid = ref()
|
|
|
|
|
const txxpForm = ref({})
|
|
|
|
|
const test = () => {
|
|
|
|
|
createMessage.warning('开发中!')
|
|
|
|
|
}
|
|
|
|
|
// 小票状态
|
|
|
|
|
function handleSearchTxxp() {
|
|
|
|
|
return
|
|
|
|
|
const select = xGrid.value.getCheckboxRecords()
|
|
|
|
|
if (select.length === 0) {
|
|
|
|
|
createMessage.warning('请选择操作订单!')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
const pkIdArr = select.map((item, index) => {
|
|
|
|
|
return item.id
|
|
|
|
|
})
|
|
|
|
|
SaveBookingTxxp({ Id: pkIdArr[0] }).then((res) => {
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
txxpForm.value = res.data
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const traceModalVisible = ref(false)
|
|
|
|
|
// 运踪弹窗部分
|
|
|
|
|
const traceForm = reactive({
|
|
|
|
|
traceValue: [],
|
|
|
|
|
})
|
|
|
|
|
const rules = {
|
|
|
|
|
traceValue: [
|
|
|
|
|
{
|
|
|
|
|
type: 'array',
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请选择订阅内容',
|
|
|
|
|
trigger: 'change',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
}
|
|
|
|
|
const traceOptions = [
|
|
|
|
|
{ label: '起运港', value: '1' },
|
|
|
|
|
{ label: '目的港', value: '2' },
|
|
|
|
|
]
|
|
|
|
|
const traceRef = ref(null)
|
|
|
|
|
const tloading = ref(false)
|
|
|
|
|
function openYz() {
|
|
|
|
|
const select = props.selectRow()
|
|
|
|
|
if (select.length === 0) {
|
|
|
|
|
createMessage.warning('请选择操作订单!')
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
traceModalVisible.value = true
|
|
|
|
|
}
|
|
|
|
|
// 订阅运踪
|
|
|
|
|
function traceSend() {
|
|
|
|
|
traceRef.value.validate().then(() => {
|
|
|
|
|
tloading.value = true
|
|
|
|
|
const select = props.selectRow()
|
|
|
|
|
const arr = [] as any
|
|
|
|
|
select.forEach((item) => {
|
|
|
|
|
arr.push({
|
|
|
|
|
businessId: item.id,
|
|
|
|
|
mblno: item.mblno,
|
|
|
|
|
yard: traceForm.traceValue.includes('1') ? item.yard : '',
|
|
|
|
|
yardId: traceForm.traceValue.includes('1') ? item.yardId : '',
|
|
|
|
|
carrierId: traceForm.traceValue.includes('2') ? item.carrierId : '',
|
|
|
|
|
carrier: traceForm.traceValue.includes('2') ? item.carrier : '',
|
|
|
|
|
isBook: !!traceForm.traceValue.includes('2'),
|
|
|
|
|
isFrontPort: !!traceForm.traceValue.includes('1'),
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
SendTrace(arr)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
tloading.value = false
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
createMessage.success('订阅成功!')
|
|
|
|
|
traceModalVisible.value = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
tloading.value = false
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
console.log('error', error)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
.ds-table-action-bar {
|
|
|
|
|
display: flex;
|
|
|
|
|
}
|
|
|
|
|
.ds-table-action-bar {
|
|
|
|
|
display: flex;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|