Commit b1460e44 by 张恒

refactor(jcsj): 优化仓库位置组件配置

- 将上级位置字段的组件从 XjrSelect 替换为 TreeSelectComponent
- 移除旧的 API 数据源配置和相关属性设置
- 添加新的树形选择组件配置参数,包括树形结构和样式设置
- 更新上级位置字段的表单配置,统一使用树形选择组件
- 移除位置类型字段的静态选项配置,改为字典数据源方式
parent 371b0f11
...@@ -8,32 +8,31 @@ export const searchFormSchema: FormSchema[] = [ ...@@ -8,32 +8,31 @@ export const searchFormSchema: FormSchema[] = [
defaultValue: undefined, defaultValue: undefined,
component: 'Input', component: 'Input',
}, },
/* { {
field: 'parentId', field: 'parentId',
label: '上级位置', label: '上级位置',
defaultValue: undefined, defaultValue: undefined,
component: 'XjrSelect', component: 'TreeSelectComponent',
componentProps: { componentProps: {
datasourceType: 'api', span: 5,
apiConfig: { defaultValue: '',
path: '/getSjwz', showLabel: true,
method: 'GET', isShow: true,
apiId: '4b8c17ba3e6a4cd6ba85e63e3917424a', required: true,
apiParams: [ events: {},
{ key: '1', title: 'Query Params', tableInfo: [] }, rules: [],
{ key: '2', title: 'Header', tableInfo: [] }, treeConfig: {
{ key: '3', title: 'Body' }, id: '2008372971650543617',
], isMultiple: false,
script: height: 100,
'var sql="select id as value,name as label from roke_stock_location where parent_id = \'\'";\r\nreturn db.select(sql);', innerParams: [],
type: 2,
isSaveLast: true,
}, },
labelField: 'label', tooltipConfig: { visible: false, title: '提示文本' },
valueField: 'value', style: {},
mode: 'multiple',
showSearch: true,
getPopupContainer: () => document.body,
}, },
},*/ },
{ {
field: 'locationType', field: 'locationType',
label: '位置类型', label: '位置类型',
...@@ -253,56 +252,26 @@ export const formProps: FormProps = { ...@@ -253,56 +252,26 @@ export const formProps: FormProps = {
field: 'parentId', field: 'parentId',
label: '上级位置', label: '上级位置',
type: 'select', type: 'select',
component: 'XjrSelect', component: 'TreeSelectComponent',
colProps: { span: 24 }, colProps: { span: 24 },
componentProps: { componentProps: {
width: '100%', span: 5,
span: 7, defaultValue: '',
placeholder: '请选择下拉选择',
showLabel: true, showLabel: true,
showSearch: false, isShow: true,
isMultiple: false, required: true,
clearable: false, events: {},
disabled: false,
staticOptions: [
{ key: 1, label: '采购入库单', value: '采购入库单' },
{ key: 2, label: '销售出库单', value: '销售出库单' },
{ key: 3, label: '生产领料单', value: '生产领料单' },
{ key: 4, label: '生产入库单', value: '生产入库单' },
{ key: 5, label: '其他入库单', value: '其他入库单' },
{ key: 6, label: '其他出库单', value: '其他出库单' },
{ key: 7, label: '库存调拨单', value: '库存调拨单' },
{ key: 8, label: '库存盘点单', value: '库存盘点单' },
{ key: 9, label: '委外领料单', value: '委外领料单' },
{ key: 10, label: '委外入库单', value: '委外入库单' },
],
defaultSelect: null,
datasourceType: 'api',
params: null,
labelField: 'label',
valueField: 'value',
apiConfig: {
path: '/getSjwz',
method: 'GET',
apiId: '4b8c17ba3e6a4cd6ba85e63e3917424a',
apiParams: [
{ key: '1', title: 'Query Params', tableInfo: [] },
{ key: '2', title: 'Header', tableInfo: [] },
{ key: '3', title: 'Body' },
],
script:
'var sql="select id as value,name as label from roke_stock_location where parent_id = \'\'";\r\nreturn db.select(sql);',
},
dicOptions: [],
required: false,
rules: [], rules: [],
events: { treeConfig: {
change: id: '2008372971650543617',
"\nformActionType.httpRequest({\n requestType: 'get',\n requestUrl: '/magic-api/getLocation', // \n params: {\n id: formModel.parent_id\n },\n errorMessageMode: 'none'\n}).then(res => {\n if (res.length > 0) { \n var parentName = res[0].name;\n formModel.complete_name = parentName + '/' + formModel.name;\n } else {\n formModel.complete_name = formModel.parent_id + '/' + formModel.name;\n\n }\n}).catch(err => {\n console.error('接口请求异常:', err);\n formModel.complete_name = formModel.parent_id + '/' + formModel.name;\n});", isMultiple: false,
height: 100,
innerParams: [],
type: 2,
isSaveLast: true,
}, },
isShow: true,
tooltipConfig: { visible: false, title: '提示文本' }, tooltipConfig: { visible: false, title: '提示文本' },
style: { width: '100%' }, style: {},
}, },
}, },
{ {
...@@ -321,14 +290,7 @@ export const formProps: FormProps = { ...@@ -321,14 +290,7 @@ export const formProps: FormProps = {
isMultiple: false, isMultiple: false,
clearable: false, clearable: false,
disabled: false, disabled: false,
staticOptions: [
{ key: 1, label: '内部位置', value: '出库内部位置' },
{ key: 2, label: '虚拟位置', value: '虚拟位置' },
{ key: 3, label: '内部调拨客户位置', value: '内部调拨' },
{ key: 4, label: '供应商位置', value: '供应商位置' },
{ key: 5, label: '生产位置', value: '生产位置' },
{ key: 6, label: '中转位置', value: '中转位置' },
],
datasourceType: 'dic', datasourceType: 'dic',
params: { itemId: '2008349355210772481' }, params: { itemId: '2008349355210772481' },
labelField: 'name', labelField: 'name',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment