447 lines
9.6 KiB
JavaScript
447 lines
9.6 KiB
JavaScript
import {
|
||
auditColumns,
|
||
businessModeOptions,
|
||
businessTypeOptions,
|
||
createCrudOption,
|
||
nonNegativeRule,
|
||
projectApprovalStatusOptions,
|
||
projectSourceOptions,
|
||
projectTypeOptions,
|
||
selectRule,
|
||
settlementModeOptions,
|
||
textRule,
|
||
} from './common';
|
||
|
||
const projectEffectiveTypeOptions = [
|
||
{ label: '临时', value: 'temporary' },
|
||
{ label: '正式', value: 'formal' },
|
||
];
|
||
|
||
export const fundUseRiskOptions = [
|
||
{ label: '高风险', value: 'high' },
|
||
{ label: '中风险', value: 'medium' },
|
||
{ label: '正常', value: 'none' },
|
||
];
|
||
|
||
// 项目资金额度使用率阈值:中风险 ≥ 80%,高风险 ≥ 90%
|
||
export const fundUseRiskThreshold = {
|
||
high: 90,
|
||
medium: 80,
|
||
};
|
||
|
||
const amountRules = label => [
|
||
{ required: true, message: `请输入${label}`, trigger: 'blur' },
|
||
nonNegativeRule(label),
|
||
];
|
||
|
||
const formatUserRealName = (row, role) =>
|
||
row[`${role}RealName`] ||
|
||
row[`${role}UserRealName`] ||
|
||
row[`${role}User`]?.realName ||
|
||
row[role]?.realName ||
|
||
row[`${role}UserName`] ||
|
||
'';
|
||
|
||
export const config = {
|
||
title: '项目管理',
|
||
permission: 'project_apply',
|
||
exportUrl: '/blade-transport/project-apply/export-project-apply',
|
||
exportName: '项目立项',
|
||
enableAllDept: false,
|
||
statusProp: 'approvalStatus',
|
||
statusTextProp: 'approvalStatusName',
|
||
deleteStatus: ['draft', 'withdrawn', 'rejected'],
|
||
editStatus: ['draft', 'withdrawn', 'rejected', 'change_rejected'],
|
||
operations: [
|
||
{
|
||
action: 'submitApproval',
|
||
label: '提交',
|
||
statusProp: 'approvalStatus',
|
||
status: ['draft'],
|
||
permission: 'project_apply_submit',
|
||
},
|
||
{
|
||
action: 'withdraw',
|
||
label: '撤回',
|
||
statusProp: 'approvalStatus',
|
||
status: ['reviewing'],
|
||
permission: 'project_apply_withdraw',
|
||
},
|
||
{
|
||
action: 'approve',
|
||
label: '通过',
|
||
type: 'success',
|
||
statusProp: 'approvalStatus',
|
||
status: ['reviewing', 'change_reviewing'],
|
||
permission: 'project_apply_approve',
|
||
},
|
||
{
|
||
action: 'reject',
|
||
label: '审批驳回',
|
||
type: 'warning',
|
||
statusProp: 'approvalStatus',
|
||
status: ['reviewing', 'change_reviewing'],
|
||
permission: 'project_apply_reject',
|
||
},
|
||
{
|
||
action: 'startChange',
|
||
label: '变更',
|
||
statusProp: 'approvalStatus',
|
||
status: ['approved'],
|
||
permission: 'project_apply_change',
|
||
},
|
||
],
|
||
};
|
||
|
||
export const option = createCrudOption([
|
||
{
|
||
label: '申请单号',
|
||
prop: 'applyNo',
|
||
search: true,
|
||
searchPlaceholder: '请输入',
|
||
searchOrder: 10,
|
||
minWidth: 220,
|
||
addDisplay: false,
|
||
editDisabled: true,
|
||
},
|
||
{
|
||
label: '项目编号',
|
||
prop: 'projectCode',
|
||
search: true,
|
||
searchPlaceholder: '请输入',
|
||
searchOrder: 5,
|
||
minWidth: 150,
|
||
addDisplay: false,
|
||
editDisabled: true,
|
||
},
|
||
{
|
||
label: '项目名称',
|
||
prop: 'projectName',
|
||
search: true,
|
||
searchPlaceholder: '请输入',
|
||
searchOrder: 9,
|
||
minWidth: 180,
|
||
maxlength: 50,
|
||
rules: textRule('项目名称', 50, true),
|
||
},
|
||
{
|
||
label: '项目简称',
|
||
prop: 'projectShortName',
|
||
hide: true,
|
||
minWidth: 140,
|
||
maxlength: 20,
|
||
rules: textRule('项目简称', 20),
|
||
},
|
||
{
|
||
label: '项目类型',
|
||
prop: 'projectType',
|
||
type: 'select',
|
||
search: true,
|
||
searchPlaceholder: '请选择',
|
||
searchOrder: 3,
|
||
dicData: projectTypeOptions,
|
||
minWidth: 120,
|
||
rules: selectRule('项目类型'),
|
||
},
|
||
{
|
||
label: '客户名称',
|
||
prop: 'customerNames',
|
||
search: true,
|
||
searchPlaceholder: '请输入',
|
||
searchOrder: 6,
|
||
minWidth: 180,
|
||
rules: textRule('客户名称', 255, true),
|
||
},
|
||
{
|
||
label: '下游承运商',
|
||
prop: 'carrierNames',
|
||
search: true,
|
||
searchPlaceholder: '请输入',
|
||
searchOrder: 7,
|
||
minWidth: 180,
|
||
rules: textRule('下游承运商', 255, true),
|
||
},
|
||
{
|
||
label: '业务部门',
|
||
prop: 'businessDeptName',
|
||
hide: true,
|
||
minWidth: 150,
|
||
rules: textRule('业务部门', 50, true),
|
||
},
|
||
{
|
||
label: '平台公司',
|
||
prop: 'undertakeDeptName',
|
||
search: true,
|
||
searchPlaceholder: '请输入',
|
||
searchOrder: 8,
|
||
minWidth: 150,
|
||
rules: textRule('平台公司', 50, true),
|
||
},
|
||
{
|
||
label: '平台公司ID',
|
||
prop: 'undertakeDeptId',
|
||
hide: true,
|
||
},
|
||
{
|
||
label: '项目负责人',
|
||
prop: 'principalUserName',
|
||
search: true,
|
||
searchPlaceholder: '请输入',
|
||
searchOrder: 4,
|
||
minWidth: 130,
|
||
formatter: row => formatUserRealName(row, 'principal'),
|
||
rules: textRule('项目负责人', 50, true),
|
||
},
|
||
{
|
||
label: '资金使用风险',
|
||
prop: 'fundUseRisk',
|
||
slot: true,
|
||
minWidth: 150,
|
||
addDisplay: false,
|
||
editDisplay: false,
|
||
hide: false,
|
||
},
|
||
{
|
||
label: '项目负责人ID',
|
||
prop: 'principalUserId',
|
||
hide: true,
|
||
},
|
||
{
|
||
label: '项目经办人',
|
||
prop: 'handlerUserName',
|
||
hide: true,
|
||
minWidth: 130,
|
||
formatter: row => formatUserRealName(row, 'handler'),
|
||
rules: textRule('项目经办人', 50, true),
|
||
},
|
||
{
|
||
label: '项目由来',
|
||
prop: 'projectSource',
|
||
type: 'select',
|
||
dicData: projectSourceOptions,
|
||
value: '商务洽谈',
|
||
hide: true,
|
||
minWidth: 120,
|
||
},
|
||
{
|
||
label: '项目资金使用额度(万元)',
|
||
prop: 'fundLimit',
|
||
type: 'number',
|
||
precision: 2,
|
||
hide: true,
|
||
minWidth: 190,
|
||
rules: amountRules('项目资金使用额度'),
|
||
},
|
||
{
|
||
label: '项目应收账款额度(万元)',
|
||
prop: 'receivableLimit',
|
||
type: 'number',
|
||
precision: 2,
|
||
hide: true,
|
||
minWidth: 200,
|
||
rules: amountRules('项目应收账款额度'),
|
||
},
|
||
{
|
||
label: '应收账款回款期限(天)',
|
||
prop: 'receivableDays',
|
||
type: 'number',
|
||
hide: true,
|
||
minWidth: 190,
|
||
rules: [{ required: true, message: '请输入应收账款回款期限', trigger: 'blur' }],
|
||
},
|
||
{
|
||
label: '回款账期(天)',
|
||
prop: 'paymentDays',
|
||
type: 'number',
|
||
hide: true,
|
||
minWidth: 140,
|
||
rules: [{ required: true, message: '请输入回款账期', trigger: 'blur' }],
|
||
},
|
||
{
|
||
label: '货物类型',
|
||
prop: 'cargoType',
|
||
hide: true,
|
||
minWidth: 120,
|
||
},
|
||
{
|
||
label: '预估货物数量',
|
||
prop: 'cargoQuantity',
|
||
hide: true,
|
||
minWidth: 150,
|
||
maxlength: 100,
|
||
},
|
||
{
|
||
label: '业务周期开始',
|
||
prop: 'businessStartDate',
|
||
type: 'date',
|
||
format: 'YYYY-MM-DD',
|
||
valueFormat: 'YYYY-MM-DD',
|
||
hide: true,
|
||
minWidth: 130,
|
||
},
|
||
{
|
||
label: '业务周期结束',
|
||
prop: 'businessEndDate',
|
||
type: 'date',
|
||
format: 'YYYY-MM-DD',
|
||
valueFormat: 'YYYY-MM-DD',
|
||
hide: true,
|
||
minWidth: 130,
|
||
},
|
||
{
|
||
label: '运输线路',
|
||
prop: 'transportRoute',
|
||
hide: true,
|
||
minWidth: 180,
|
||
maxlength: 100,
|
||
},
|
||
{
|
||
label: '运输类型',
|
||
prop: 'transportType',
|
||
type: 'select',
|
||
dicUrl: '/blade-system/dict-biz/dictionary?code=transport_type',
|
||
props: {
|
||
label: 'dictValue',
|
||
value: 'dictKey',
|
||
},
|
||
hide: true,
|
||
minWidth: 120,
|
||
},
|
||
{
|
||
label: '业务类型',
|
||
prop: 'businessType',
|
||
type: 'select',
|
||
dicData: businessTypeOptions,
|
||
hide: true,
|
||
minWidth: 130,
|
||
},
|
||
{
|
||
label: '业务模式',
|
||
prop: 'businessMode',
|
||
type: 'select',
|
||
dicData: businessModeOptions,
|
||
hide: true,
|
||
minWidth: 120,
|
||
rules: [selectRule('业务模式')],
|
||
},
|
||
{
|
||
label: '项目规模(万元)',
|
||
prop: 'projectScale',
|
||
type: 'number',
|
||
precision: 2,
|
||
hide: true,
|
||
minWidth: 150,
|
||
rules: [nonNegativeRule('项目规模')],
|
||
},
|
||
{
|
||
label: '预计利润(万元)',
|
||
prop: 'estimatedProfit',
|
||
type: 'number',
|
||
precision: 2,
|
||
hide: true,
|
||
minWidth: 150,
|
||
rules: [nonNegativeRule('预计利润')],
|
||
},
|
||
{
|
||
label: '利润率(%)',
|
||
prop: 'profitRate',
|
||
type: 'number',
|
||
precision: 2,
|
||
hide: true,
|
||
minWidth: 120,
|
||
rules: [nonNegativeRule('利润率')],
|
||
},
|
||
{
|
||
label: '资金需求(万元)',
|
||
prop: 'fundDemand',
|
||
type: 'number',
|
||
precision: 2,
|
||
hide: true,
|
||
minWidth: 150,
|
||
rules: [nonNegativeRule('资金需求')],
|
||
},
|
||
{
|
||
label: '结算方式',
|
||
prop: 'settlementMode',
|
||
type: 'select',
|
||
dicData: settlementModeOptions,
|
||
hide: true,
|
||
minWidth: 120,
|
||
},
|
||
{
|
||
label: '审批状态',
|
||
prop: 'approvalStatus',
|
||
type: 'select',
|
||
search: true,
|
||
searchPlaceholder: '请选择',
|
||
searchOrder: 2,
|
||
slot: true,
|
||
dicData: projectApprovalStatusOptions,
|
||
minWidth: 130,
|
||
addDisplay: false,
|
||
editDisplay: false,
|
||
},
|
||
{
|
||
label: '当前节点',
|
||
prop: 'currentNode',
|
||
minWidth: 140,
|
||
addDisplay: false,
|
||
editDisplay: false,
|
||
},
|
||
{
|
||
label: '当前处理人',
|
||
prop: 'currentProcessor',
|
||
minWidth: 130,
|
||
addDisplay: false,
|
||
editDisplay: false,
|
||
},
|
||
{
|
||
label: '生效类型',
|
||
prop: 'effectiveType',
|
||
type: 'select',
|
||
search: true,
|
||
searchPlaceholder: '请选择',
|
||
searchOrder: 1,
|
||
dicData: projectEffectiveTypeOptions,
|
||
value: 'temporary',
|
||
minWidth: 110,
|
||
},
|
||
{
|
||
label: '审核通过时间',
|
||
prop: 'approvedTime',
|
||
sortable: true,
|
||
type: 'datetime',
|
||
format: 'YYYY-MM-DD HH:mm:ss',
|
||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||
minWidth: 170,
|
||
addDisplay: false,
|
||
editDisplay: false,
|
||
},
|
||
{
|
||
label: '项目由来说明',
|
||
prop: 'sourceRemark',
|
||
type: 'textarea',
|
||
span: 24,
|
||
hide: true,
|
||
maxlength: 300,
|
||
showWordLimit: true,
|
||
},
|
||
{
|
||
label: '项目情况说明',
|
||
prop: 'situationRemark',
|
||
type: 'textarea',
|
||
span: 24,
|
||
hide: true,
|
||
maxlength: 1000,
|
||
showWordLimit: true,
|
||
},
|
||
{
|
||
label: '项目附件JSON',
|
||
prop: 'attachmentsJson',
|
||
type: 'textarea',
|
||
span: 24,
|
||
hide: true,
|
||
},
|
||
...auditColumns.map(column => ({ ...column, hide: true })),
|
||
]);
|