1、完善项目

2、完善合同
3、完善费用项
4、司机管理对接OCR
5、完善运输计划
6、完善临时额度
This commit is contained in:
2026-08-04 12:17:49 +08:00
parent 81c98f6ad8
commit f9f8221870
34 changed files with 7887 additions and 983 deletions

View File

@@ -1,9 +1,7 @@
export const transportTypeOptions = [
{ label: '公路整车', value: '公路整车' },
{ label: '公路零担', value: '公路零担' },
{ label: '公路运输', value: '公路运输' },
{ label: '铁路运输', value: '铁路运输' },
{ label: '水路运输', value: '水路运输' },
{ label: '跨境海运', value: '跨境海运' },
{ label: '航空运输', value: '航空运输' },
];

View File

@@ -4,98 +4,156 @@ import {
contractCategoryOptions,
contractStageOptions,
createCrudOption,
effectiveTypeOptions,
selectRule,
settlementModeOptions,
signTypeOptions,
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: 'contract_manage',
exportUrl: '/blade-transport/contract-manage/export-contract-manage',
exportName: '合同管理',
enableAllDept: true,
enableAllDept: false,
batchDelete: false,
enableContractForm: true,
enableProjectSelect: true,
enableContractPeriod: true,
enableContractFileUpload: true,
enableCurrentUserHandler: true,
enableBillingPlan: true,
enableSettlementRule: true,
enableReconciliation: true,
enableAttachmentTable: true,
enableChangeRecord: true,
enableOrganizationSelect: true,
enableContractCreateActions: true,
actions: ['copy'],
statusProp: 'approvalStatus',
statusTextProp: 'approvalStatusName',
customMenuActions: true,
editLabelStatusMap: {
change_rejected: '编辑变更内容',
},
deleteStatus: ['draft'],
deleteStage: ['draft'],
editStatus: ['draft', 'rejected', 'change_rejected'],
operations: [
{
action: 'toTemporary',
label: '转临时',
action: 'flow',
label: '查看流程',
statusProp: 'approvalStatus',
status: ['draft'],
stage: ['draft'],
permission: 'contract_manage_temp',
},
{
action: 'submitFormal',
label: '转正式',
statusProp: 'approvalStatus',
status: ['draft', 'rejected', 'approved'],
stage: ['temporary'],
permission: 'contract_manage_formal',
status: ['reviewing', 'change_reviewing'],
stage: ['temporary', 'formal'],
permission: 'contract_manage_view',
},
{
action: 'withdraw',
label: '撤回',
statusProp: 'approvalStatus',
status: ['reviewing', 'change_reviewing'],
status: ['reviewing'],
stage: ['temporary'],
permission: 'contract_manage_withdraw',
},
{
action: 'approve',
label: '审批通过',
type: 'success',
action: 'submitFormal',
label: '重新提交转正',
statusProp: 'approvalStatus',
status: ['reviewing', 'change_reviewing'],
permission: 'contract_manage_approve',
},
{
action: 'reject',
label: '审批驳回',
type: 'warning',
statusProp: 'approvalStatus',
status: ['reviewing', 'change_reviewing'],
permission: 'contract_manage_reject',
status: ['rejected'],
stage: ['temporary'],
permission: 'contract_manage_formal',
},
{
action: 'startChange',
label: '发起变更',
statusProp: 'approvalStatus',
status: ['approved', 'change_approved'],
status: ['approved'],
stage: ['formal'],
permission: 'contract_manage_change',
prompt: '请输入变更内容与原因',
},
{
action: 'terminate',
label: '终止',
type: 'danger',
action: 'startChange',
label: '再次发起变更',
statusProp: 'approvalStatus',
status: ['change_approved'],
stage: ['formal'],
permission: 'contract_manage_change',
prompt: '请输入变更内容与原因',
},
{
action: 'attachmentUpload',
label: '附件上传',
statusProp: 'approvalStatus',
status: ['approved', 'change_approved'],
stage: ['formal'],
permission: 'contract_manage_terminate',
prompt: '请输入终止原因',
permission: 'contract_manage_edit',
},
{
action: 'flow',
label: '查看流程',
statusProp: 'approvalStatus',
status: ['approved', 'change_approved'],
stage: ['formal', 'terminated'],
permission: 'contract_manage_view',
},
{
action: 'withdraw',
label: '撤回变更',
statusProp: 'approvalStatus',
status: ['change_reviewing'],
stage: ['formal'],
permission: 'contract_manage_withdraw',
},
{
action: 'startChange',
label: '重新提交变更',
statusProp: 'approvalStatus',
status: ['change_rejected'],
stage: ['formal'],
permission: 'contract_manage_change',
prompt: '请输入变更内容与原因',
},
],
};
export const option = createCrudOption([
{
label: '',
prop: 'basicInfoTitle',
formslot: true,
span: 24,
order: 200,
hide: true,
labelWidth: 0,
},
{
label: '合同编号',
prop: 'contractNo',
search: true,
searchOrder: 6,
order: 185,
disabled: true,
placeholder: '不填写,则系统自动生成',
minWidth: 160,
addDisplay: false,
editDisabled: true,
},
{
label: '合同名称',
prop: 'contractName',
search: true,
searchOrder: 7,
order: 180,
minWidth: 180,
rules: textRule('合同名称', 100, true),
},
@@ -103,26 +161,54 @@ export const option = createCrudOption([
label: '所属项目',
prop: 'projectName',
search: true,
searchOrder: 8,
searchType: 'select',
formslot: true,
order: 140,
dicUrl: '/blade-transport/project-apply/list?current=1&size=9999',
dicFormatter: listDicFormatter,
props: {
label: 'projectName',
value: 'projectName',
},
filterable: true,
minWidth: 160,
rules: selectRule('所属项目'),
},
{
label: '所属项目ID',
prop: 'projectId',
hide: true,
display: false,
},
{
label: '所属组织',
prop: 'organizationName',
search: true,
searchOrder: 3,
searchType: 'cascader',
formslot: true,
order: 120,
dicData: [],
props: {
label: 'label',
value: 'id',
children: 'children',
},
checkStrictly: true,
emitPath: false,
showAllLevels: false,
filterable: true,
minWidth: 150,
addDisplay: false,
editDisabled: true,
rules: selectRule('所属组织'),
},
{
label: '合同类别',
prop: 'contractCategory',
type: 'select',
search: true,
searchOrder: 9,
order: 170,
dicData: contractCategoryOptions,
minWidth: 130,
rules: selectRule('合同类别'),
@@ -132,18 +218,60 @@ export const option = createCrudOption([
prop: 'signType',
type: 'select',
search: true,
searchOrder: 1,
span: 24,
order: 190,
dicData: signTypeOptions,
minWidth: 120,
rules: selectRule('签约类型'),
},
{
label: '生效类型',
prop: 'effectiveType',
type: 'select',
search: true,
searchOrder: 5,
dicData: effectiveTypeOptions,
hide: true,
display: false,
},
{
label: '甲方',
prop: 'partyA',
type: 'select',
order: 160,
dicUrl: '/blade-transport/customer-archive/list?current=1&size=9999&approvalStatus=approved',
dicFormatter: listDicFormatter,
props: {
label: 'fullName',
value: 'fullName',
},
filterable: true,
minWidth: 160,
rules: selectRule('甲方'),
},
{
label: '乙方',
prop: 'partyB',
type: 'select',
order: 150,
dicUrl: '/blade-transport/customer-archive/list?current=1&size=9999&approvalStatus=approved',
dicFormatter: listDicFormatter,
props: {
label: 'fullName',
value: 'fullName',
},
filterable: true,
minWidth: 160,
rules: selectRule('乙方'),
},
{
label: '合同期限',
prop: 'contractPeriod',
formslot: true,
order: 130,
hide: true,
rules: [{ required: true, message: '请选择合同期限', trigger: 'change' }],
},
{
label: '开始日期',
@@ -152,6 +280,8 @@ export const option = createCrudOption([
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
minWidth: 130,
addDisplay: false,
editDisplay: false,
},
{
label: '结束日期',
@@ -160,6 +290,8 @@ export const option = createCrudOption([
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
minWidth: 130,
addDisplay: false,
editDisplay: false,
},
{
label: '临时效力起',
@@ -168,6 +300,8 @@ export const option = createCrudOption([
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
minWidth: 130,
addDisplay: false,
editDisplay: false,
},
{
label: '临时效力止',
@@ -176,11 +310,16 @@ export const option = createCrudOption([
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
minWidth: 130,
addDisplay: false,
editDisplay: false,
},
{
label: '经办人',
prop: 'handlerUserName',
order: 110,
disabled: true,
minWidth: 120,
rules: textRule('经办人', 50, true),
},
{
label: '签订日期',
@@ -188,14 +327,20 @@ export const option = createCrudOption([
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
hide: true,
order: 100,
minWidth: 130,
rules: [{ required: true, message: '请选择签订日期', trigger: 'change' }],
},
{
label: '结算方式',
prop: 'settlementMode',
type: 'select',
dicData: settlementModeOptions,
hide: true,
order: 90,
minWidth: 120,
rules: selectRule('结算方式'),
},
{
label: '合同格式',
@@ -205,54 +350,74 @@ export const option = createCrudOption([
{ label: '电子合同', value: '电子合同' },
{ label: '纸质合同', value: '纸质合同' },
],
hide: true,
order: 80,
minWidth: 120,
rules: selectRule('合同格式'),
},
{
label: '法人章',
label: '是否需要加盖法人章',
prop: 'legalSealFlag',
type: 'switch',
type: 'select',
dicData: [
{ label: '否', value: 0 },
{ label: '是', value: 1 },
],
value: 0,
hide: true,
order: 70,
minWidth: 100,
rules: selectRule('是否需要加盖法人章'),
},
{
label: '一式份数',
label: '一式',
prop: 'copyCount',
type: 'number',
formslot: true,
hide: true,
order: 60,
minWidth: 110,
},
{
label: '回款账期(天)',
label: '回款账期',
prop: 'paymentDays',
type: 'number',
formslot: true,
hide: true,
order: 50,
minWidth: 130,
},
{
label: '创建时间',
prop: 'createTime',
type: 'datetime',
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
minWidth: 160,
addDisplay: false,
editDisplay: false,
},
{
label: '合同阶段',
prop: 'contractStage',
type: 'select',
search: true,
searchOrder: 2,
slot: true,
dicData: contractStageOptions,
minWidth: 120,
addDisplay: false,
editDisplay: false,
fixed: 'right',
},
{
label: '审核状态',
prop: 'approvalStatus',
type: 'select',
search: true,
searchOrder: 4,
slot: true,
dicData: contractApprovalStatusOptions,
minWidth: 130,
addDisplay: false,
editDisplay: false,
fixed: 'right',
},
{
label: '当前节点',
@@ -276,53 +441,133 @@ export const option = createCrudOption([
{ label: '关闭', value: 0 },
{ label: '开启', value: 1 },
],
value: 0,
value: 1,
hide: true,
display: false,
minWidth: 110,
},
{
label: '合同主文件JSON',
prop: 'contractFileJson',
type: 'textarea',
span: 24,
hide: true,
},
{
label: '其它附件JSON',
prop: 'attachmentsJson',
type: 'textarea',
span: 24,
hide: true,
},
{
label: '计费方案JSON',
prop: 'billingPlanJson',
type: 'textarea',
span: 24,
hide: true,
},
{
label: '结算生成规则JSON',
prop: 'settlementRuleJson',
type: 'textarea',
span: 24,
hide: true,
},
{
label: '对账配置JSON',
prop: 'reconciliationJson',
type: 'textarea',
span: 24,
hide: true,
},
{
label: '备注',
prop: 'remark',
type: 'textarea',
span: 24,
hide: true,
order: 40,
maxlength: 2000,
showWordLimit: true,
rules: textRule('备注', 2000),
},
...auditColumns,
{
label: '',
prop: 'contractFileTitle',
formslot: true,
span: 24,
order: 30,
hide: true,
labelWidth: 0,
},
{
label: '附件',
prop: 'contractFileJson',
formslot: true,
span: 24,
order: 20,
hide: true,
},
{
label: '',
prop: 'billingInfoTitle',
formslot: true,
span: 24,
order: 10,
hide: true,
labelWidth: 0,
},
{
label: '',
prop: 'billingPlanJson',
formslot: true,
span: 24,
order: 0,
hide: true,
labelWidth: 0,
},
{
label: '',
prop: 'settlementRuleTitle',
formslot: true,
span: 24,
order: -10,
hide: true,
labelWidth: 0,
},
{
label: '',
prop: 'settlementRuleJson',
formslot: true,
span: 24,
order: -20,
hide: true,
labelWidth: 0,
},
{
label: '',
prop: 'reconciliationTitle',
formslot: true,
span: 24,
order: -30,
hide: true,
labelWidth: 0,
},
{
label: '',
prop: 'reconciliationJson',
formslot: true,
span: 24,
order: -40,
hide: true,
labelWidth: 0,
},
{
label: '',
prop: 'attachmentTitle',
formslot: true,
span: 24,
order: -50,
hide: true,
labelWidth: 0,
},
{
label: '',
prop: 'attachmentsJson',
formslot: true,
span: 24,
order: -60,
hide: true,
labelWidth: 0,
},
{
label: '',
prop: 'changeRecordTitle',
formslot: true,
span: 24,
order: -70,
hide: true,
labelWidth: 0,
},
{
label: '',
prop: 'changeRecordJson',
formslot: true,
span: 24,
order: -80,
hide: true,
labelWidth: 0,
},
...auditColumns
.filter(column => column.prop !== 'createTime')
.map(column => ({ ...column, hide: true })),
]);
option.span = 8;
option.dialogWidth = 1480;

View File

@@ -6,6 +6,7 @@ import {
selectRule,
textRule,
} from './common';
import { applyTableMenuWidth } from '@/utils/table-menu';
export const config = {
title: '过程配置',
@@ -19,7 +20,7 @@ export const config = {
deleteStatus: [0, 2],
};
export const option = {
export const option = applyTableMenuWidth({
...createCrudOption([
{
label: '',
@@ -144,4 +145,4 @@ export const option = {
dialogTop: '10px',
dialogWidth: '96%',
searchSpan: 8,
};
}, 5);

View File

@@ -10,7 +10,6 @@ import {
selectRule,
settlementModeOptions,
textRule,
transportTypeOptions,
} from './common';
const amountRules = label => [
@@ -18,12 +17,24 @@ const amountRules = label => [
nonNegativeRule(label),
];
const userDicFormatter = res => {
const list = Array.isArray(res)
? res
: Array.isArray(res.data)
? res.data
: res.data?.records || [];
return list.map(user => ({
...user,
realName: user.realName || user.name || user.account,
}));
};
export const config = {
title: '项目管理',
permission: 'project_apply',
exportUrl: '/blade-transport/project-apply/export-project-apply',
exportName: '项目立项',
enableAllDept: true,
enableAllDept: false,
statusProp: 'approvalStatus',
statusTextProp: 'approvalStatusName',
deleteStatus: ['draft', 'withdrawn', 'rejected'],
@@ -31,9 +42,9 @@ export const config = {
operations: [
{
action: 'submitApproval',
label: '提交审批',
label: '提交',
statusProp: 'approvalStatus',
status: ['draft', 'withdrawn', 'rejected'],
status: ['draft'],
permission: 'project_apply_submit',
},
{
@@ -45,7 +56,7 @@ export const config = {
},
{
action: 'approve',
label: '审批通过',
label: '通过',
type: 'success',
statusProp: 'approvalStatus',
status: ['reviewing', 'change_reviewing'],
@@ -61,11 +72,10 @@ export const config = {
},
{
action: 'startChange',
label: '发起变更',
label: '变更',
statusProp: 'approvalStatus',
status: ['approved', 'change_approved'],
status: ['approved'],
permission: 'project_apply_change',
prompt: '请输入变更内容与原因',
},
{
action: 'voidProject',
@@ -84,6 +94,7 @@ export const option = createCrudOption([
label: '立项申请单号',
prop: 'applyNo',
search: true,
searchOrder: 7,
minWidth: 160,
addDisplay: false,
editDisabled: true,
@@ -99,6 +110,7 @@ export const option = createCrudOption([
label: '项目名称',
prop: 'projectName',
search: true,
searchOrder: 6,
minWidth: 180,
maxlength: 50,
rules: textRule('项目名称', 50, true),
@@ -106,6 +118,7 @@ export const option = createCrudOption([
{
label: '项目简称',
prop: 'projectShortName',
hide: true,
minWidth: 140,
maxlength: 20,
rules: textRule('项目简称', 20, true),
@@ -115,13 +128,27 @@ export const option = createCrudOption([
prop: 'projectType',
type: 'select',
search: true,
searchOrder: 3,
dicData: projectTypeOptions,
minWidth: 120,
rules: selectRule('项目类型'),
},
{
label: '客户名称',
prop: 'customerNames',
minWidth: 180,
rules: textRule('客户名称', 255, true),
},
{
label: '下游承运商',
prop: 'carrierNames',
minWidth: 180,
rules: textRule('下游承运商', 255, true),
},
{
label: '业务部门',
prop: 'businessDeptName',
hide: true,
minWidth: 150,
rules: textRule('业务部门', 50, true),
},
@@ -129,6 +156,8 @@ export const option = createCrudOption([
label: '承办部门',
prop: 'undertakeDeptName',
search: true,
searchLabel: '承办单位',
searchOrder: 5,
minWidth: 150,
rules: textRule('承办部门', 50, true),
},
@@ -140,13 +169,29 @@ export const option = createCrudOption([
{
label: '项目负责人',
prop: 'principalUserName',
search: true,
minWidth: 130,
rules: textRule('项目负责人', 50, true),
},
{
label: '项目负责人',
prop: 'principalUserId',
type: 'select',
search: true,
searchOrder: 4,
filterable: true,
dicUrl: '/blade-system/user/user-list',
dicFormatter: userDicFormatter,
props: {
label: 'realName',
value: 'id',
},
hide: true,
display: false,
},
{
label: '项目经办人',
prop: 'handlerUserName',
hide: true,
minWidth: 130,
rules: textRule('项目经办人', 50, true),
},
@@ -156,6 +201,7 @@ export const option = createCrudOption([
type: 'select',
dicData: projectSourceOptions,
value: '商务洽谈',
hide: true,
minWidth: 120,
},
{
@@ -163,6 +209,7 @@ export const option = createCrudOption([
prop: 'fundLimit',
type: 'number',
precision: 2,
hide: true,
minWidth: 190,
rules: amountRules('项目资金使用额度'),
},
@@ -171,6 +218,7 @@ export const option = createCrudOption([
prop: 'receivableLimit',
type: 'number',
precision: 2,
hide: true,
minWidth: 200,
rules: amountRules('项目应收账款额度'),
},
@@ -178,6 +226,7 @@ export const option = createCrudOption([
label: '应收账款回款期限(天)',
prop: 'receivableDays',
type: 'number',
hide: true,
minWidth: 190,
rules: [{ required: true, message: '请输入应收账款回款期限', trigger: 'blur' }],
},
@@ -185,30 +234,20 @@ export const option = createCrudOption([
label: '回款账期(天)',
prop: 'paymentDays',
type: 'number',
hide: true,
minWidth: 140,
rules: [{ required: true, message: '请输入回款账期', trigger: 'blur' }],
},
{
label: '客户名称',
prop: 'customerNames',
search: true,
minWidth: 180,
rules: textRule('客户名称', 255, true),
},
{
label: '下游承运商',
prop: 'carrierNames',
minWidth: 180,
rules: textRule('下游承运商', 255, true),
},
{
label: '货物类型',
prop: 'cargoType',
hide: true,
minWidth: 120,
},
{
label: '预估货物数量',
prop: 'cargoQuantity',
hide: true,
minWidth: 150,
maxlength: 100,
},
@@ -218,6 +257,7 @@ export const option = createCrudOption([
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
hide: true,
minWidth: 130,
},
{
@@ -226,11 +266,13 @@ export const option = createCrudOption([
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
hide: true,
minWidth: 130,
},
{
label: '运输线路',
prop: 'transportRoute',
hide: true,
minWidth: 180,
maxlength: 100,
},
@@ -238,7 +280,12 @@ export const option = createCrudOption([
label: '运输类型',
prop: 'transportType',
type: 'select',
dicData: transportTypeOptions,
dicUrl: '/blade-system/dict-biz/dictionary?code=transport_type',
props: {
label: 'dictValue',
value: 'dictKey',
},
hide: true,
minWidth: 120,
},
{
@@ -246,6 +293,7 @@ export const option = createCrudOption([
prop: 'businessType',
type: 'select',
dicData: businessTypeOptions,
hide: true,
minWidth: 130,
},
{
@@ -253,6 +301,7 @@ export const option = createCrudOption([
prop: 'projectScale',
type: 'number',
precision: 2,
hide: true,
minWidth: 150,
rules: [nonNegativeRule('项目规模')],
},
@@ -261,6 +310,7 @@ export const option = createCrudOption([
prop: 'estimatedProfit',
type: 'number',
precision: 2,
hide: true,
minWidth: 150,
rules: [nonNegativeRule('预计利润')],
},
@@ -269,6 +319,7 @@ export const option = createCrudOption([
prop: 'fundDemand',
type: 'number',
precision: 2,
hide: true,
minWidth: 150,
rules: [nonNegativeRule('资金需求')],
},
@@ -277,6 +328,7 @@ export const option = createCrudOption([
prop: 'settlementMode',
type: 'select',
dicData: settlementModeOptions,
hide: true,
minWidth: 120,
},
{
@@ -284,12 +336,12 @@ export const option = createCrudOption([
prop: 'approvalStatus',
type: 'select',
search: true,
searchOrder: 2,
slot: true,
dicData: projectApprovalStatusOptions,
minWidth: 130,
addDisplay: false,
editDisplay: false,
fixed: 'right',
},
{
label: '当前节点',
@@ -310,6 +362,7 @@ export const option = createCrudOption([
prop: 'effectiveType',
type: 'select',
search: true,
searchOrder: 1,
dicData: effectiveTypeOptions,
value: 'temporary',
minWidth: 110,
@@ -349,5 +402,5 @@ export const option = createCrudOption([
span: 24,
hide: true,
},
...auditColumns,
...auditColumns.map(column => ({ ...column, hide: true })),
]);

View File

@@ -12,7 +12,7 @@ export const config = {
permission: 'shipping_template',
exportUrl: '/blade-transport/shipping-template/export-shipping-template',
exportName: '发货模板',
enableAllDept: true,
enableAllDept: false,
actions: ['copy'],
};

View File

@@ -1,23 +1,61 @@
import { approvalStatusOptions, auditColumns, createCrudOption, nonNegativeRule, textRule } from './common';
import {
approvalStatusOptions,
auditColumns,
createCrudOption,
nonNegativeRule,
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 [];
};
const userDicFormatter = res =>
listDicFormatter(res).map(user => ({
...user,
realName: user.realName || user.name || user.account,
}));
export const config = {
title: '临时额度管理',
permission: 'temporary_credit_limit',
exportUrl: '/blade-transport/temporary-credit-limit/export-temporary-credit-limit',
exportName: '临时额度申请',
enableAllDept: true,
enableAllDept: false,
enableProjectSelect: true,
enableAttachmentTable: true,
enableDraftSave: true,
saveAsDraft: true,
defaultForm: {
usedFundLimit: 0,
remainingFundLimit: 0,
},
statusProp: 'approvalStatus',
statusTextProp: 'approvalStatusName',
deleteStatus: ['draft', 'withdrawn', 'rejected'],
editStatus: ['draft', 'withdrawn', 'rejected'],
deleteStatus: ['draft', 'withdrawn', 'rejected', '草稿'],
editStatus: ['draft', 'withdrawn', 'rejected', '草稿', '已撤回'],
ignoreReadonlyEditStatus: ['draft', 'withdrawn', '草稿', '已撤回'],
ignoreReadonlyDeleteStatus: ['draft', '草稿'],
operations: [
{
action: 'submitApproval',
label: '提交审批',
label: '提交',
statusProp: 'approvalStatus',
status: ['draft', 'withdrawn', 'rejected'],
permission: 'temporary_credit_limit_submit',
},
{
action: 'flow',
label: '流程',
statusProp: 'approvalStatus',
status: ['reviewing'],
permission: 'temporary_credit_limit_view',
},
{
action: 'withdraw',
label: '撤回',
@@ -44,145 +82,184 @@ export const config = {
],
};
export const option = createCrudOption([
{
label: '申请单号',
prop: 'applicationNo',
search: true,
minWidth: 160,
addDisplay: false,
editDisabled: true,
},
{
label: '项目名称',
prop: 'projectName',
search: true,
minWidth: 180,
rules: textRule('项目名称', 100, true),
},
{
label: '项目ID',
prop: 'projectId',
hide: true,
},
{
label: '项目编号',
prop: 'projectCode',
minWidth: 150,
rules: textRule('项目编号', 50, true),
},
{
label: '承办部门',
prop: 'undertakeDeptName',
minWidth: 150,
rules: textRule('承办部门', 50, true),
},
{
label: '项目资金使用额度(万元)',
prop: 'projectFundLimit',
type: 'number',
precision: 2,
minWidth: 200,
editDisabled: true,
rules: [nonNegativeRule('项目资金使用额度')],
},
{
label: '已使用项目资金额度(万元)',
prop: 'usedFundLimit',
type: 'number',
precision: 2,
minWidth: 220,
value: 0,
editDisabled: true,
rules: [nonNegativeRule('已使用项目资金额度')],
},
{
label: '剩余项目资金使用额度(万元)',
prop: 'remainingFundLimit',
type: 'number',
precision: 2,
minWidth: 230,
editDisabled: true,
rules: [nonNegativeRule('剩余项目资金使用额度')],
},
{
label: '申请临时额度(万元)',
prop: 'applyLimit',
type: 'number',
precision: 2,
minWidth: 180,
rules: [
{ required: true, message: '请输入申请临时额度', trigger: 'blur' },
nonNegativeRule('申请临时额度'),
],
},
{
label: '申请有效期至',
prop: 'validUntil',
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
minWidth: 140,
rules: [{ required: true, message: '请选择申请有效期至', trigger: 'change' }],
},
{
label: '申请部门',
prop: 'applyDeptName',
search: true,
minWidth: 150,
addDisplay: false,
editDisabled: true,
},
{
label: '申请人',
prop: 'applicantName',
search: true,
minWidth: 120,
addDisplay: false,
editDisabled: true,
},
{
label: '审批状态',
prop: 'approvalStatus',
type: 'select',
search: true,
slot: true,
dicData: approvalStatusOptions,
minWidth: 130,
addDisplay: false,
editDisplay: false,
fixed: 'right',
},
{
label: '当前节点',
prop: 'currentNode',
minWidth: 140,
addDisplay: false,
editDisplay: false,
},
{
label: '当前处理人',
prop: 'currentProcessor',
minWidth: 130,
addDisplay: false,
editDisplay: false,
},
{
label: '附件JSON',
prop: 'attachmentsJson',
type: 'textarea',
span: 24,
hide: true,
},
{
label: '备注',
prop: 'remark',
type: 'textarea',
span: 24,
hide: true,
maxlength: 500,
showWordLimit: true,
rules: textRule('备注', 500),
},
...auditColumns,
]);
export const option = {
...createCrudOption([
{
label: '申请单号',
prop: 'applicationNo',
search: true,
searchOrder: 5,
minWidth: 160,
addDisplay: false,
editDisplay: false,
editDisabled: true,
},
{
label: '项目名称',
prop: 'projectName',
search: true,
searchOrder: 4,
searchType: 'select',
formslot: true,
dicUrl: '/blade-transport/project-apply/list?current=1&size=9999',
dicFormatter: listDicFormatter,
props: {
label: 'projectName',
value: 'projectName',
},
filterable: true,
minWidth: 180,
rules: textRule('项目名称', 100, true),
},
{
label: '项目ID',
prop: 'projectId',
hide: true,
display: false,
},
{
label: '项目编号',
prop: 'projectCode',
hide: true,
disabled: true,
minWidth: 150,
rules: textRule('项目编号', 50, true),
},
{
label: '承办部门',
prop: 'undertakeDeptName',
hide: true,
disabled: true,
minWidth: 150,
rules: textRule('承办部门', 50, true),
},
{
label: '项目资金使用额度(万元)',
prop: 'projectFundLimit',
hide: true,
disabled: true,
minWidth: 200,
rules: [nonNegativeRule('项目资金使用额度')],
},
{
label: '已使用项目资金使用额度(万元)',
prop: 'usedFundLimit',
hide: true,
disabled: true,
minWidth: 220,
value: 0,
rules: [nonNegativeRule('已使用项目资金额度')],
},
{
label: '剩余项目资金使用额度(万元)',
prop: 'remainingFundLimit',
hide: true,
disabled: true,
minWidth: 230,
value: 0,
rules: [nonNegativeRule('剩余项目资金使用额度')],
},
{
label: '申请临时额度(万元)',
prop: 'applyLimit',
formslot: true,
minWidth: 180,
rules: [
{ required: true, message: '请输入申请临时额度', trigger: 'blur' },
nonNegativeRule('申请临时额度'),
],
},
{
label: '申请有效期至',
prop: 'validUntil',
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
minWidth: 140,
rules: [{ required: true, message: '请选择申请有效期至', trigger: 'change' }],
},
{
label: '申请部门',
prop: 'applyDeptName',
search: true,
searchOrder: 2,
searchType: 'select',
dicUrl: '/blade-system/dept/select',
props: {
label: 'deptName',
value: 'deptName',
},
filterable: true,
minWidth: 150,
addDisplay: false,
editDisplay: false,
editDisabled: true,
},
{
label: '申请人',
prop: 'applicantName',
search: true,
searchOrder: 3,
searchType: 'select',
dicUrl: '/blade-system/user/user-list',
dicFormatter: userDicFormatter,
props: {
label: 'realName',
value: 'realName',
},
filterable: true,
minWidth: 120,
addDisplay: false,
editDisplay: false,
editDisabled: true,
},
{
label: '审批状态',
searchLabel: '状态',
prop: 'approvalStatus',
type: 'select',
search: true,
searchOrder: 1,
slot: true,
dicData: approvalStatusOptions,
minWidth: 130,
addDisplay: false,
editDisplay: false,
fixed: 'right',
},
{
label: '当前节点',
prop: 'currentNode',
minWidth: 140,
addDisplay: false,
editDisplay: false,
},
{
label: '当前处理人',
prop: 'currentProcessor',
minWidth: 130,
addDisplay: false,
editDisplay: false,
},
{
label: '备注',
prop: 'remark',
type: 'textarea',
span: 24,
hide: true,
maxlength: 200,
showWordLimit: true,
rules: textRule('备注', 200),
},
{
label: '附件',
prop: 'attachmentsJson',
formslot: true,
span: 24,
hide: true,
},
...auditColumns.map(column => ({ ...column, hide: true })),
]),
dialogWidth: 1480,
index: false,
};

View File

@@ -2,18 +2,128 @@ import {
auditColumns,
createCrudOption,
dataSourceOptions,
phoneRule,
planStatusOptions,
selectRule,
textRule,
transportTypeOptions,
} 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 [];
};
const parseGoodsRows = value => {
if (!value) return [];
if (Array.isArray(value)) return value;
if (typeof value === 'object') return [value];
try {
const data = JSON.parse(value);
return Array.isArray(data) ? data : [data];
} catch (error) {
return [];
}
};
const formatGoodsField = (row, propList) => {
const values = propList.map(prop => row[prop]).filter(Boolean);
if (values.length) return values.join('、');
return parseGoodsRows(row.goodsJson)
.map(item => propList.map(prop => item?.[prop]).find(Boolean))
.filter(Boolean)
.join('、');
};
const getGoodsQuantity = item => {
const value = item?.quantity ?? item?.cargoQuantity ?? item?.goodsQuantity ?? 0;
const number = Number(String(value).replace(/,/g, ''));
return Number.isFinite(number) ? number : 0;
};
const formatGoodsQuantity = value => {
const number = Math.round((value + Number.EPSILON) * 1000) / 1000;
return Number.isInteger(number) ? String(number) : String(number).replace(/\.?0+$/, '');
};
const getSecondCargoTypeName = item =>
item?.cargoType ||
item?.secondCargoTypeName ||
item?.secondCargoType ||
item?.goodsType ||
item?.type ||
item?.cargoTypeName ||
item?.firstCargoTypeName ||
'货物';
const formatGoodsInfo = row => {
const rows = parseGoodsRows(row.goodsJson);
if (!rows.length) return row.goodsInfo || '';
const groups = rows.reduce((result, item = {}) => {
const hasGoodsInfo = [
item.cargoName,
item.goodsName,
item.name,
item.cargoType,
item.secondCargoTypeName,
item.goodsType,
item.type,
item.quantity,
item.cargoQuantity,
item.goodsQuantity,
item.quantityUnit,
item.goodsQuantityUnit,
item.unit,
].some(Boolean);
if (!hasGoodsInfo) return result;
const unit = item.quantityUnit || item.goodsQuantityUnit || item.unit || '';
if (!result[unit]) {
result[unit] = {
typeName: getSecondCargoTypeName(item),
count: 0,
quantity: 0,
};
}
result[unit].count += 1;
result[unit].quantity += getGoodsQuantity(item);
return result;
}, {});
const text = Object.entries(groups)
.map(([unit, group]) => {
const quantity = `${formatGoodsQuantity(group.quantity)}${unit}`;
return `${group.typeName}${group.count}中货物 | ${quantity}`;
})
.join('; ');
return text || row.goodsInfo || '';
};
const formatDispatchProgress = row =>
row.dispatchProgressName || row.dispatchProgress || row.progress || '';
const auditColumn = prop => ({ ...auditColumns.find(item => item.prop === prop) });
export const config = {
title: '运输计划',
permission: 'transport_plan',
exportUrl: '/blade-transport/transport-plan/export-transport-plan',
exportName: '运输计划',
enableAllDept: true,
enableAllDept: false,
enableProjectSelect: true,
enableAttachmentTable: true,
enableTransportPlanForm: true,
enableTransportPlanCreateActions: true,
attachmentTitle: '附件',
searchRangeMap: {
planStartDateRange: ['planStartDateStart', 'planStartDateEnd'],
planEndDateRange: ['planEndDateStart', 'planEndDateEnd'],
},
actions: ['copy', 'cancel', 'complete'],
statusProp: 'businessStatus',
statusTextProp: 'businessStatusName',
@@ -21,155 +131,366 @@ export const config = {
editStatus: ['draft', 'waiting_dispatch'],
};
export const option = createCrudOption([
{
label: '计划单号',
prop: 'planNo',
search: true,
minWidth: 150,
addDisplay: false,
editDisabled: true,
},
{
label: '计划名称',
prop: 'planName',
search: true,
minWidth: 150,
rules: textRule('计划名称', 50, true),
},
{
label: '项目',
prop: 'projectName',
minWidth: 150,
rules: textRule('项目', 100, true),
},
{
label: '项目ID',
prop: 'projectId',
hide: true,
},
{
label: '客户合同',
prop: 'contractName',
minWidth: 160,
rules: textRule('客户合同', 100, true),
},
{
label: '客户合同ID',
prop: 'contractId',
hide: true,
},
{
label: '客户名称',
prop: 'customerName',
search: true,
minWidth: 150,
},
{
label: '运输类型',
prop: 'transportType',
type: 'select',
search: true,
dicData: transportTypeOptions,
minWidth: 130,
rules: selectRule('运输类型'),
},
{
label: '计划开始日期',
prop: 'planStartDate',
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
search: true,
minWidth: 130,
},
{
label: '计划结束日期',
prop: 'planEndDate',
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
search: true,
minWidth: 130,
},
{
label: '发货地',
prop: 'departureName',
minWidth: 140,
rules: textRule('发货地', 100, true),
},
{
label: '发货地址',
prop: 'departureAddress',
search: true,
minWidth: 220,
rules: textRule('发货地址', 255, true),
},
{
label: '收货地',
prop: 'arrivalName',
minWidth: 140,
rules: textRule('收货地', 100, true),
},
{
label: '收货地址',
prop: 'arrivalAddress',
search: true,
minWidth: 220,
rules: textRule('收货地址', 255, true),
},
{
label: '货物信息JSON',
prop: 'goodsJson',
type: 'textarea',
minRows: 5,
span: 24,
hide: true,
},
{
label: '附件JSON',
prop: 'attachmentsJson',
type: 'textarea',
minRows: 3,
span: 24,
hide: true,
},
{
label: '数据来源',
prop: 'dataSource',
type: 'select',
search: true,
dicData: dataSourceOptions,
minWidth: 120,
},
{
label: '业务状态',
prop: 'businessStatus',
type: 'select',
slot: true,
search: true,
dicData: planStatusOptions,
minWidth: 120,
addDisplay: false,
editDisplay: false,
},
{
label: '所属组织',
prop: 'deptName',
minWidth: 150,
addDisplay: false,
editDisplay: false,
},
{
label: '备注',
prop: 'remark',
type: 'textarea',
minRows: 4,
span: 24,
hide: true,
maxlength: 200,
showWordLimit: true,
rules: textRule('备注', 200),
},
...auditColumns,
]);
export const option = {
...createCrudOption([
{
label: '',
prop: 'basicInfoTitle',
formslot: true,
span: 24,
order: 400,
hide: true,
labelWidth: 0,
},
{
label: '计划单号',
prop: 'planNo',
search: true,
searchOrder: 13,
span: 6,
order: 370,
minWidth: 150,
disabled: true,
placeholder: '系统自动生成',
},
{
label: '计划名称',
prop: 'planName',
search: true,
searchOrder: 12,
span: 6,
order: 380,
minWidth: 150,
rules: textRule('计划名称', 50, true),
},
{
label: '运输方式',
prop: 'transportType',
type: 'select',
search: true,
searchOrder: 10,
span: 6,
order: 360,
dicUrl: '/blade-system/dict-biz/dictionary?code=transport_type',
props: {
label: 'dictValue',
value: 'dictKey',
},
minWidth: 130,
rules: selectRule('运输类型'),
},
{
label: '货物信息',
prop: 'goodsInfo',
formatter: row => formatGoodsInfo(row),
minWidth: 320,
className: 'business-crud-page__goods-info-cell',
overHidden: false,
showOverflowTooltip: false,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '调度进度',
prop: 'dispatchProgress',
formatter: row => formatDispatchProgress(row),
minWidth: 120,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '发货地址',
prop: 'departureAddress',
formslot: true,
search: true,
searchOrder: 7,
span: 24,
order: 310,
minWidth: 220,
rules: textRule('发货地址', 255, true),
},
{
label: '到货地址',
prop: 'arrivalAddress',
formslot: true,
search: true,
searchOrder: 6,
span: 24,
order: 300,
minWidth: 220,
rules: textRule('收货地址', 255, true),
},
{
label: '项目名称',
prop: 'projectName',
formslot: true,
search: true,
searchOrder: 11,
searchType: 'select',
span: 6,
order: 400,
dicUrl: '/blade-transport/project-apply/list?current=1&size=9999',
dicFormatter: listDicFormatter,
props: {
label: 'projectName',
value: 'projectName',
},
filterable: true,
minWidth: 150,
rules: textRule('项目', 100, true),
},
{
label: '客户名称',
prop: 'customerName',
search: true,
searchOrder: 5,
minWidth: 150,
addDisplay: false,
editDisplay: false,
},
{
label: '计划开始日期',
prop: 'planStartDate',
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
span: 6,
order: 350,
minWidth: 130,
},
{
label: '计划结束日期',
prop: 'planEndDate',
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
span: 6,
order: 340,
minWidth: 130,
},
{
label: '数据来源',
prop: 'dataSource',
type: 'select',
search: true,
searchOrder: 1,
dicData: dataSourceOptions,
minWidth: 120,
addDisplay: false,
editDisplay: false,
},
{
label: '货物类型',
prop: 'cargoType',
search: true,
searchOrder: 8,
formatter: row => formatGoodsField(row, ['cargoType', 'goodsType']),
minWidth: 130,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '货物名称',
prop: 'cargoName',
search: true,
searchOrder: 9,
formatter: row => formatGoodsField(row, ['cargoName', 'goodsName']),
minWidth: 150,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '备注',
prop: 'remark',
type: 'textarea',
minRows: 4,
span: 24,
order: 330,
minWidth: 180,
maxlength: 200,
showWordLimit: true,
rules: textRule('备注', 200),
},
{
...auditColumn('updateUserName'),
},
{
...auditColumn('createTime'),
},
{
...auditColumn('updateTime'),
},
{
label: '调度状态',
prop: 'businessStatus',
type: 'select',
slot: true,
search: true,
searchLabel: '状态',
searchOrder: 2,
dicData: planStatusOptions,
minWidth: 120,
fixed: 'right',
addDisplay: false,
editDisplay: false,
},
{
label: '',
prop: 'shippingInfoTitle',
formslot: true,
span: 24,
order: 320,
hide: true,
labelWidth: 0,
},
{
label: '项目ID',
prop: 'projectId',
hide: true,
display: false,
},
{
label: '客户合同',
prop: 'contractName',
formslot: true,
hide: true,
span: 6,
order: 390,
minWidth: 160,
rules: textRule('客户合同', 100, true),
},
{
label: '客户合同ID',
prop: 'contractId',
hide: true,
display: false,
},
{
label: '发货地',
prop: 'departureName',
hide: true,
display: false,
minWidth: 140,
rules: textRule('发货地', 100, true),
},
{
label: '收货地',
prop: 'arrivalName',
hide: true,
display: false,
minWidth: 140,
rules: textRule('收货地', 100, true),
},
{
label: '发货联系人',
prop: 'departureContact',
hide: true,
display: false,
rules: textRule('发货联系人', 50),
},
{
label: '发货联系方式',
prop: 'departurePhone',
hide: true,
display: false,
rules: [phoneRule('发货联系方式'), ...textRule('发货联系方式', 50)],
},
{
label: '收货联系人',
prop: 'arrivalContact',
hide: true,
display: false,
rules: textRule('收货联系人', 50),
},
{
label: '收货联系方式',
prop: 'arrivalPhone',
hide: true,
display: false,
rules: [phoneRule('收货联系方式'), ...textRule('收货联系方式', 50)],
},
{
label: '',
prop: 'goodsInfoTitle',
formslot: true,
span: 24,
order: 280,
hide: true,
labelWidth: 0,
},
{
label: '计划开始日期',
prop: 'planStartDateRange',
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
search: true,
searchRange: true,
searchOrder: 4,
hide: true,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '计划结束日期',
prop: 'planEndDateRange',
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
search: true,
searchRange: true,
searchOrder: 3,
hide: true,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '所属组织',
prop: 'deptName',
hide: true,
minWidth: 150,
addDisplay: false,
editDisplay: false,
},
{
label: '',
prop: 'goodsJson',
type: 'textarea',
formslot: true,
minRows: 5,
span: 24,
order: 270,
hide: true,
labelWidth: '0px',
className: 'business-crud-page__full-form-item',
},
{
label: '',
prop: 'attachmentTitle',
formslot: true,
span: 24,
order: 265,
hide: true,
labelWidth: 0,
},
{
label: '',
prop: 'attachmentsJson',
type: 'textarea',
formslot: true,
minRows: 3,
span: 24,
order: 260,
hide: true,
labelWidth: '0px',
className: 'business-crud-page__full-form-item',
},
]),
dialogWidth: '96%',
};

View File

@@ -4,16 +4,108 @@ import {
dataSourceOptions,
selectRule,
textRule,
transportTypeOptions,
waybillStatusOptions,
} from './common';
const transportTypeDict = {
dicUrl: '/blade-system/dict-biz/dictionary?code=transport_type',
props: {
label: 'dictValue',
value: 'dictKey',
},
};
const isEmpty = value => value === undefined || value === null || value === '';
const parseJsonArray = value => {
if (Array.isArray(value)) return value;
if (typeof value !== 'string' || !value.trim()) return [];
try {
const result = JSON.parse(value);
if (Array.isArray(result)) return result;
if (Array.isArray(result.records)) return result.records;
if (Array.isArray(result.rows)) return result.rows;
return [];
} catch (error) {
return [];
}
};
const getFirstValue = (row, props) => {
const prop = props.find(item => !isEmpty(row[item]));
return prop ? row[prop] : '';
};
const getGoodsRows = row => parseJsonArray(row.goodsList || row.goodsRows || row.goodsJson);
const getBillingRows = row => {
const freightRows = parseJsonArray(row.freightList || row.freightRows || row.freightJson);
if (freightRows.length) return freightRows;
return parseJsonArray(row.billingPlanJson).flatMap(item =>
Array.isArray(item.rules) ? item.rules : []
);
};
const joinText = list => list.filter(item => !isEmpty(item)).join('/');
const formatGoodsInfo = row => {
const text = getFirstValue(row, ['goodsInfo', 'cargoInfo']);
if (text) return text;
return getGoodsRows(row)
.map(item => {
const name = getFirstValue(item, ['cargoName', 'goodsName', 'name']);
const type = getFirstValue(item, ['cargoType', 'goodsType', 'typeName']);
const quantity = joinText([
getFirstValue(item, ['quantity', 'cargoQuantity', 'goodsQuantity']),
getFirstValue(item, ['quantityUnit', 'cargoUnit', 'unit']),
]);
return joinText([name, type, quantity]);
})
.filter(Boolean)
.join('; ');
};
const formatGoodsField = (row, props) => {
const value = getFirstValue(row, props);
if (value) return value;
const goods = getGoodsRows(row).find(item => getFirstValue(item, props));
return goods ? getFirstValue(goods, props) : '';
};
const formatTransportMode = row =>
getFirstValue(row, ['transportModeName', 'transportMode', 'transportWayName', 'transportWay']);
const formatUnitPrice = row => {
const value = getFirstValue(row, ['unitPrice', 'price']);
const unit = getFirstValue(row, ['priceUnit', 'billingUnit', 'unit']);
if (!isEmpty(value)) return unit ? `${value}(${unit})` : value;
const billing = getBillingRows(row).find(item => !isEmpty(item.unitPrice));
if (!billing) return '';
const billingUnit = getFirstValue(billing, ['priceUnit', 'billingUnit', 'unit']);
return billingUnit ? `${billing.unitPrice}(${billingUnit})` : billing.unitPrice;
};
const formatAmount = (row, props) => getFirstValue(row, props);
const auditColumn = prop => ({ ...auditColumns.find(item => item.prop === prop) });
export const config = {
title: '运单管理',
permission: 'waybill_manage',
exportUrl: '/blade-transport/waybill-manage/export-waybill-manage',
exportName: '运单管理',
enableAllDept: true,
importUrl: '/blade-transport/waybill-manage/import-waybill-manage',
enableAllDept: false,
batchDelete: false,
createText: '新建运单',
importText: '导入运单',
roadLoading: true,
roadLoadingText: '公路配载',
searchRangeMap: {
startDateRange: ['startDateStart', 'startDateEnd'],
endDateRange: ['endDateStart', 'endDateEnd'],
createTimeRange: ['createTimeStart', 'createTimeEnd'],
},
actions: ['copy', 'cancel', 'reassign', 'complete', 'batchComplete'],
statusProp: 'businessStatus',
statusTextProp: 'businessStatusName',
@@ -21,234 +113,437 @@ export const config = {
editStatus: ['draft', 'pending'],
};
export const option = createCrudOption([
{
label: '运单号',
prop: 'waybillNo',
search: true,
minWidth: 150,
addDisplay: false,
editDisabled: true,
},
{
label: '项目',
prop: 'projectName',
search: true,
minWidth: 150,
rules: textRule('项目', 100, true),
},
{
label: '项目ID',
prop: 'projectId',
hide: true,
},
{
label: '客户合同',
prop: 'contractName',
minWidth: 160,
rules: textRule('客户合同', 100, true),
},
{
label: '客户合同ID',
prop: 'contractId',
hide: true,
},
{
label: '客户名称',
prop: 'customerName',
search: true,
minWidth: 150,
},
{
label: '运输类型',
prop: 'transportType',
type: 'select',
search: true,
dicData: transportTypeOptions,
minWidth: 130,
rules: selectRule('运输类型'),
},
{
label: '货物名称',
prop: 'cargoName',
search: true,
minWidth: 150,
rules: textRule('货物名称', 100, true),
},
{
label: '货物类型',
prop: 'cargoType',
search: true,
minWidth: 130,
rules: textRule('货物类型', 100, true),
},
{
label: '发货地址',
prop: 'departureAddress',
search: true,
minWidth: 220,
rules: textRule('发货地址', 255, true),
},
{
label: '收货地址',
prop: 'arrivalAddress',
search: true,
minWidth: 220,
rules: textRule('收货地址', 255, true),
},
{
label: '承运商名称',
prop: 'carrierName',
search: true,
minWidth: 150,
},
{
label: '司机姓名',
prop: 'driverName',
search: true,
minWidth: 120,
},
{
label: '车/船/航班/班列号',
prop: 'vehicleNo',
search: true,
minWidth: 170,
},
{
label: '原始单号',
prop: 'originalNo',
search: true,
minWidth: 140,
},
{
label: '业务状态',
prop: 'businessStatus',
type: 'select',
slot: true,
search: true,
dicData: waybillStatusOptions,
minWidth: 120,
addDisplay: false,
editDisplay: false,
},
{
label: '数据来源',
prop: 'dataSource',
type: 'select',
search: true,
dicData: dataSourceOptions,
minWidth: 120,
},
{
label: '开始日期',
prop: 'startDate',
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
search: true,
minWidth: 130,
},
{
label: '结束日期',
prop: 'endDate',
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
search: true,
minWidth: 130,
},
{
label: '计划名称',
prop: 'planName',
search: true,
minWidth: 150,
},
{
label: '多联总单',
prop: 'masterNo',
search: true,
minWidth: 140,
},
{
label: '配载单号',
prop: 'loadingNo',
search: true,
minWidth: 140,
},
{
label: '运单批次号',
prop: 'batchNo',
search: true,
minWidth: 140,
},
{
label: '关联单号',
prop: 'relationNo',
search: true,
minWidth: 140,
},
{
label: '当前过程节点',
prop: 'currentProcessNode',
minWidth: 140,
},
{
label: '货物信息JSON',
prop: 'goodsJson',
type: 'textarea',
minRows: 5,
span: 24,
hide: true,
},
{
label: '承运信息JSON',
prop: 'carrierJson',
type: 'textarea',
minRows: 4,
span: 24,
hide: true,
},
{
label: '过程配置JSON',
prop: 'processJson',
type: 'textarea',
minRows: 4,
span: 24,
hide: true,
},
{
label: '运费信息JSON',
prop: 'freightJson',
type: 'textarea',
minRows: 4,
span: 24,
hide: true,
},
{
label: '附件JSON',
prop: 'attachmentsJson',
type: 'textarea',
minRows: 3,
span: 24,
hide: true,
},
{
label: '所属组织',
prop: 'deptName',
minWidth: 150,
addDisplay: false,
editDisplay: false,
},
{
label: '备注',
prop: 'remark',
type: 'textarea',
minRows: 4,
span: 24,
hide: true,
maxlength: 500,
showWordLimit: true,
rules: textRule('备注', 500),
},
...auditColumns,
]);
export const option = {
...createCrudOption([
{
label: '运单号',
prop: 'waybillNo',
search: true,
searchOrder: 23,
minWidth: 150,
addDisplay: false,
editDisabled: true,
},
{
label: '配载单号',
prop: 'loadingNo',
search: true,
searchOrder: 5,
minWidth: 140,
},
{
label: '总单号',
prop: 'masterNo',
search: true,
searchLabel: '多联总单',
searchOrder: 6,
minWidth: 140,
},
{
label: '项目名称',
prop: 'projectName',
search: true,
searchOrder: 22,
minWidth: 150,
rules: textRule('项目', 100, true),
},
{
label: '客户',
prop: 'customerName',
search: true,
searchLabel: '客户名称',
searchOrder: 21,
minWidth: 150,
},
{
label: '车牌号/航班号/船号/班列号',
prop: 'vehicleNo',
search: true,
searchLabel: '车/船/航班/班列',
searchOrder: 13,
minWidth: 210,
},
{
label: '司机',
prop: 'driverName',
search: true,
searchLabel: '司机名称',
searchOrder: 14,
minWidth: 120,
},
{
label: '联系方式',
prop: 'driverPhone',
formatter: row => getFirstValue(row, ['driverPhone', 'driverMobile', 'driverTel']),
minWidth: 140,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '运输方式',
prop: 'transportMode',
type: 'select',
search: true,
searchOrder: 1,
formatter: row => formatTransportMode(row),
...transportTypeDict,
minWidth: 130,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '运输类型',
prop: 'transportType',
type: 'select',
search: true,
searchOrder: 20,
...transportTypeDict,
minWidth: 130,
rules: selectRule('运输类型'),
},
{
label: '过程节点',
prop: 'currentProcessNode',
minWidth: 140,
},
{
label: '承运类型',
prop: 'carrierType',
formatter: row => getFirstValue(row, ['carrierTypeName', 'carrierType']),
minWidth: 120,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '承运商',
prop: 'carrierName',
search: true,
searchLabel: '承运商名称',
searchOrder: 15,
minWidth: 150,
},
{
label: '货物信息',
prop: 'goodsInfo',
formatter: row => formatGoodsInfo(row),
minWidth: 260,
overHidden: true,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '发货地址',
prop: 'departureAddress',
search: true,
searchOrder: 17,
minWidth: 220,
rules: textRule('发货地址', 255, true),
},
{
label: '到货地址',
prop: 'arrivalAddress',
search: true,
searchLabel: '收货地址',
searchOrder: 16,
minWidth: 220,
rules: textRule('收货地址', 255, true),
},
{
label: '发货联系人',
prop: 'departureContact',
minWidth: 120,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '收货联系人',
prop: 'arrivalContact',
minWidth: 120,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '单价(计价单位)',
prop: 'unitPrice',
formatter: row => formatUnitPrice(row),
minWidth: 140,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '运费',
prop: 'freight',
formatter: row => formatAmount(row, ['freight', 'freightAmount', 'transportFee']),
minWidth: 120,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '其他费用合计',
prop: 'otherFeeTotal',
formatter: row => formatAmount(row, ['otherFeeTotal', 'otherAmount', 'otherFeeAmount']),
minWidth: 140,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '运费合计',
prop: 'freightTotal',
formatter: row => formatAmount(row, ['freightTotal', 'totalFreight', 'totalAmount']),
minWidth: 120,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '客户合同',
prop: 'contractName',
minWidth: 160,
rules: textRule('客户合同', 100, true),
},
{
label: '计划名称',
prop: 'planName',
search: true,
searchOrder: 7,
minWidth: 150,
},
{
label: '货物类型',
prop: 'cargoType',
search: true,
searchOrder: 18,
formatter: row => formatGoodsField(row, ['cargoType', 'goodsType', 'typeName']),
minWidth: 130,
rules: textRule('货物类型', 100, true),
},
{
label: '货物名称',
prop: 'cargoName',
search: true,
searchOrder: 19,
formatter: row => formatGoodsField(row, ['cargoName', 'goodsName', 'name']),
minWidth: 150,
rules: textRule('货物名称', 100, true),
},
{
label: '实际发货时间',
prop: 'startDate',
type: 'datetime',
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
minWidth: 170,
},
{
label: '实际完成时间',
prop: 'endDate',
type: 'datetime',
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
minWidth: 170,
},
{
label: '原始单号',
prop: 'originalNo',
search: true,
searchOrder: 12,
minWidth: 140,
},
{
label: '运单批次号',
prop: 'batchNo',
search: true,
searchLabel: '运输批次',
searchOrder: 3,
minWidth: 140,
},
{
label: '预计发货时间',
prop: 'estimatedStartTime',
type: 'datetime',
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
formatter: row => getFirstValue(row, ['estimatedStartTime', 'planStartDate']),
minWidth: 170,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '预计完成时间',
prop: 'estimatedEndTime',
type: 'datetime',
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
formatter: row => getFirstValue(row, ['estimatedEndTime', 'planEndDate']),
minWidth: 170,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '备注',
prop: 'remark',
type: 'textarea',
minRows: 4,
span: 24,
minWidth: 180,
overHidden: true,
maxlength: 500,
showWordLimit: true,
rules: textRule('备注', 500),
},
{
label: '数据来源',
prop: 'dataSource',
type: 'select',
search: true,
searchOrder: 10,
dicData: dataSourceOptions,
minWidth: 120,
},
{
...auditColumn('createTime'),
},
{
...auditColumn('updateTime'),
},
{
label: '状态',
prop: 'businessStatus',
type: 'select',
slot: true,
search: true,
searchLabel: '状态',
searchOrder: 11,
dicData: waybillStatusOptions,
minWidth: 120,
fixed: 'right',
addDisplay: false,
editDisplay: false,
},
{
label: '实际发货时间',
prop: 'startDateRange',
type: 'datetime',
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
search: true,
searchRange: true,
searchOrder: 9,
hide: true,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '实际完成时间',
prop: 'endDateRange',
type: 'datetime',
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
search: true,
searchRange: true,
searchOrder: 8,
hide: true,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '创建时间',
prop: 'createTimeRange',
type: 'datetime',
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
search: true,
searchRange: true,
searchOrder: 4,
hide: true,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '关联单号',
prop: 'relationNo',
search: true,
searchOrder: 2,
minWidth: 140,
hide: true,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
label: '货物信息JSON',
prop: 'goodsJson',
type: 'textarea',
minRows: 5,
span: 24,
hide: true,
},
{
label: '承运信息JSON',
prop: 'carrierJson',
type: 'textarea',
minRows: 4,
span: 24,
hide: true,
},
{
label: '过程配置JSON',
prop: 'processJson',
type: 'textarea',
minRows: 4,
span: 24,
hide: true,
},
{
label: '运费信息JSON',
prop: 'freightJson',
type: 'textarea',
minRows: 4,
span: 24,
hide: true,
},
{
label: '附件JSON',
prop: 'attachmentsJson',
type: 'textarea',
minRows: 3,
span: 24,
hide: true,
},
{
label: '所属组织',
prop: 'deptName',
hide: true,
minWidth: 150,
addDisplay: false,
editDisplay: false,
},
{
label: '项目ID',
prop: 'projectId',
hide: true,
display: false,
},
{
label: '客户合同ID',
prop: 'contractId',
hide: true,
display: false,
},
]),
menuWidth: 320,
};