Compare commits

...

3 Commits

Author SHA1 Message Date
张同海 2bacecf3d2 Merge branch 'zth' into dev 3 days ago
张同海 b46f7d2b26 箱管 调整 3 days ago
sunzehua 58340421cc 修改问题 4 days ago

@ -34,7 +34,7 @@ const baseApiUrl = globSetting.apiUrl
const service = axios.create({
// baseURL: baseApiUrl,
timeout: 20000,
timeout: 120000,
})
service.interceptors.request.use(

@ -40,6 +40,12 @@ export const columns: BasicColumn[] = [
sorter: true,
width: 150,
},
{
title: '是否上线',
dataIndex: 'isOnline',
sorter: true,
width: 200,
},
{
title: '序号',
dataIndex: 'index',
@ -176,12 +182,6 @@ export const columns: BasicColumn[] = [
// sorter: true,
// width: 200,
// },
// {
// title: '是否上线',
// dataIndex: 'isOnline',
// sorter: true,
// width: 200,
// },
// {
// title: '当前港口',
@ -223,6 +223,17 @@ export const columns: BasicColumn[] = [
]
export const searchFormSchema: FormSchema[] = [
{
field: 'cntrno',
label: '箱号',
component: 'InputTextArea',
colProps: { span: 8 },
componentProps: {
validateOnRuleChange: false,
placeholder: '可输入多个箱号',
rows: 1,
},
},
{
field: 'ctnOwner',
label: '箱主',
@ -342,17 +353,6 @@ export const searchFormSchema: FormSchema[] = [
component: 'InputNumber',
colProps: { span: 4 },
},
{
field: 'cntrno',
label: '箱号',
component: 'InputTextArea',
colProps: { span: 8 },
componentProps: {
validateOnRuleChange: false,
placeholder: '可输入多个箱号',
rows: 1,
},
},
{
field: 'portid',
label: '当前港口',

@ -2,10 +2,10 @@
<div>
<BasicTable class="ds-table" @register="registerTable">
<template #tableTitle>
<!-- <a-button type="link" @click="handleCreate">
<span class="iconfont icon-piliangbianji"></span>
批量维护
</a-button> -->
<a-button type="link" class="pl0" @click="derivedExcel">
<span class="iconfont icon-Excel"></span>
导出待上线
</a-button>
</template>
<template #bodyCell="{ column, record }">
<!-- <template v-if="column.key === 'action'">
@ -47,6 +47,7 @@
import { BasicTable, useTable, TableAction, SorterResult } from '/@/components/Table'
import InfoModal from './infoModal.vue'
import { ApiList } from './api'
import { ExportExcelByColumn } from '/@/api/common'
import { useModal } from '/@/components/Modal'
import TenantAuditStepModal from './TenantAuditStepModal.vue'
import { columns, searchFormSchema } from './columns'
@ -56,11 +57,36 @@
const refInfoModal = ref()
const [registerModal, { openModal }] = useModal()
const [registerInfoModal, { openModal: openInfoModal }] = useModal()
const [registerTable, { reload, getForm, getSelectRows }] = useTable({
const [registerTable, { reload, getForm, getVxeSelectRows }] = useTable({
title: '集装箱信息列表',
api: async (p) => {
const res: API.DataResult = await ApiList(p)
let type = true
JSON.parse(p.queryCondition).forEach((e) => {
if (e.FieldName == 'isOnlineId') {
type = false
}
})
if (type) {
let MessageArr: any = []
res.data.forEach((item) => {
if (item.isOnlineId == 0) {
MessageArr.push(item.cntrno)
}
})
if (MessageArr.length) {
let txt = `${MessageArr.length}个待上线:`
for (let i = 0; i < 5; i++) {
if (MessageArr[i]) {
txt = i == 0 ? `${txt} ${MessageArr[i]}` : `${txt},\n${MessageArr[i]}`
}
}
notification.warning({
message: MessageArr.length > 5 ? `${txt}...` : txt,
duration: 6000,
})
}
}
res.data.forEach((item, index) => {
item.index = index + 1
})
@ -177,7 +203,7 @@
autoHeight: window.innerHeight - 250,
})
function handleCreate() {
const select = getSelectRows()
const select = getVxeSelectRows()
openModal(true, {
isParent: false,
isUpdate: false,
@ -192,4 +218,43 @@
function handleSuccess() {
reload()
}
function derivedExcel() {
let ApiData: any = {
columnSets: [],
jsonDataStr: [],
}
columns.forEach((item) => {
ApiData.columnSets.push({
title: item.title,
enTitle: item.dataIndex,
dataIndex: item.dataIndex,
visible: true,
})
})
console.log(getVxeSelectRows())
getVxeSelectRows().forEach((item: any) => {
console.log(item, item.isOnlineId)
if (item.isOnlineId === 0) {
item.isHeavy = item.isHeavy ? '重箱' : '空箱'
ApiData.jsonDataStr.push(item)
}
})
ApiData.jsonDataStr = JSON.stringify(ApiData.jsonDataStr)
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()
})
}
</script>

@ -4,14 +4,28 @@
<BasicTable class="ds-table" @register="registerTableTop"> </BasicTable>
</div>
<div>
<a-button type="link" @click="FnAudit(true, 'confirm')">
<span class="iconfont icon-yiwancheng2-copy" :style="{ fontSize: '13px' }"></span>
整票审核通过
</a-button>
<a-button type="link" @click="FnAudit(false, 'confirm')">
<span class="iconfont icon-yiwancheng2-copy" :style="{ fontSize: '13px' }"></span>
选中审核通过
</a-button>
<a-popconfirm
title="将会审核选中的最后一条整票,是否确认?"
ok-text="是"
cancel-text="否"
@confirm="FnAudit(true, 'confirm')"
>
<a-button type="link">
<span class="iconfont icon-yiwancheng2-copy" :style="{ fontSize: '13px' }"></span>
整票审核通过
</a-button>
</a-popconfirm>
<a-popconfirm
title="是否确认审核通过?"
ok-text="是"
cancel-text="否"
@confirm="FnAudit(false, 'confirm')"
>
<a-button type="link">
<span class="iconfont icon-yiwancheng2-copy" :style="{ fontSize: '13px' }"></span>
选中审核通过
</a-button>
</a-popconfirm>
<a-button type="link" @click="FnAudit(true, 'cancel')">
<span class="iconfont icon-bohui-01" :style="{ fontSize: '13px' }"></span>
整票驳回
@ -20,6 +34,10 @@
<span class="iconfont icon-bohui-01" :style="{ fontSize: '13px' }"></span>
驳回选中行
</a-button>
<a-button type="link" class="pl0" @click="derivedExcel">
<span class="iconfont icon-Excel"></span>
导出审核通过
</a-button>
</div>
<div>
<BasicTable class="ds-table" @register="registerTableBotton"> </BasicTable>
@ -40,69 +58,84 @@
import { BasicTable, useTable } from '/@/components/Table'
import { BasicForm, useForm } from '/@/components/Form/index'
import { ApiList, ApiDetailList, ApiConfirm, ApiCancel } from './api'
import { ExportExcelByColumn } from '/@/api/common'
import { columns, searchFormSchema, detailColumns } from './columns'
import { useMessage } from '/@/hooks/web/useMessage'
const { notification } = useMessage()
//
import { formatParams } from '/@/hooks/web/common'
const [registerTableTop, { reload, clearSelectedRowKeys, getSelectRows }] = useTable({
title: '',
api: async (p) => {
clearSelectedRowKeys()
getSelectRowsBotton()
const res: API.DataResult = await ApiList(p)
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
})
},
beforeFetch: (p) => {
let Rdata = formatParams(p)
let data = JSON.parse(Rdata.queryCondition)
data.forEach((item) => {
if (item.FieldName == 'cntrnoall') {
item.FieldValue = item.FieldValue.replace(/ {1,}/g, ',')
item.FieldValue = item.FieldValue.replace(/\n/g, ',')
item.ConditionalType = 15
}
})
Rdata.queryCondition = JSON.stringify(data)
return Rdata
},
columns,
rowSelection: {
type: 'radio',
onChange: () => {
reloadBotton()
const TopSelectLast = ref('')
const [registerTableTop, { reload, clearSelectedRowKeys, setSelectedRowKeys, getSelectRows }] =
useTable({
title: '',
api: async (p) => {
clearSelectedRowKeys()
getSelectRowsBotton()
const res: API.DataResult = await ApiList(p)
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
})
},
},
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
},
pagination: true,
striped: true,
useSearchForm: true,
showTableSetting: false,
bordered: true,
showIndexColumn: true,
indexColumnProps: {
width: 60,
},
canResize: true,
resizeHeightOffset: 335,
immediate: true,
})
beforeFetch: (p) => {
let Rdata = formatParams(p)
let data = JSON.parse(Rdata.queryCondition)
data.forEach((item) => {
if (item.FieldName == 'cntrnoall') {
item.FieldValue = item.FieldValue.replace(/ {1,}/g, ',')
item.FieldValue = item.FieldValue.replace(/\n/g, ',')
item.ConditionalType = 15
}
})
Rdata.queryCondition = JSON.stringify(data)
return Rdata
},
columns,
rowKey: 'id',
rowSelection: {
// type: 'radio',
type: 'checkbox',
onChange: (e, a) => {
TopSelectLast.value = JSON.stringify(a[a.length - 1])
reloadBotton()
},
},
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
},
pagination: true,
striped: true,
useSearchForm: true,
showTableSetting: false,
bordered: true,
showIndexColumn: true,
indexColumnProps: {
width: 60,
},
canResize: true,
resizeHeightOffset: 335,
immediate: true,
})
const derivedObj = ref('{}')
const [registerTableBotton, { reload: reloadBotton, getSelectRows: getSelectRowsBotton }] =
useTable({
title: '',
api: async (p) => {
const res: API.DataResult = await ApiDetailList(p)
if (JSON.parse(TopSelectLast.value).billState == 1100) {
let Obj = JSON.parse(derivedObj.value)
if (!Obj[JSON.parse(TopSelectLast.value).id]) {
Obj[JSON.parse(TopSelectLast.value).id] = res.data
}
derivedObj.value = JSON.stringify(Obj)
}
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
})
},
beforeFetch: (p) => {
p['Pid'] = getSelectRows()[0].id
// p['Pid'] = getSelectRows()[0].id
p['Pid'] = JSON.parse(TopSelectLast.value).id
return formatParams(p)
},
columns: detailColumns,
@ -130,8 +163,8 @@
}
try {
if (type) {
if (getSelectRows()[0]?.id) {
ApiData.id = getSelectRows()[0].id
if (JSON.parse(TopSelectLast.value)?.id) {
ApiData.id = JSON.parse(TopSelectLast.value).id
} else {
notification.warning({ message: '请选择一条数据', duration: 3 })
throw new Error('请选择一条数据')
@ -141,13 +174,13 @@
getSelectRowsBotton().forEach((item) => {
ApiData.ids.push(item.id)
})
ApiData.id = getSelectRows()[0].id
ApiData.id = JSON.parse(TopSelectLast.value).id
} else {
notification.warning({ message: '请至少选择一条数据', duration: 3 })
throw new Error('请至少选择一条数据')
}
}
ApiData.businessType = getSelectRows()[0]?.ctnBizStateId
ApiData.businessType = JSON.parse(TopSelectLast.value)?.ctnBizStateId
if (state == 'cancel') {
Ctype.value = type
CApiData.value = JSON.stringify(ApiData)
@ -160,6 +193,10 @@
}
}
async function FnExamine(type, state, ApiData) {
if (state == 'confirm' && type) {
clearSelectedRowKeys()
setSelectedRowKeys([JSON.parse(TopSelectLast.value)?.id])
}
let res: any = state == 'confirm' ? await ApiConfirm(ApiData) : await ApiCancel(ApiData)
if (res.succeeded) {
notification.success({ message: res.message, duration: 3 })
@ -204,6 +241,44 @@
modalResetFields()
visible.value = false
}
function derivedExcel() {
let ApiData: any = {
columnSets: [],
jsonDataStr: [],
}
detailColumns.forEach((item) => {
ApiData.columnSets.push({
title: item.title,
enTitle: item.dataIndex,
dataIndex: item.dataIndex,
visible: true,
})
})
getSelectRows().forEach((item) => {
let Obj = JSON.parse(derivedObj.value)
if (Obj[item.id]) {
ApiData.jsonDataStr = [...ApiData.jsonDataStr, ...Obj[item.id]]
}
})
if (ApiData.jsonDataStr.length) {
ApiData.jsonDataStr = JSON.stringify(ApiData.jsonDataStr)
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()
})
} else {
notification.warning({ message: '请选择审核通过数据。', duration: 3 })
}
}
</script>
<style lang="less" scoped>
:deep(.ant-table-column-sorters) {

@ -27,6 +27,12 @@ export const columns: BasicColumn[] = [
sorter: true,
width: 100,
},
{
title: '是否上线',
dataIndex: 'isOnline',
sorter: true,
width: 200,
},
{
title: '新旧箱',
dataIndex: 'usedState',
@ -75,17 +81,20 @@ export const columns: BasicColumn[] = [
sorter: true,
width: 200,
},
{
title: '是否上线',
dataIndex: 'isOnline',
sorter: true,
width: 200,
},
{
title: '空重',
dataIndex: 'isHeavy',
sorter: true,
width: 200,
customRender: ({ text }) => {
if (text) {
return <Tag color="success"></Tag>
} else {
return <Tag color="error"></Tag>
}
return text
},
},
{
title: '当前港口',
@ -150,22 +159,34 @@ export const columns: BasicColumn[] = [
]
export const searchFormSchema: FormSchema[] = [
// {
// field: 'cntrno',
// label: '箱号',
// component: 'Input',
// colProps: { span: 4 },
// },
{
field: 'cntrno',
label: '箱号',
component: 'Input',
colProps: { span: 4 },
component: 'InputTextArea',
colProps: { span: 8 },
componentProps: {
validateOnRuleChange: false,
placeholder: '可输入多个箱号',
rows: 2,
},
},
{
field: 'CM_ctnCode',
label: '箱型',
field: 'isOnlineId',
label: '是否上线',
component: 'ApiSelect',
colProps: { span: 4 },
componentProps: () => {
defaultValue: '0',
componentProps: ({}) => {
return {
api: () => {
return new Promise((resolve) => {
getDictOption('CM_ctnCode').then((res) => {
getDictOption('CM_IsOnlineEnum').then((res) => {
resolve(res)
})
})
@ -180,15 +201,15 @@ export const searchFormSchema: FormSchema[] = [
},
},
{
field: 'CM_ctnSize',
label: '尺寸',
field: 'CM_ctnCode',
label: '箱型',
component: 'ApiSelect',
colProps: { span: 4 },
componentProps: () => {
return {
api: () => {
return new Promise((resolve) => {
getDictOption('CM_ctnSize').then((res) => {
getDictOption('CM_ctnCode').then((res) => {
resolve(res)
})
})
@ -203,16 +224,15 @@ export const searchFormSchema: FormSchema[] = [
},
},
{
field: 'ctnSourceId',
label: '箱来源',
field: 'CM_ctnSize',
label: '尺寸',
component: 'ApiSelect',
colProps: { span: 4 },
defaultValue: '',
componentProps: ({ formModel }) => {
componentProps: () => {
return {
api: () => {
return new Promise((resolve) => {
getDictOption('CM_CtnSource').then((res) => {
getDictOption('CM_ctnSize').then((res) => {
resolve(res)
})
})
@ -227,22 +247,16 @@ export const searchFormSchema: FormSchema[] = [
},
},
{
field: 'mblno',
label: '业务编号',
component: 'Input',
colProps: { span: 4 },
},
{
field: 'isOnlineId',
label: '是否上线',
field: 'ctnSourceId',
label: '箱来源',
component: 'ApiSelect',
colProps: { span: 4 },
defaultValue: '0',
componentProps: ({}) => {
defaultValue: '',
componentProps: ({ formModel }) => {
return {
api: () => {
return new Promise((resolve) => {
getDictOption('CM_IsOnlineEnum').then((res) => {
getDictOption('CM_CtnSource').then((res) => {
resolve(res)
})
})
@ -256,6 +270,13 @@ export const searchFormSchema: FormSchema[] = [
}
},
},
{
field: 'mblno',
label: '业务编号',
component: 'Input',
colProps: { span: 4 },
},
{
field: 'etd',
label: 'ETD',

@ -15,18 +15,59 @@
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { ref, h } from 'vue'
import { BasicTable, useTable } from '/@/components/Table'
import { ApiList, ApiOnLine, ApiOffLine } from './api'
import { ExportExcelByColumn } from '/@/api/common'
import { columns, searchFormSchema } from './columns'
import { useMessage } from '/@/hooks/web/useMessage'
const { notification } = useMessage()
//
import { formatParams } from '/@/hooks/web/common'
import { Button } from 'ant-design-vue'
const [registerTable, { reload, getSelectRows }] = useTable({
title: '',
api: async (p) => {
const res: API.DataResult = await ApiList(p)
// 线
let type = true
JSON.parse(p.queryCondition).forEach((e) => {
if (e.FieldName == 'isOnlineId') {
type = false
}
})
if (type) {
let Num = 0
let Text = ''
let Arr = []
res.data.forEach((e) => {
if (e.isOnline == '待上线') {
Num = Num + 1
Text = Text == '' ? e.cntrno : `${Text},${e.cntrno}`
Arr.push(e)
}
})
const key = `open${Date.now()}`
notification.open({
message: `${Num}条待上线`,
description: Num == 0 ? '' : `箱号为${Text}`,
btn: () =>
h(
Button,
{
type: 'primary',
size: 'small',
onClick: () => {
derivedExcel(Arr)
notification.close(key)
},
},
{ default: () => '导出待上线' },
),
key,
duration: 0,
})
}
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
})
@ -34,7 +75,7 @@
beforeFetch: (p) => {
// ['ctnall', 'ctnSourceId', 'isOnlineId']
let Rdata = formatParams(p, searchFormSchema)
if (!!p.CM_ctnCode || !!p.CM_ctnSize) {
if (!!p.CM_ctnCode || !!p.CM_ctnSize || !!p.cntrno) {
let data = JSON.parse(Rdata.queryCondition)
let CM_ctnCode: any = null
let CM_ctnSize: any = null
@ -45,6 +86,12 @@
if (item.FieldName == 'CM_ctnSize') {
CM_ctnSize = item
}
if (item.FieldName == 'cntrno') {
item.FieldValue = item.FieldValue.replace(/ {1,}/g, ',')
item.FieldValue = item.FieldValue.replace(/\n/g, ',')
item.ConditionalType = 15
}
})
data = data.filter(
(item) => item.FieldName !== 'CM_ctnCode' && item.FieldName !== 'CM_ctnSize',
@ -136,7 +183,6 @@
}
ApiOnLine(ApiData).then((res) => {
console.log(res)
notification.success({ message: res.message, duration: 3 })
reload()
})
@ -156,11 +202,41 @@
}
ApiOffLine(ApiData).then((res) => {
console.log(res)
notification.success({ message: res.message, duration: 3 })
reload()
})
}
function derivedExcel(jsonDataStr) {
let ApiData: any = {
columnSets: [],
jsonDataStr,
}
columns.forEach((item) => {
ApiData.columnSets.push({
title: item.title,
enTitle: item.dataIndex,
dataIndex: item.dataIndex,
visible: true,
})
})
ApiData.jsonDataStr.forEach((item) => {
item.isHeavy = item.isHeavy ? '重箱' : '空箱'
})
ApiData.jsonDataStr = JSON.stringify(ApiData.jsonDataStr)
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()
})
}
</script>
<style lang="less" scoped>
:deep(.ant-table-column-sorters) {

Loading…
Cancel
Save