往来单位 自动费用模板(新增字段)

szh-new
张同海 2 months ago
parent 01512d17ca
commit ae1a0c314a

@ -4,9 +4,17 @@ import { Tag } from 'ant-design-vue'
// 引入字典数据 // 引入字典数据
import { getDictOption } from '/@/utils/dictUtil' 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([]) const companyDict = ref([])
import { useOptionsStore } from '/@/store/modules/options'
const optionsStore = useOptionsStore()
let businessType: any = [ let businessType: any = [
{ value: 1, label: '海运出口' }, { value: 1, label: '海运出口' },
{ value: 2, label: '海运进口' }, { value: 2, label: '海运进口' },
@ -28,18 +36,23 @@ export const columns: BasicColumn[] = [
width: 200, width: 200,
}, },
{ {
title: '费用类', title: '费用类',
dataIndex: 'feeCategory', dataIndex: 'feeType',
width: 120, width: 120,
customRender: ({ text }) => { customRender: ({ text }) => {
if (text == '1') { if (text == 1) {
return '收' return '收'
} else if (text == '2') { } else if (text == 2) {
return '付' return '付'
} }
return text return text
}, },
}, },
{
title: '费用类别',
dataIndex: 'feeCategoryName',
width: 200,
},
{ {
title: '是否停用', title: '是否停用',
dataIndex: 'isDisabled', dataIndex: 'isDisabled',
@ -93,14 +106,14 @@ export const searchFormSchema: FormSchema[] = [
colProps: { span: 4 }, colProps: { span: 4 },
}, },
{ {
field: 'feeCategory', field: 'feeType',
label: '费用类', label: '费用类',
component: 'Select', component: 'Select',
colProps: { span: 4 }, colProps: { span: 4 },
componentProps: { componentProps: {
options: [ options: [
{ label: '收', value: '1' }, { label: '收', value: 1 },
{ label: '付', value: '2' }, { label: '付', value: 2 },
], ],
}, },
}, },
@ -239,17 +252,192 @@ export const formSchema: FormSchema[] = [
// show: false, // show: false,
// }, // },
{ {
field: 'feeCategory', field: 'feeType',
label: '费用类', label: '费用类',
component: 'Select', component: 'Select',
colProps: { span: 6 }, colProps: { span: 6 },
componentProps: { componentProps: {
options: [ options: [
{ label: '收', value: '1' }, { label: '收', value: 1 },
{ label: '付', value: '2' }, { 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', field: 'isDisabled',
label: '是否停用', label: '是否停用',

Loading…
Cancel
Save