diff --git a/src/api/common/index.ts b/src/api/common/index.ts index 159634aa..da6df7d9 100644 --- a/src/api/common/index.ts +++ b/src/api/common/index.ts @@ -432,6 +432,14 @@ export function GetMultiClientList() { }) } +// 客户参数类别下拉列表集合 +export function GetTenantParamSelectList() { + return request({ + url: '/mainApi/ClientParam/GetTenantParamSelectList', + method: 'get' + }) +} + /** * 上传api路径 */ diff --git a/src/store/modules/configOptions.ts b/src/store/modules/configOptions.ts index 9833738b..11ae8025 100644 --- a/src/store/modules/configOptions.ts +++ b/src/store/modules/configOptions.ts @@ -24,7 +24,7 @@ import { GetCodeCountryList } from '/@/views/operation/seaexport/api/BookingLedger' import { getList } from '/@/views/flowcenter/flowInstances/api' -import { GetFeeCurrencySelectList, GetClientListByCode, GetCtnSelectList } from '/@/api/common/index' +import { GetFeeCurrencySelectList, GetClientListByCode, GetCtnSelectList, GetTenantParamSelectList } from '/@/api/common/index' import { getClientBankList } from '/@/views/baseinfo/infoclient/api' export default { // 业务来源 @@ -164,5 +164,11 @@ export default { return GetCodeCountryList().then((res) => { return res.data }) + }, + // 客户参数类别 + GetTenantParamSelectList: () => { + return GetTenantParamSelectList().then((res) => { + return res.data + }) } } diff --git a/src/store/modules/options.ts b/src/store/modules/options.ts index 38214224..fcd60373 100644 --- a/src/store/modules/options.ts +++ b/src/store/modules/options.ts @@ -55,7 +55,9 @@ export const useOptionsStore = defineStore({ // 工厂 GetFactorySelectList: null, // 箱型 - GetCtnSelectList: null + GetCtnSelectList: null, + // 客户参数类别 + GetTenantParamSelectList: null }), getters: { // 通过code获取下拉字典(code)就是接口尾部单词 diff --git a/src/views/system/params/api.ts b/src/views/system/params/api.ts new file mode 100644 index 00000000..f076ded1 --- /dev/null +++ b/src/views/system/params/api.ts @@ -0,0 +1,56 @@ +/* + * @Description: + * @Author: lijj + * @Date: 2024-04-25 15:48:33 + */ + +import { request } from '/@/utils/request' +import { DataResult, PageRequest } from '/@/api/model/baseModel' +enum Api { + list = '/mainApi/ClientParam/GetClientParamList', + edit = '/mainApi/ClientParam//EditClientParam', + info = '/mainApi/ClientParam/GetClientParamInfo', + delete = '/mainApi/ClientParam/BatchDelClientParam', + GetTenantParamDataSelectList = '/mainApi/ClientParam/GetTenantParamDataSelectList' +} +// 列表 (Auth) +export function GetClientParamList(data: PageRequest) { + return request({ + url: Api.list, + method: 'post', + data + }) +} +// 编辑 (Auth) +export function EditClientParam(data: PageRequest) { + return request({ + url: Api.edit, + method: 'post', + data + }) +} +// 详情 (Auth) +export function GetClientParamInfo(query) { + return request({ + url: Api.info, + method: 'get', + params: query + }) +} + +// 删除 (Auth) +export function BatchDelClientParam(data: PageRequest) { + return request({ + url: Api.delete, + method: 'post', + data + }) +} + +export function GetTenantParamDataSelectList(query) { + return request({ + url: Api.GetTenantParamDataSelectList, + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/src/views/system/params/columns.tsx b/src/views/system/params/columns.tsx new file mode 100644 index 00000000..ee44550b --- /dev/null +++ b/src/views/system/params/columns.tsx @@ -0,0 +1,190 @@ +/* + * @Description: + * @Author: lijj + * @Date: 2024-04-25 15:48:33 + */ +import { ref } from 'vue' +import { BasicColumn, FormSchema } from '/@/components/Table' +// 引入字典数据 +import { getDictOption } from '/@/utils/dictUtil' +// 下拉数据 +import { getOptions } from '/@/hooks/dict' +import { useOptionsStore } from '/@/store/modules/options' +import { GetTenantParamDataSelectList } from './api' +const optionsStore = useOptionsStore() +const itemNameOption = ref([]) +// 模块字典 +const modulesDict = await getDictOption('modules') +export const columns: BasicColumn[] = [ + { + title: '客户名称', + dataIndex: 'customerName', + width: 150 + }, + { + title: '客户参数类型', + dataIndex: 'paramType', + width: 150 + }, + { + title: '客户参数名称', + dataIndex: 'paramName', + width: 200 + }, + { + title: '备注', + dataIndex: 'note', + width: 200 + } +] + +export const searchFormSchema: FormSchema[] = [ + { + field: 'paramName', + label: '客户参数名称', + colProps: { span: 6 }, + component: 'Input' + }, +] +export const formSchema: FormSchema[] = [ + { + label: '', + field: 'id', + component: 'Input', + defaultValue: '', + show: false + }, + { + field: 'paramCode', + label: '客户参数类别', + required: true, + component: 'ApiSelect', + colProps: { span: 12 }, + componentProps: ({ formModel }) => { + return { + option: optionsStore.getOptionsByCode('GetTenantParamSelectList'), + labelField: 'paramName', + valueField: 'paramCode', + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + onChange: (e, obj) => { + GetTenantParamDataSelectList({ code: e }).then(res => { + itemNameOption.value = res.data + }) + if (obj) { + formModel.paramName = obj.label + formModel.paramId = obj.id + formModel.paramType = obj.type + } else { + formModel.paramName = '' + formModel.paramId = '' + formModel.paramType = '' + } + } + } + } + }, + { + field: 'itemCode', + label: '客户参数名称', + required: true, + component: 'ApiSelect', + colProps: { span: 12 }, + componentProps: ({ formModel }) => { + return { + option: itemNameOption.value, + labelField: 'itemName', + valueField: 'itemCode', + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + onChange: (e, obj) => { + if (obj) { + formModel.itemName = obj.label + } else { + formModel.itemName = '' + } + } + } + } + }, + { + label: '', + field: 'itemName', + component: 'Input', + defaultValue: '', + show: false + }, + { + label: '', + field: 'customerName', + component: 'Input', + defaultValue: '', + show: false + }, + { + label: '', + field: 'paramId', + component: 'Input', + defaultValue: '', + show: false + }, + { + label: '', + field: 'paramName', + component: 'Input', + defaultValue: '', + show: false + }, + { + label: '', + field: 'paramType', + component: 'Input', + defaultValue: '', + show: false + }, + { + field: 'customerId', + label: '客户名称', + required: true, + component: 'ApiSelect', + colProps: { span: 12 }, + componentProps: ({ formModel }) => { + return { + api: () => { + return new Promise((resolve) => { + const arr = getOptions('custom') + resolve(arr) + }) + }, + labelField: 'shortName', + valueField: 'codeName', + resultField: 'data', + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + onChange: (e, obj) => { + if (obj) { + formModel.customerName = obj.label + } else { + formModel.customerName = '' + } + } + } + } + }, + { + field: 'orderNo', + label: '排序', + required: true, + component: 'Input', + colProps: { span: 12 } + }, + { + field: 'note', + label: '备注', + component: 'InputTextArea', + colProps: { span: 24 } + } +] diff --git a/src/views/system/params/components/Modal.vue b/src/views/system/params/components/Modal.vue new file mode 100644 index 00000000..0f306422 --- /dev/null +++ b/src/views/system/params/components/Modal.vue @@ -0,0 +1,110 @@ + + diff --git a/src/views/system/params/index.vue b/src/views/system/params/index.vue new file mode 100644 index 00000000..ac43e887 --- /dev/null +++ b/src/views/system/params/index.vue @@ -0,0 +1,115 @@ + +