箱管 批量导出 以及 上线下线

zth
张同海 2 weeks ago
parent 6150236abc
commit 195d8970e7

@ -31,6 +31,14 @@
<span class="iconfont icon-Excel"></span>
导出待上线
</a-button>
<a-button type="link" class="pl0" @click="BatchUp">
<span class="iconfont icon-tidanqianru"></span>
批量上线
</a-button>
<a-button type="link" class="pl0" @click="BatchUnder">
<span class="iconfont icon-tidanqianchu"></span>
批量下线
</a-button>
<!-- <a-button type="link" @click="handleSave(false)" class="pl0">
<span class="iconfont icon-baocun" v-repeat></span>
保存
@ -122,7 +130,7 @@
import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index'
import { formSchema, InfoColumns } from './columns'
import { ApiEdit, ApiInfo, ApiDelDetail, ApiImport, ApiGetDSX } from './api'
import { ApiEdit, ApiInfo, ApiDelDetail, ApiImport } from './api'
import { ApiDealExcel } from '/@/views/ContainerManagement/RentIn/api'
import { ExportExcelByColumn } from '/@/api/common'
//
@ -608,23 +616,25 @@
})
}
}
async function derivedExcel() {
// let ids: any = []
// list.value.forEach((e: any, i) => {
// if (e.selected) {
// if (e.id) {
// console.log(BigInt(e.id))
function BatchUp() {
list.value.forEach((e: any, i) => {
if (e.selected) {
console.log(isOnlineDict.value)
// ids.push(e.id)
// }
// }
// })
// if (ids.length) {
// const res = await ApiGetDSX({ ids: ids })
// if (res.succeeded) {
// console.log(res)
// }
// } else {
e.isOnlineId = 1
e.isOnline = '上线'
}
})
}
function BatchUnder() {
list.value.forEach((e: any, i) => {
if (e.selected) {
e.isOnlineId = -1
e.isOnline = '下线'
}
})
}
async function derivedExcel() {
let ApiData: any = {
columnSets: [],
jsonDataStr: [],
@ -659,6 +669,5 @@
document.body.appendChild(link)
link.click()
})
// }
}
</script>

@ -8,6 +8,12 @@ export const columns: BasicColumn[] = [
sorter: true,
width: 150,
},
{
title: '待上线明细',
dataIndex: 'dsx',
sorter: true,
width: 100,
},
{
title: '导入人',
dataIndex: 'createUserName',

@ -17,6 +17,10 @@
删除
</a-button>
</a-popconfirm>
<a-button type="link" @click="derivedExcel">
<span class="iconfont icon-Excel"></span>
导出待上线
</a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
@ -38,7 +42,8 @@
<script lang="ts" setup>
import { ref } from 'vue'
import { BasicTable, useTable, TableAction, SorterResult } from '/@/components/Table'
import { ApiList, ApiDel } from './api'
import { ApiList, ApiDel, ApiGetDSX } from './api'
import { ExportExcelByColumn } from '/@/api/common'
import { useModal } from '/@/components/Modal'
import TenantAuditStepModal from './TenantAuditStepModal.vue'
import { columns, searchFormSchema } from './columns'
@ -109,6 +114,147 @@
reload()
})
}
const DSXcolumns = [
{
title: '箱号',
width: 120,
data: 'cntrno',
readOnly: false,
},
{
title: '箱型',
width: 120,
data: 'ctnall',
},
{
title: '箱来源',
width: 120,
data: 'ctnSource',
},
{
title: '是否上线',
width: 120,
data: 'isOnline',
type: 'dropdown',
readOnly: false,
},
{
title: '识别备注',
width: 200,
data: 'dealRemark',
},
{
title: '箱流转状态',
width: 120,
data: 'ctnFlowState',
},
{
title: '状态日期',
width: 120,
data: 'changeTime',
},
{
title: '当前箱业务状态',
width: 120,
data: 'ctnBizState',
},
{
title: '关联合同号',
width: 120,
data: 'ctnReleaseNo',
},
{
title: '当前港口',
width: 120,
data: 'port',
},
{
title: '始发港',
width: 120,
data: 'portLoad',
},
{
title: '目的港',
width: 120,
data: 'portDelivery',
},
{
title: '预抵港',
width: 120,
data: 'portDischarge',
},
{
title: '场站/码头',
width: 120,
data: 'depot',
},
{
title: '船名',
width: 120,
data: 'vessel',
},
{
title: '航次',
width: 120,
data: 'voyno',
},
{
title: '业务编号',
width: 120,
data: 'mblno',
},
{
title: '备注',
width: 120,
data: 'remark',
},
]
function derivedExcel() {
const select = getSelectRows()
let ApiData: any = {
ids: [],
}
if (select.length === 0) {
notification.warning({ message: '请至少选择一条数据', duration: 3 })
return false
} else {
ApiData.ids = select.map((item) => {
return item.id
})
}
ApiGetDSX(ApiData).then((res) => {
console.log(res.data)
let ApiData: any = {
columnSets: [],
jsonDataStr: [],
}
DSXcolumns.forEach((item, index) => {
ApiData.columnSets.push({
title: item.title,
enTitle: item.data,
dataIndex: item.data,
visible: true,
})
})
ApiData.jsonDataStr = JSON.stringify(res.data)
ExportExcelByColumn(ApiData).then((res) => {
const xlsUrl = window.URL.createObjectURL(
new Blob([res], {
type: 'application/vnd.ms-excel;charset=utf-8',
}),
)
const fname = '待上线数据'
const link = document.createElement('a')
link.href = xlsUrl
link.setAttribute('download', fname)
document.body.appendChild(link)
link.click()
})
})
}
function handleAudit(record) {
openModal(true, {
record,

Loading…
Cancel
Save