往来单位 所属集团调整

szh-new
张同海 3 months ago
parent c76f03f454
commit fbdb39ff06

@ -89,6 +89,16 @@ enum Api {
GetControllerClientList = '/mainApi/ClientCommon/GetControllerClientListByKey',
// 用户下拉
GetUserList = '/mainApi/Common/GetUserList',
// 获取所有往来单位下拉列表 (Auth)
GetAllClientList = '/mainApi/ClientCommon/GetAllClientList',
}
// 所有往来单位下拉数据
export function GetAllClientList(params) {
return request<DataResult>({
url: Api.GetAllClientList,
method: 'get',
params,
})
}
// 用户下拉数据
export function GetUserList(params) {

@ -20,6 +20,7 @@ import {
getDeptList,
GetFeeCurrencySelectList,
GetUserList,
GetAllClientList,
} from '/@/api/common'
import { GetClientSourceDetailSelectList } from '/@/views/operation/seaexport/api/BookingLedger'
import { getOrgTree } from '/@/api/system/org'
@ -546,39 +547,67 @@ export const formSchema: FormSchema[] = [
{
field: 'pcorpId',
label: '所属集团',
component: 'TreeSelect',
defaultValue: '',
component: 'ApiSelect',
colProps: { span: 4 },
componentProps: ({ formModel }) => {
return {
treeData: OrgTree,
allowClear: true,
showSearch: true,
api: GetAllClientList,
labelField: 'shortName',
valueField: 'id',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (e) => {
if (e) {
const ForTree = (data, key, callback) => {
for (let i = 0; i < data.length; i++) {
if (data[i].value == key) {
return callback(data[i], i, data)
}
if (data[i].children) {
ForTree(data[i].children, key, callback)
}
}
}
let obj: any = {}
ForTree(OrgTree, e, (item, index, arr) => {
obj = item
})
formModel.pcorpName = obj.title
onChange: (e, obj) => {
if (e && obj) {
formModel.pcorpId = obj.value
formModel.pcorpName = obj.label
}
if (!e && !obj) {
formModel.pcorpId = ''
formModel.pcorpName = ''
}
},
}
},
},
// {
// field: 'pcorpId',
// label: '所属集团',
// component: 'TreeSelect',
// defaultValue: '',
// colProps: { span: 4 },
// componentProps: ({ formModel }) => {
// return {
// treeData: OrgTree,
// allowClear: true,
// showSearch: true,
// filterOption: (input: string, option: any) => {
// return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
// },
// onChange: (e) => {
// if (e) {
// const ForTree = (data, key, callback) => {
// for (let i = 0; i < data.length; i++) {
// if (data[i].value == key) {
// return callback(data[i], i, data)
// }
// if (data[i].children) {
// ForTree(data[i].children, key, callback)
// }
// }
// }
// let obj: any = {}
// ForTree(OrgTree, e, (item, index, arr) => {
// obj = item
// })
// formModel.pcorpName = obj.title
// }
// },
// }
// },
// },
{
field: 'Divider1',
component: 'Divider',

Loading…
Cancel
Save