From c7d50dc7ccb0575e7db09ab6c5ec250257293172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <14166000+zhangtonghai@user.noreply.gitee.com> Date: Fri, 2 Aug 2024 17:41:14 +0800 Subject: [PATCH] 08/02 --- src/store/modules/configOptions.ts | 27 +- src/store/modules/options.ts | 8 +- .../CurrentState/columns.tsx | 253 +++++++++++++++--- .../CurrentState/index.vue | 8 +- src/views/baseinfo/infoclient/columns.tsx | 77 ++---- src/views/baseinfo/infoclient/tabs3/index.vue | 2 - .../bookingcabin/CabinManagement/columns.tsx | 123 ++++----- 7 files changed, 336 insertions(+), 162 deletions(-) diff --git a/src/store/modules/configOptions.ts b/src/store/modules/configOptions.ts index f24dcfa8..c6640e4c 100644 --- a/src/store/modules/configOptions.ts +++ b/src/store/modules/configOptions.ts @@ -23,10 +23,17 @@ import { GetDispatcherList, GetFactorySelectList, GetCodeCountryList, - GetClientGoodsList + GetClientGoodsList, + GetYardClientList, + GetControllerClientList, } from '/@/views/operation/seaexport/api/BookingLedger' import { getList } from '/@/views/flowcenter/flowInstances/api' -import { GetFeeCurrencySelectList, GetClientListByCode, GetCtnSelectList, GetTenantParamSelectList } from '/@/api/common/index' +import { + GetFeeCurrencySelectList, + GetClientListByCode, + GetCtnSelectList, + GetTenantParamSelectList, +} from '/@/api/common/index' import { getClientBankList } from '/@/views/baseinfo/infoclient/api' export default { // 业务来源 @@ -83,8 +90,8 @@ export default { return res.data }) }, - // 销售 - GetSaleUserList: () => { + // 销售 + GetSaleUserList: () => { return GetSaleUserList().then((res) => { return res.data }) @@ -185,4 +192,16 @@ export default { return res.data }) }, + // 场站 + GetYardClientList: () => { + return GetYardClientList().then((res) => { + return res.data + }) + }, + // 委托单位 + GetControllerClientList: () => { + return GetControllerClientList().then((res) => { + return res.data + }) + }, } diff --git a/src/store/modules/options.ts b/src/store/modules/options.ts index b96cc5e1..1024f185 100644 --- a/src/store/modules/options.ts +++ b/src/store/modules/options.ts @@ -28,7 +28,7 @@ export const useOptionsStore = defineStore({ GetCustomerServiceList: null, // 单证 GetVouchingClerkList: null, - // 销售 + // 销售 GetSaleUserList: null, // 收货地/签单地/预付地点/到付地点/装货港/中转港/卸货港/目的地/交货地 GetClientPortSelectList: null, @@ -62,6 +62,10 @@ export const useOptionsStore = defineStore({ GetTenantParamSelectList: null, // 商品 GetClientGoodsList: null, + //场站 + GetYardClientList: null, + //委托单位 + GetControllerClientList: null, }), getters: { // 通过code获取下拉字典(code)就是接口尾部单词 @@ -79,7 +83,7 @@ export const useOptionsStore = defineStore({ //异步处理获取下拉字典 getOptionsByCodeAsync: (store) => (code) => { if (store.$state[code] !== null) { - return Promise.resolve(store.$state[code]); + return Promise.resolve(store.$state[code]) } else { return store.setOptionsByCode(code) } diff --git a/src/views/ContainerManagement/CurrentState/columns.tsx b/src/views/ContainerManagement/CurrentState/columns.tsx index 3fbba313..f48b78d2 100644 --- a/src/views/ContainerManagement/CurrentState/columns.tsx +++ b/src/views/ContainerManagement/CurrentState/columns.tsx @@ -1,7 +1,27 @@ +import { ref } from 'vue' import { BasicColumn, FormSchema } from '/@/components/Table' import { Tag } from 'ant-design-vue' import { GetCtnSelectList } from '/@/api/common' import { GetDeptList } from '/@/views/operation/seaexport/api/BookingLedger' +import { useOptionsStore } from '/@/store/modules/options' +const optionsStore = useOptionsStore() +// 字典 +import { getDictOption } from '/@/utils/dictUtil' +// 新旧箱数据 +const usedStateList = [ + { + label: '', + value: '', + }, + { + label: 'used', + value: 'used', + }, + { + label: 'new', + value: 'new', + }, +] export const columns: BasicColumn[] = [ { title: '集装箱号', @@ -16,8 +36,14 @@ export const columns: BasicColumn[] = [ width: 150, }, { - title: '集装箱类型', - dataIndex: 'ctnType', + title: '是否上线', + dataIndex: 'isOnline', + sorter: true, + width: 200, + }, + { + title: '变动来源', + dataIndex: 'changeSource', sorter: true, width: 200, }, @@ -75,12 +101,6 @@ export const columns: BasicColumn[] = [ sorter: true, width: 200, }, - { - title: '是否上线', - dataIndex: 'isOnline', - sorter: true, - width: 200, - }, { title: '空重箱', dataIndex: 'isHeavy', @@ -131,7 +151,7 @@ export const columns: BasicColumn[] = [ }, { title: '状态时间', - dataIndex: 'stateTime', + dataIndex: 'changeTime', sorter: true, width: 200, }, @@ -194,27 +214,70 @@ export const formSchema: FormSchema[] = [ { field: 'isOnline', label: '是否上线', - component: 'RadioButtonGroup', - defaultValue: true, + component: 'ApiSelect', colProps: { span: 6 }, - componentProps: { - options: [ - { label: '是', value: true }, - { label: '否', value: false }, - ], + defaultValue: '', + componentProps: ({ formModel }) => { + return { + api: () => { + return new Promise((resolve) => { + getDictOption('CM_IsOnlineEnum').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) => { + formModel.defaultDebitName = obj?.label || '' + }, + } }, }, { field: 'changeSource', label: '变动来源', - component: 'Input', + component: 'ApiSelect', colProps: { span: 6 }, + defaultValue: '', + componentProps: ({ formModel }) => { + return { + api: () => { + return new Promise((resolve) => { + getDictOption('CM_ChangeSource').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) => { + formModel.defaultDebitName = obj?.label || '' + }, + } + }, }, { field: 'usedState', label: '新旧箱', - component: 'Input', + component: 'Select', colProps: { span: 6 }, + componentProps: { + options: usedStateList, + allowClear: true, + showSearch: true, + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + }, }, { field: 'ctnOwner', @@ -251,15 +314,56 @@ export const formSchema: FormSchema[] = [ { field: 'ctnSource', label: '箱来源', - component: 'Input', - + component: 'ApiSelect', colProps: { span: 6 }, + defaultValue: '', + componentProps: ({ formModel }) => { + return { + api: () => { + return new Promise((resolve) => { + getDictOption('CM_CtnSource').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) => { + formModel.defaultDebitName = obj?.label || '' + }, + } + }, }, { field: 'ctnBizState', label: '箱业务状态', - component: 'InputNumber', + component: 'ApiSelect', colProps: { span: 6 }, + defaultValue: '', + componentProps: ({ formModel }) => { + return { + api: () => { + return new Promise((resolve) => { + getDictOption('CM_CtnBizState').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) => { + formModel.defaultDebitName = obj?.label || '' + }, + } + }, }, { field: 'billno', @@ -277,8 +381,29 @@ export const formSchema: FormSchema[] = [ { field: 'ctnState', label: '箱状态', - component: 'Input', + component: 'ApiSelect', colProps: { span: 6 }, + defaultValue: '', + componentProps: ({ formModel }) => { + return { + api: () => { + return new Promise((resolve) => { + getDictOption('CM_CtnState').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) => { + formModel.defaultDebitName = obj?.label || '' + }, + } + }, }, { field: 'ctnBreakState', @@ -286,24 +411,52 @@ export const formSchema: FormSchema[] = [ component: 'Input', colProps: { span: 6 }, }, - { field: 'isHeavy', label: '空重箱', - component: 'Input', + component: 'Switch', + defaultValue: false, colProps: { span: 6 }, + componentProps: { + checkedChildren: '是', + unCheckedChildren: '否', + }, }, { field: 'portid', label: '当前港口', - component: 'Input', + component: 'ApiSelect', colProps: { span: 6 }, + required: false, + componentProps: ({}) => { + return { + option: optionsStore.getOptionsByCode('GetClientPortSelectList'), + labelField: 'portName', + valueField: 'id', + resultField: 'data', + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + } + }, }, { field: 'depot', label: '码头或场站', - component: 'Input', + component: 'ApiSelect', colProps: { span: 6 }, + required: false, + componentProps: ({}) => { + return { + option: optionsStore.getOptionsByCode('GetYardClientList'), + labelField: 'shortName', + valueField: 'id', + resultField: 'data', + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + } + }, }, { field: 'vehicleName', @@ -317,40 +470,74 @@ export const formSchema: FormSchema[] = [ component: 'Input', colProps: { span: 6 }, }, + // { + // field: 'customerName', + // label: '业务委托单位', + // component: 'Input', + // colProps: { span: 6 }, + // }, { - field: 'customerName', label: '业务委托单位', - component: 'Input', + field: 'customerName', + component: 'ApiSelect', + required: false, + dynamicDisabled: false, colProps: { span: 6 }, + componentProps: ({}) => { + return { + option: optionsStore.getOptionsByCode('GetControllerClientList'), + labelField: 'shortName', + valueField: 'codeName', + resultField: 'data', + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + } + }, }, { field: 'etd', label: 'ETD', - component: 'Input', + component: 'DatePicker', colProps: { span: 6 }, + defaultValue: '', + componentProps: { + showTime: true, + style: 'width:100%', + }, }, { field: 'eta', label: 'ETA', - component: 'Input', + component: 'DatePicker', colProps: { span: 6 }, + defaultValue: '', + componentProps: { + showTime: true, + style: 'width:100%', + }, }, { field: 'changeTime', label: '状态时间', - component: 'Input', + component: 'DatePicker', colProps: { span: 6 }, + defaultValue: '', + componentProps: { + showTime: true, + style: 'width:100%', + }, }, { field: 'ctnWeight', label: '箱皮重', - component: 'Input', + component: 'InputNumber', colProps: { span: 6 }, }, { field: 'ctnValue_Base', label: '箱初期成本', - component: 'Input', + component: 'InputNumber', colProps: { span: 6 }, }, ] diff --git a/src/views/ContainerManagement/CurrentState/index.vue b/src/views/ContainerManagement/CurrentState/index.vue index 32b9ef7c..9d75ea7a 100644 --- a/src/views/ContainerManagement/CurrentState/index.vue +++ b/src/views/ContainerManagement/CurrentState/index.vue @@ -1,6 +1,6 @@