diff --git a/src/views/baseinfo/infoclient/FeeCustTemplate/columns.tsx b/src/views/baseinfo/infoclient/FeeCustTemplate/columns.tsx index caf6eeed..1fa0dec3 100644 --- a/src/views/baseinfo/infoclient/FeeCustTemplate/columns.tsx +++ b/src/views/baseinfo/infoclient/FeeCustTemplate/columns.tsx @@ -4,9 +4,17 @@ import { Tag } from 'ant-design-vue' // 引入字典数据 import { getDictOption } from '/@/utils/dictUtil' -import { getOrgList } from '/@/api/common' +import { getOrgList, GetClientPortSelectList, GetCarrierSelectList } from '/@/api/common' +import { + GetClientLanesSelectList, + GetAgentCnClientList, + GetClientFrtSelectList, + GetClientSourceSelectList, +} from '/@/views/operation/seaexport/api/BookingLedger' // 往来单位下拉框数据 const companyDict = ref([]) +import { useOptionsStore } from '/@/store/modules/options' +const optionsStore = useOptionsStore() let businessType: any = [ { value: 1, label: '海运出口' }, { value: 2, label: '海运进口' }, @@ -28,18 +36,23 @@ export const columns: BasicColumn[] = [ width: 200, }, { - title: '费用类别', - dataIndex: 'feeCategory', + title: '费用类型', + dataIndex: 'feeType', width: 120, customRender: ({ text }) => { - if (text == '1') { + if (text == 1) { return '收' - } else if (text == '2') { + } else if (text == 2) { return '付' } return text }, }, + { + title: '费用类别', + dataIndex: 'feeCategoryName', + width: 200, + }, { title: '是否停用', dataIndex: 'isDisabled', @@ -93,14 +106,14 @@ export const searchFormSchema: FormSchema[] = [ colProps: { span: 4 }, }, { - field: 'feeCategory', - label: '费用类别', + field: 'feeType', + label: '费用类型', component: 'Select', colProps: { span: 4 }, componentProps: { options: [ - { label: '收', value: '1' }, - { label: '付', value: '2' }, + { label: '收', value: 1 }, + { label: '付', value: 2 }, ], }, }, @@ -239,17 +252,192 @@ export const formSchema: FormSchema[] = [ // show: false, // }, { - field: 'feeCategory', - label: '费用类别', + field: 'feeType', + label: '费用类型', component: 'Select', colProps: { span: 6 }, componentProps: { options: [ - { label: '收', value: '1' }, - { label: '付', value: '2' }, + { label: '收', value: 1 }, + { label: '付', value: 2 }, ], }, }, + { + label: '费用类别名称', + field: 'feeCategoryName', + component: 'Input', + defaultValue: '', + show: false, + }, + { + field: 'feeCategoryId', + label: '费用类别', + defaultValue: '', + component: 'ApiSelect', + colProps: { span: 6 }, + componentProps: ({ formModel }) => { + return { + api: () => { + return new Promise((resolve) => { + getDictOption('Fee_FeeCategoryId').then((res) => { + resolve(res) + }) + }) + }, + labelField: 'label', + valueField: 'value', + resultField: 'data', + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + onChange: (e, obj) => { + console.log(e, obj) + if (e && obj) { + formModel.feeCategoryName = obj.label + formModel.feeCategoryId = obj.value + } + if (!e && !obj) { + formModel.feeCategoryName = '' + formModel.feeCategoryId = '' + } + }, + } + }, + }, + { + label: '起运港', + field: 'polCode', + component: 'ApiSelect', + dynamicDisabled: false, + colProps: { span: 6 }, + componentProps: () => { + return { + api: GetClientPortSelectList, + resultField: 'data', + allowClear: true, + showSearch: true, + labelField: 'pinYinCode', + showName: 'pinYinCode', + valueField: 'ediCode', + immediate: true, + getPopupContainer: () => document.body, + } + }, + }, + { + label: '卸货港', + field: 'podCode', + component: 'ApiSelect', + required: false, + dynamicDisabled: false, + colProps: { span: 6 }, + componentProps: () => { + return { + api: GetClientPortSelectList, + resultField: 'data', + allowClear: true, + showSearch: true, + labelField: 'pinYinCode', + showName: 'pinYinCode', + valueField: 'ediCode', + immediate: true, + getPopupContainer: () => document.body, + } + }, + }, + { + field: 'laneId', + label: '航线', + component: 'ApiSelect', + required: false, + dynamicDisabled: false, + colProps: { span: 6 }, + componentProps: ({ formModel }) => { + return { + api: GetClientLanesSelectList, + labelField: 'laneName', + valueField: 'id', + resultField: 'data', + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + } + }, + }, + { + label: '业务来源', + field: 'sourceId', + component: 'ApiSelect', + required: false, + dynamicDisabled: false, + colProps: { span: 6 }, + componentProps: ({ formModel }) => { + return { + api: GetClientSourceSelectList, + labelField: 'sourceName', + valueField: 'id', + resultField: 'data', + } + }, + }, + { + label: '船公司', + field: 'carrierId', + labelSlot: 'carrierId', + component: 'ApiSelect', + colProps: { span: 6 }, + componentProps: ({ formModel }) => { + return { + api: GetCarrierSelectList, + labelField: 'pinYinCode', + showName: 'cnName', + valueField: 'id', + resultField: 'data', + } + }, + }, + { + label: '订舱口', + field: 'forwarderId', + component: 'ApiSelect', + required: false, + dynamicDisabled: false, + colProps: { span: 6 }, + componentProps: ({ formModel }) => { + return { + api: GetAgentCnClientList, + labelField: 'shortName', + valueField: 'id', + resultField: 'data', + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + } + }, + }, + { + field: 'mblFrtCode', + label: '付费方式', + component: 'ApiSelect', + required: false, + dynamicDisabled: false, + defaultValue: null, + colProps: { span: 6 }, + componentProps: ({ formModel, formActionType }) => { + return { + api: GetClientFrtSelectList, + allowClear: true, + showSearch: true, + labelField: 'frtName', + valueField: 'ediCode', + resultField: 'data', + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + } + }, + }, { field: 'isDisabled', label: '是否停用',