1、基础数据修复bug
2、客商模块修复bug
This commit is contained in:
@@ -6,6 +6,15 @@ import {
|
||||
textRule,
|
||||
} from './common';
|
||||
|
||||
const listDicFormatter = res => {
|
||||
const data = res?.data || res;
|
||||
if (Array.isArray(data)) return data;
|
||||
if (Array.isArray(data?.records)) return data.records;
|
||||
if (Array.isArray(data?.data)) return data.data;
|
||||
if (Array.isArray(data?.data?.records)) return data.data.records;
|
||||
return [];
|
||||
};
|
||||
|
||||
export const config = {
|
||||
title: '常用货物',
|
||||
permission: 'common_cargo',
|
||||
@@ -17,12 +26,29 @@ export const config = {
|
||||
};
|
||||
|
||||
export const option = createCrudOption([
|
||||
{
|
||||
label: '货物名称',
|
||||
prop: 'cargoName',
|
||||
minWidth: 150,
|
||||
placeholder: '请输入',
|
||||
rules: textRule('货物名称', 100, true),
|
||||
},
|
||||
{
|
||||
label: '货物编号',
|
||||
prop: 'cargoCode',
|
||||
formslot: true,
|
||||
minWidth: 120,
|
||||
maxlength: 20,
|
||||
showWordLimit: true,
|
||||
rules: [
|
||||
{ required: true, message: '请输入货物编号', trigger: 'blur' },
|
||||
{ max: 20, message: '货物编号不能超过20个字符', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '一级货物类型',
|
||||
prop: 'firstCargoTypeName',
|
||||
formslot: true,
|
||||
search: true,
|
||||
searchOrder: 3,
|
||||
minWidth: 150,
|
||||
editDisabled: true,
|
||||
rules: [{ required: true, message: '请选择一级货物类型', trigger: 'change' }],
|
||||
@@ -39,8 +65,6 @@ export const option = createCrudOption([
|
||||
label: '二级货物类型',
|
||||
prop: 'secondCargoTypeName',
|
||||
formslot: true,
|
||||
search: true,
|
||||
searchOrder: 4,
|
||||
minWidth: 150,
|
||||
editDisabled: true,
|
||||
rules: [{ required: true, message: '请选择二级货物类型', trigger: 'change' }],
|
||||
@@ -48,47 +72,118 @@ export const option = createCrudOption([
|
||||
{
|
||||
label: '二级货物类型编码',
|
||||
prop: 'secondCargoTypeCode',
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisabled: true,
|
||||
},
|
||||
// 搜索字段与表格、表单字段独立,避免筛选配置影响数据展示和编辑布局。
|
||||
{
|
||||
label: '货物名称',
|
||||
prop: 'cargoName',
|
||||
prop: 'searchCargoName',
|
||||
searchProp: 'cargoName',
|
||||
search: true,
|
||||
searchOrder: 1,
|
||||
minWidth: 150,
|
||||
rules: textRule('货物名称', 100, true),
|
||||
searchOrder: 5,
|
||||
searchPlaceholder: '请输入',
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '货物编号',
|
||||
prop: 'cargoCode',
|
||||
formslot: true,
|
||||
prop: 'searchCargoCode',
|
||||
searchProp: 'cargoCode',
|
||||
search: true,
|
||||
searchOrder: 4,
|
||||
searchPlaceholder: '请输入',
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '一级货物类型',
|
||||
prop: 'searchFirstCargoTypeName',
|
||||
searchProp: 'firstCargoTypeName',
|
||||
type: 'select',
|
||||
searchType: 'select',
|
||||
search: true,
|
||||
searchOrder: 3,
|
||||
searchPlaceholder: '请选择',
|
||||
dicUrl: '/blade-system/cargo-type/list?current=1&size=9999&typeLevel=1',
|
||||
dicFormatter: listDicFormatter,
|
||||
props: {
|
||||
label: 'cargoName',
|
||||
value: 'cargoName',
|
||||
},
|
||||
filterable: true,
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '二级货物类型',
|
||||
prop: 'searchSecondCargoTypeName',
|
||||
searchProp: 'secondCargoTypeName',
|
||||
type: 'select',
|
||||
searchType: 'select',
|
||||
search: true,
|
||||
searchOrder: 2,
|
||||
minWidth: 120,
|
||||
maxlength: 20,
|
||||
showWordLimit: true,
|
||||
rules: [
|
||||
{ required: true, message: '请输入货物编号', trigger: 'blur' },
|
||||
{ max: 20, message: '货物编号不能超过20个字符', trigger: 'blur' },
|
||||
],
|
||||
searchPlaceholder: '请选择',
|
||||
dicUrl: '/blade-system/cargo-type/list?current=1&size=9999&typeLevel=2',
|
||||
dicFormatter: listDicFormatter,
|
||||
props: {
|
||||
label: 'cargoName',
|
||||
value: 'cargoName',
|
||||
},
|
||||
filterable: true,
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '组织',
|
||||
prop: 'deptName',
|
||||
prop: 'searchDeptId',
|
||||
searchProp: 'deptId',
|
||||
type: 'select',
|
||||
searchType: 'select',
|
||||
search: true,
|
||||
searchOrder: 5,
|
||||
searchOrder: 1,
|
||||
searchPlaceholder: '请选择',
|
||||
dicData: [],
|
||||
props: {
|
||||
label: 'label',
|
||||
value: 'value',
|
||||
},
|
||||
filterable: true,
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '包装品牌',
|
||||
prop: 'packageBrand',
|
||||
slot: true,
|
||||
minWidth: 150,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '品牌',
|
||||
prop: 'brand',
|
||||
search: false,
|
||||
hide: true,
|
||||
minWidth: 120,
|
||||
placeholder: '请输入',
|
||||
rules: textRule('品牌', 50),
|
||||
},
|
||||
{
|
||||
@@ -96,10 +191,25 @@ export const option = createCrudOption([
|
||||
prop: 'packageType',
|
||||
type: 'select',
|
||||
dicData: packageOptions,
|
||||
hide: true,
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
label: '货值',
|
||||
label: '规格',
|
||||
prop: 'specification',
|
||||
minWidth: 120,
|
||||
placeholder: '请输入',
|
||||
rules: textRule('规格', 50),
|
||||
},
|
||||
{
|
||||
label: '型号',
|
||||
prop: 'model',
|
||||
minWidth: 120,
|
||||
placeholder: '请输入',
|
||||
rules: textRule('型号', 50),
|
||||
},
|
||||
{
|
||||
label: '单价',
|
||||
prop: 'cargoValue',
|
||||
formslot: true,
|
||||
minWidth: 120,
|
||||
@@ -129,29 +239,26 @@ export const option = createCrudOption([
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
label: '规格',
|
||||
prop: 'specification',
|
||||
minWidth: 120,
|
||||
rules: textRule('规格', 50),
|
||||
},
|
||||
{
|
||||
label: '型号',
|
||||
prop: 'model',
|
||||
minWidth: 120,
|
||||
rules: textRule('型号', 50),
|
||||
},
|
||||
{
|
||||
label: '说明',
|
||||
prop: 'descriptionOne',
|
||||
minWidth: 160,
|
||||
rules: textRule('说明', 100),
|
||||
},
|
||||
{
|
||||
label: '数据来源',
|
||||
prop: 'dataSource',
|
||||
label: '尺寸',
|
||||
prop: 'sizeText',
|
||||
minWidth: 120,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
rules: textRule('尺寸', 100),
|
||||
},
|
||||
{
|
||||
label: '其他说明1',
|
||||
prop: 'descriptionOne',
|
||||
minWidth: 160,
|
||||
placeholder: '请输入',
|
||||
rules: textRule('其他说明1', 100),
|
||||
},
|
||||
{
|
||||
label: '其他说明2',
|
||||
prop: 'descriptionTwo',
|
||||
minWidth: 160,
|
||||
placeholder: '请输入',
|
||||
rules: textRule('其他说明2', 100),
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
@@ -159,12 +266,25 @@ export const option = createCrudOption([
|
||||
type: 'textarea',
|
||||
minRows: 4,
|
||||
span: 24,
|
||||
hide: true,
|
||||
maxlength: 200,
|
||||
showWordLimit: true,
|
||||
placeholder: '请输入',
|
||||
rules: textRule('备注', 200),
|
||||
},
|
||||
...auditColumns,
|
||||
{
|
||||
label: '组织',
|
||||
prop: 'deptName',
|
||||
minWidth: 150,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
...auditColumns
|
||||
.filter(column => ['updateTime', 'createTime'].includes(column.prop))
|
||||
.sort(
|
||||
(first, second) =>
|
||||
['updateTime', 'createTime'].indexOf(first.prop) -
|
||||
['updateTime', 'createTime'].indexOf(second.prop)
|
||||
),
|
||||
]);
|
||||
|
||||
export const excelOption = {
|
||||
|
||||
Reference in New Issue
Block a user