szh-new
张同海 4 months ago
parent 1faf8ded77
commit 37a864c2d0

@ -1,5 +1,5 @@
import { BasicColumn, FormSchema } from '/@/components/Table'
import { GetCtnSelectList } from '/@/api/common'
import { GetCtnSelectList, GetClientListByCode } from '/@/api/common'
export const columns: BasicColumn[] = [
{
title: '箱号',
@ -25,24 +25,24 @@ export const columns: BasicColumn[] = [
sorter: true,
width: 200,
},
// {
// title: '备注',
// dataIndex: '',
// sorter: true,
// width: 200,
// },
{
title: '备注??',
dataIndex: '',
sorter: true,
width: 200,
},
{
title: '箱初期成本',
dataIndex: 'ctnValue_Base',
sorter: true,
width: 200,
},
// {
// title: '购入价格',
// dataIndex: '',
// sorter: true,
// width: 200,
// },
{
title: '购入价格??',
dataIndex: '',
sorter: true,
width: 200,
},
]
export const searchFormSchema: FormSchema[] = [
@ -52,18 +52,30 @@ export const searchFormSchema: FormSchema[] = [
component: 'Input',
colProps: { span: 4 },
},
// {
// field: 'cntrno',
// label: '箱主',
// component: 'Input',
// colProps: { span: 4 },
// },
// {
// field: 'cntrno',
// label: '箱来源',
// component: 'Input',
// colProps: { span: 4 },
// },
{
field: 'ctnOwner',
label: '箱主',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: ({ formModel }) => {
return {
allowClear: true,
showSearch: true,
api: GetClientListByCode,
params: { code: 'leasing' },
labelField: 'pinYinCode',
showName: 'shortName',
valueField: 'shortName',
resultField: 'data',
immediate: false,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
]
export const formSchema: FormSchema[] = [
{
@ -80,16 +92,26 @@ export const formSchema: FormSchema[] = [
colProps: { span: 20 },
},
{
label: '',
field: 'ctnall',
component: 'Input',
defaultValue: '',
show: false,
},
{
field: 'ctnCode',
label: '箱型',
component: 'ApiSelect',
colProps: { span: 20 },
componentProps: () => {
componentProps: ({ formModel }) => {
return {
api: GetCtnSelectList,
labelField: 'ctnName',
valueField: 'ediCode',
resultField: 'data',
onChange: (v, obj) => {
formModel.ctnall = obj.label
},
}
},
},
@ -115,19 +137,19 @@ export const formSchema: FormSchema[] = [
component: 'InputNumber',
colProps: { span: 20 },
},
// {
// field: 'ctnValue_Base',
// label: '购入价格',
// component: 'InputNumber',
// colProps: { span: 20 },
// },
// {
// field: 'note',
// label: '备注',
// component: 'InputTextArea',
// colProps: { span: 20 },
// componentProps: {
// rows: 2,
// },
// },
{
field: 'ctnValue_Base',
label: '购入价格??',
component: 'InputNumber',
colProps: { span: 20 },
},
{
field: 'note',
label: '备注??',
component: 'InputTextArea',
colProps: { span: 20 },
componentProps: {
rows: 2,
},
},
]

@ -1,7 +1,8 @@
import { ref } from 'vue'
import { BasicColumn, FormSchema } from '/@/components/Table'
import { Tag } from 'ant-design-vue'
import { GetCtnSelectList } from '/@/api/common'
import { GetCtnSelectList, GetClientListByCode } from '/@/api/common'
import { GetDeptList } from '/@/views/operation/seaexport/api/BookingLedger'
import { useOptionsStore } from '/@/store/modules/options'
const optionsStore = useOptionsStore()
@ -47,12 +48,12 @@ export const columns: BasicColumn[] = [
sorter: true,
width: 200,
},
// {
// title: '所属分部',
// dataIndex: '',
// sorter: true,
// width: 200,
// },
{
title: '所属分部',
dataIndex: 'orgid',
sorter: true,
width: 200,
},
{
title: '箱来源',
dataIndex: 'ctnSource',
@ -60,12 +61,11 @@ export const columns: BasicColumn[] = [
width: 200,
},
{
title: '变动来源',
dataIndex: 'changeSourceId',
title: '当前箱业务状态',
dataIndex: 'ctnBizState',
sorter: true,
width: 200,
},
{
title: '箱业务编号',
dataIndex: 'billno',
@ -100,7 +100,15 @@ export const columns: BasicColumn[] = [
title: '空重箱',
dataIndex: 'isHeavy',
sorter: true,
width: 150,
width: 80,
customRender: ({ text }) => {
if (text) {
return <Tag color="success"></Tag>
} else {
return <Tag color="error"></Tag>
}
return text
},
},
{
title: '当前港口',
@ -144,12 +152,12 @@ export const columns: BasicColumn[] = [
sorter: true,
width: 200,
},
// {
// title: '生产日期',
// dataIndex: '',
// sorter: true,
// width: 200,
// },
{
title: '生产日期??',
dataIndex: '',
sorter: true,
width: 200,
},
{
title: '箱初期成本',
dataIndex: 'ctnValue_Base',
@ -174,15 +182,25 @@ export const searchFormSchema: FormSchema[] = [
{
field: 'ctnOwner',
label: '箱主',
component: 'Select',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: {
options: [],
allowClear: true,
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
componentProps: ({ formModel }) => {
return {
allowClear: true,
showSearch: true,
api: GetClientListByCode,
params: { code: 'leasing' },
labelField: 'pinYinCode',
showName: 'shortName',
valueField: 'shortName',
resultField: 'data',
immediate: false,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
// {
@ -387,15 +405,25 @@ export const formSchema: FormSchema[] = [
{
field: 'ctnOwner',
label: '箱主',
component: 'Select',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 6 },
componentProps: {
options: [],
allowClear: true,
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
componentProps: ({ formModel }) => {
return {
allowClear: true,
showSearch: true,
api: GetClientListByCode,
params: { code: 'leasing' },
labelField: 'pinYinCode',
showName: 'shortName',
valueField: 'shortName',
resultField: 'data',
immediate: false,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
{
@ -509,8 +537,8 @@ export const formSchema: FormSchema[] = [
defaultValue: false,
colProps: { span: 6 },
componentProps: {
checkedChildren: '',
unCheckedChildren: '',
checkedChildren: '重箱',
unCheckedChildren: '空箱',
},
},
{
@ -675,12 +703,12 @@ export const InfoColumns: BasicColumn[] = [
sorter: true,
width: 150,
},
// {
// title: '状态变动',
// dataIndex: 'usedState',
// sorter: true,
// width: 150,
// },
{
title: '状态变动',
dataIndex: 'usedState',
sorter: true,
width: 150,
},
{
title: '新旧箱',
dataIndex: 'usedState',
@ -703,7 +731,15 @@ export const InfoColumns: BasicColumn[] = [
title: '空重箱',
dataIndex: 'isHeavy',
sorter: true,
width: 150,
width: 80,
customRender: ({ text }) => {
if (text) {
return <Tag color="success"></Tag>
} else {
return <Tag color="error"></Tag>
}
return text
},
},
{
title: '当前港口',

@ -7,27 +7,12 @@
@register="registerModal"
@ok="handleSave"
>
<BasicTable @register="registerTable">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: 'ant-design:profile-outlined',
tooltip: '详情',
onClick: handleAudit.bind(null, record),
},
]"
/>
</template>
</template>
</BasicTable>
<BasicTable @register="registerTable"> </BasicTable>
</BasicModal>
</template>
<script lang="ts" setup>
import { defineExpose, defineComponent, onMounted, ref } from 'vue'
import { BasicTable, useTable, TableAction, SorterResult } from '/@/components/Table'
import { ApiExistList } from './api'
import { defineExpose, ref } from 'vue'
import { BasicTable, useTable } from '/@/components/Table'
import { ApiChangeList } from '../StateChange/api'
import { BasicModal, useModalInner } from '/@/components/Modal'
import { InfoColumns } from './columns'
@ -42,8 +27,6 @@
const [registerTable, { reload, getForm, getPaginationRef, getSelectRows }] = useTable({
// title: '',
maxHeight: 300,
// rowSelection: { type: 'checkbox' },
// rowSelection: { type: 'radio' },
api: async (p) => {
const res: API.DataResult = await ApiChangeList(p)
return new Promise((resolve) => {
@ -70,26 +53,8 @@
bordered: true,
immediate: true,
showTableSetting: false,
// actionColumn: {
// width: 80,
// title: '',
// dataIndex: 'action',
// fixed: undefined,
// },
})
function handleCreate() {
openModal(true, {
record: {},
})
}
function handleAudit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
})
}
function getSelectData() {
return getSelectRows()
}

@ -1,7 +1,7 @@
import { ref } from 'vue'
import { BasicColumn, FormSchema } from '/@/components/Table'
import { Tag } from 'ant-design-vue'
import { GetCtnSelectList } from '/@/api/common'
import { GetCtnSelectList, GetClientListByCode } from '/@/api/common'
import { GetDeptList } from '/@/views/operation/seaexport/api/BookingLedger'
import { useOptionsStore } from '/@/store/modules/options'
const optionsStore = useOptionsStore()
@ -41,6 +41,12 @@ export const columns: BasicColumn[] = [
sorter: true,
width: 150,
},
{
title: '状态变动',
dataIndex: 'ctnState',
sorter: true,
width: 200,
},
{
title: '当前业务编号',
dataIndex: 'mblno',
@ -69,7 +75,15 @@ export const columns: BasicColumn[] = [
title: '空重箱',
dataIndex: 'isHeavy',
sorter: true,
width: 150,
width: 80,
customRender: ({ text }) => {
if (text) {
return <Tag color="success"></Tag>
} else {
return <Tag color="error"></Tag>
}
return text
},
},
{
title: '当前港口',
@ -256,15 +270,25 @@ export const formSchema: FormSchema[] = [
{
field: 'ctnOwner',
label: '箱主',
component: 'Select',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 6 },
componentProps: {
options: [],
allowClear: true,
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
componentProps: ({ formModel }) => {
return {
allowClear: true,
showSearch: true,
api: GetClientListByCode,
params: { code: 'leasing' },
labelField: 'pinYinCode',
showName: 'shortName',
valueField: 'shortName',
resultField: 'data',
immediate: false,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
{
@ -370,7 +394,6 @@ export const formSchema: FormSchema[] = [
component: 'Input',
colProps: { span: 6 },
},
{
field: 'isHeavy',
label: '空重箱',
@ -378,8 +401,8 @@ export const formSchema: FormSchema[] = [
defaultValue: false,
colProps: { span: 6 },
componentProps: {
checkedChildren: '',
unCheckedChildren: '',
checkedChildren: '重箱',
unCheckedChildren: '空箱',
},
},
{

@ -0,0 +1,62 @@
{
"id": "",
"cntrno": "080801,080802",
"isOnlineId": "0",
"changeSourceId": "1",
"usedState": "used",
"ctnSourceId": "1",
"ctnBizState": "短租租出",
"ctnBizStateId": "6",
"billno": "WebTest001",
"ctnReleaseNo": "WebTest001",
"ctnStateId": "1",
"ctnBreakState": "WebTest001",
"isHeavy": true,
"port": "NINGBO",
"portid": "1816754346457698304",
"depot": "昭阳国际",
"vehicleName": "WebTest001",
"ctnall": "22G0",
"mblno": "WebTest001",
"customerName": "青岛东胜",
"customerId": "QDDS",
"etd": "2024-08-08T00:53:55.980Z",
"eta": "2024-08-08T00:54:08.455Z",
"changeTime": "2024-08-08T00:54:10.015Z",
"ctnWeight": 666,
"ctnValue_Base": 666
}
{
"id": "1821349203675320320",
"cntrno": "080801",
"ctnCode": null,
"ctnall": "22G0",
"usedState": "used",
"ctnOwner": null,
"ctnSourceId": 1,
"ctnSource": "短租租入",
"ctnBizStateId": 6,
"ctnBizState": "短租租出",
"billno": "WebTest001",
"ctnReleaseNo": null,
"ctnStateId": 1,
"ctnState": "可用",
"ctnBreakState": "WebTest001",
"isOnlineId": 0,
"isOnline": "待上线",
"isHeavy": true,
"portid": "1816754346457698304",
"port": null,
"depot": "昭阳国际",
"vehicleName": "WebTest001",
"mblno": "WebTest001",
"customerId": "",
"customerName": "青岛东胜",
"etd": "2024-08-08 00:53:55",
"eta": "2024-08-08 00:54:08",
"stateTime": "2024-08-08 00:54:10",
"ctnWeight": 0,
"ctnValue_Base": 0
},

@ -92,7 +92,9 @@
registerAllModules()
import 'handsontable/dist/handsontable.full.css'
import { formSchema } from './columns'
import { GetCtnSelectList } from '/@/views/operation/seaexport/api/BookingLedger'
import { ApiEdit, ApiInfo, ApiListDetail, ApiDelDetail } from './api'
import { GetClientListByCode } from '/@/api/common'
import { useMessage } from '/@/hooks/web/useMessage'
const { notification } = useMessage()
// Emits
@ -173,11 +175,16 @@
}
const activeKey = ref('1')
//--------------------------------------- tab1 ---------------------------------------
const list = ref([])
const list = ref<any>([])
//
const allCheck = ref(false)
//
const someCheck = ref(false)
const hotTb = ref()
//
const ctnDict = ref([])
//
const ContainerOwnerDict = ref([])
watchEffect(() => {
//
if (allCheck.value) {
@ -219,6 +226,7 @@
deep: true,
},
)
const columns = [
{
data: 'selected',
@ -228,6 +236,7 @@
className: 'htCenter',
readOnly: false,
},
// -----------------
{
title: '主键Id',
width: 200,
@ -238,7 +247,17 @@
width: 200,
data: 'pid',
},
{
title: '箱型代码',
width: 120,
data: 'ctnCode',
},
{
title: '原箱主',
width: 120,
data: 'oldContainerOwnerId',
},
// -----------------
{
title: '租箱业务号',
width: 200,
@ -246,117 +265,144 @@
},
{
title: '箱号',
width: 290,
width: 120,
data: 'cntrno',
},
{
title: '箱型代码',
width: 290,
data: 'ctnCode',
},
{
title: '箱型',
width: 290,
width: 120,
data: 'ctnall',
},
{
title: '原箱主名称',
width: 290,
data: 'oldContainerOwner',
type: 'dropdown',
// (process)
source: async (query, process) => {
const res = ctnDict.value.length ? ctnDict.value : (await GetCtnSelectList())?.data
if (!ctnDict.value.length) ctnDict.value = res
const dict = res.map((res) => {
return res.ctnName
})
process(dict)
},
},
{
title: '原箱主',
width: 290,
data: 'oldContainerOwnerId',
width: 120,
data: 'oldContainerOwner',
type: 'dropdown',
// (process)
source: async (query, process) => {
const res = ContainerOwnerDict.value.length
? ContainerOwnerDict.value
: (await GetClientListByCode({ code: 'leasing' }))?.data
if (!ContainerOwnerDict.value.length) ContainerOwnerDict.value = res
const dict = res.map((res) => {
return res.pinYinCode
})
process(dict)
},
},
{
title: '租箱业务',
width: 290,
width: 120,
data: 'cmRentDirectEnum',
},
{
title: '租箱类型',
width: 290,
width: 120,
data: 'rentType',
},
{
title: '业务状态',
width: 290,
width: 120,
data: 'billState',
},
{
title: '关联放箱单号',
width: 290,
width: 120,
data: 'ctnReleaseNo',
},
{
title: '租入日期',
width: 290,
width: 120,
data: 'bsdate',
type: 'date',
dateFormat: 'YYYY-MM-DD',
},
{
title: '开始计费日期',
width: 290,
width: 120,
data: 'feeStartDate',
type: 'date',
dateFormat: 'YYYY-MM-DD',
},
{
title: '币别',
width: 290,
width: 120,
data: 'currenty',
},
{
title: '日租金',
width: 290,
width: 120,
data: 'dailyRate',
type: 'numeric',
format: '0',
},
{
title: '提箱费',
width: 290,
width: 120,
data: 'pickupFee',
type: 'numeric',
format: '0',
},
{
title: '提箱日期',
width: 290,
width: 120,
data: 'pickupDate',
type: 'date',
dateFormat: 'YYYY-MM-DD',
},
{
title: '还箱费',
width: 290,
width: 120,
data: 'dropoffFee',
type: 'numeric',
format: '0',
},
{
title: '还箱日期',
width: 290,
width: 120,
data: 'dropoffDate',
type: 'date',
dateFormat: 'YYYY-MM-DD',
},
{
title: '提箱港口名称',
width: 290,
width: 120,
data: 'pickupPort',
},
{
title: '提箱港口',
width: 290,
width: 120,
data: 'pickupPortid',
},
{
title: '还箱港口名称',
width: 290,
width: 120,
data: 'dropoffPort',
},
{
title: '还箱港口',
width: 290,
width: 120,
data: 'dropoffPortid',
},
{
title: '业务编号/提单号',
width: 290,
width: 120,
data: 'mblno',
},
{
title: '运输工具',
width: 290,
width: 120,
data: 'vehicleName',
},
]
@ -369,7 +415,7 @@
fixedColumnsLeft: 1,
//
hiddenColumns: {
columns: [1, 2],
columns: [1, 2, 3, 4],
indicators: true,
},
//
@ -388,6 +434,28 @@
async afterChange(changes, source) {
if (source === 'edit' || source === 'Autofill.fill' || source === 'CopyPaste.paste') {
let dict: any = {}
if (changes[0][1] === 'ctnall') {
const res = ctnDict.value.length ? ctnDict.value : (await GetCtnSelectList())?.data
if (!ctnDict.value.length) ctnDict.value = res
const item = res.filter((item) => {
return item.ctnName === changes[0][3]
})
if (item) dict = item[0]
list.value[changes[0][0]]['ctnall'] = dict?.ctnName
list.value[changes[0][0]]['ctnCode'] = dict?.ediCode
}
if (changes[0][1] === 'oldContainerOwner') {
const res = ContainerOwnerDict.value.length
? ContainerOwnerDict.value
: (await GetCtnSelectList())?.data
if (!ContainerOwnerDict.value.length) ContainerOwnerDict.value = res
const item = res.filter((item) => {
return item.pinYinCode === changes[0][3]
})
if (item) dict = item[0]
list.value[changes[0][0]]['oldContainerOwner'] = dict?.pinYinCode
list.value[changes[0][0]]['oldContainerOwnerId'] = dict?.id
}
}
},
}
@ -419,6 +487,5 @@
.ds-goods-tb-check {
position: absolute;
left: 15px;
top: 30px;
}
</style>

@ -114,8 +114,27 @@ export const searchFormSchema: FormSchema[] = [
{
field: 'rentDirect',
label: '租箱/退租',
component: 'Input',
component: 'ApiSelect',
colProps: { span: 4 },
defaultValue: '',
componentProps: ({ formModel }) => {
return {
api: () => {
return new Promise((resolve) => {
getDictOption('CM_RentDirect').then((res) => {
resolve(res)
})
})
},
labelField: 'label',
valueField: 'value',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (v, obj) => {},
}
},
},
{
field: 'etd',
@ -157,8 +176,27 @@ export const formSchema: FormSchema[] = [
{
field: 'rentDirect',
label: '租箱/退租',
component: 'Input',
component: 'ApiSelect',
colProps: { span: 6 },
defaultValue: '',
componentProps: ({ formModel }) => {
return {
api: () => {
return new Promise((resolve) => {
getDictOption('CM_RentDirect').then((res) => {
resolve(res)
})
})
},
labelField: 'label',
valueField: 'value',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (v, obj) => {},
}
},
},
{
field: 'rentType',

@ -2,7 +2,11 @@
<div class="goods-table" style="width: 100%; overflow: auto">
<a-spin :spinning="loadingTable">
<div>
<div class="flex" v-if="!isLockBooking && source == 'edit'" style="justify-content: space-between">
<div
class="flex"
v-if="!isLockBooking && source == 'edit'"
style="justify-content: space-between"
>
<div>
<a-button type="link" v-repeat size="mini" @click="openDialog">
<span class="iconfont icon-liebiao1"></span>
@ -254,7 +258,7 @@
'changeTotal',
'handleRefshTable',
'changeCtnInfo',
'setGoodsTransform'
'setGoodsTransform',
])
watch(
() => props.details,
@ -943,7 +947,7 @@
//
const props = { readOnly: true }
return props
}
},
})
}
})
@ -991,7 +995,7 @@
//
const checkDelete = () => {
let flag = false
list.value.forEach(item => {
list.value.forEach((item) => {
if (item?.selected) flag = true
})
if (!flag) {
@ -1665,7 +1669,8 @@
list.value[changes[0][0]]['ctnCode'] = dict?.ediCode
list.value[changes[0][0]]['size'] = dict?.ctnSize
if (list.value[changes[0][0]]['ctnNum']) {
list.value[changes[0][0]]['teu'] = parseInt(dict.teu || 0) * parseInt(list.value[changes[0][0]]['ctnNum'])
list.value[changes[0][0]]['teu'] =
parseInt(dict.teu || 0) * parseInt(list.value[changes[0][0]]['ctnNum'])
}
list.value[changes[0][0]]['tareWeight'] = dict?.ctnWeight
}
@ -1763,7 +1768,7 @@
}
})
let teu = 0
ctnDict.value.forEach(item => {
ctnDict.value.forEach((item) => {
if (item.ctnName == list.value[changes[0][0]]['ctn']) {
teu = item.teu
}

Loading…
Cancel
Save