调整基础数据、车船务、项目、合同

This commit is contained in:
2026-09-03 22:40:11 +08:00
parent 024e77801e
commit c63c7c3e33
43 changed files with 821 additions and 239 deletions
+58 -36
View File
@@ -2,7 +2,6 @@ import {
auditColumns,
createCrudOption,
packageOptions,
priceUnitOptions,
textRule,
} from './common';
@@ -25,10 +24,42 @@ export const config = {
enableAllDept: false,
};
// 单价统一按两位小数展示;格式非法时保留原值,交由表单校验提示。
export const formatCargoValue = value => {
if (value === undefined || value === null) return '';
const raw = String(value).trim();
if (!raw || raw === '-1') return '';
if (!/^\d+(?:\.\d+)?$/.test(raw)) return raw;
const number = Number(raw);
return Number.isFinite(number) ? number.toFixed(2) : raw;
};
export const option = createCrudOption([
{
label: '一级货物类型',
prop: 'firstCargoTypeName',
formslot: true,
order: 60,
span: 12,
minWidth: 150,
editDisabled: true,
rules: [{ required: true, message: '请选择一级货物类型', trigger: 'change' }],
},
{
label: '二级货物类型',
prop: 'secondCargoTypeName',
formslot: true,
order: 59,
span: 12,
minWidth: 150,
editDisabled: true,
rules: [{ required: true, message: '请选择二级货物类型', trigger: 'change' }],
},
{
label: '货物名称',
prop: 'cargoName',
order: 50,
span: 12,
minWidth: 150,
placeholder: '请输入',
rules: textRule('货物名称', 100, true),
@@ -37,6 +68,8 @@ export const option = createCrudOption([
label: '货物编号',
prop: 'cargoCode',
formslot: true,
order: 49,
span: 12,
minWidth: 120,
maxlength: 20,
showWordLimit: true,
@@ -45,14 +78,6 @@ export const option = createCrudOption([
{ max: 20, message: '货物编号不能超过20个字符', trigger: 'blur' },
],
},
{
label: '一级货物类型',
prop: 'firstCargoTypeName',
formslot: true,
minWidth: 150,
editDisabled: true,
rules: [{ required: true, message: '请选择一级货物类型', trigger: 'change' }],
},
{
label: '一级货物类型编码',
prop: 'firstCargoTypeCode',
@@ -61,14 +86,6 @@ export const option = createCrudOption([
addDisplay: false,
editDisabled: true,
},
{
label: '二级货物类型',
prop: 'secondCargoTypeName',
formslot: true,
minWidth: 150,
editDisabled: true,
rules: [{ required: true, message: '请选择二级货物类型', trigger: 'change' }],
},
{
label: '二级货物类型编码',
prop: 'secondCargoTypeCode',
@@ -174,12 +191,16 @@ export const option = createCrudOption([
prop: 'packageType',
type: 'select',
dicData: packageOptions,
order: 39,
span: 12,
minWidth: 100,
},
{
label: '品牌',
prop: 'brand',
search: false,
order: 40,
span: 12,
minWidth: 120,
placeholder: '请输入',
rules: textRule('品牌', 50),
@@ -187,22 +208,18 @@ export const option = createCrudOption([
{
label: '规格',
prop: 'specification',
order: 29,
span: 12,
minWidth: 120,
placeholder: '请输入',
rules: textRule('规格', 50),
},
{
label: '型号',
prop: 'model',
minWidth: 120,
placeholder: '请输入',
rules: textRule('型号', 50),
},
{
label: '单价',
label: '货值',
prop: 'cargoValue',
formslot: true,
formatter: row => (String(row.cargoValue) === '-1' ? '' : row.cargoValue),
order: 30,
formatter: row => formatCargoValue(row.cargoValue),
minWidth: 120,
rules: [
{
@@ -225,10 +242,19 @@ export const option = createCrudOption([
label: '计价单位',
prop: 'priceUnit',
type: 'select',
dicData: priceUnitOptions,
dicData: [],
display: false,
minWidth: 120,
},
{
label: '型号',
prop: 'model',
order: 19,
span: 12,
minWidth: 120,
placeholder: '请输入',
rules: textRule('型号', 50, true),
},
{
label: '尺寸',
prop: 'sizeText',
@@ -238,23 +264,19 @@ export const option = createCrudOption([
rules: textRule('尺寸', 100),
},
{
label: '其他说明1',
label: '说明',
prop: 'descriptionOne',
order: 20,
span: 12,
minWidth: 160,
placeholder: '请输入',
rules: textRule('其他说明1', 100),
},
{
label: '其他说明2',
prop: 'descriptionTwo',
minWidth: 160,
placeholder: '请输入',
rules: textRule('其他说明2', 100),
rules: textRule('说明', 100),
},
{
label: '备注',
prop: 'remark',
type: 'textarea',
order: 10,
minRows: 2,
span: 24,
maxlength: 200,