Files
tms-erp-web/src/option/business/project-apply.js
T
gxwebsoft 36cc9c751c style(ui): 优化必填星号与多行label的对齐方式
- 修复客商档案中必填项红色星号 * 与首行文字未垂直居中的问题
- 全站统一必填星号 * 的垂直居中规则,兼容单行与多行 label
- 临时额度管理弹窗多行 label 调整星号与首字对齐,避免视觉偏移
- 调整客户档案中信用评分表和附件描述布局,使字段间距合理且内容可编辑
- /business/project-apply 搜索栏项目负责人改为手动输入,优化模糊查询体验
- 新增项目编号、客户名称、下游承运商三个搜索字段,增加查询灵活性
- 调整项目申请按钮权限顺序,新增及重大项目补录按钮功能互换
- 注释隐藏tags.vue中avue-tags相关菜单按钮,简化界面
- 修改vite开发服务器端口和代理配置,指向内网环境方便调试
- 更新 pnpm-lock.yaml 应用 avue 相关补丁,保证依赖兼容性
2026-08-27 19:45:14 +08:00

416 lines
9.0 KiB
JavaScript

import {
auditColumns,
businessTypeOptions,
createCrudOption,
nonNegativeRule,
projectApprovalStatusOptions,
projectSourceOptions,
projectTypeOptions,
selectRule,
settlementModeOptions,
textRule,
} from './common';
const projectEffectiveTypeOptions = [
{ label: '临时', value: 'temporary' },
{ label: '正式', value: 'formal' },
];
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',
},
{
action: 'voidProject',
label: '作废',
type: 'danger',
statusProp: 'approvalStatus',
status: ['approved', 'change_approved'],
permission: 'project_apply_void',
prompt: '请输入作废原因',
},
],
};
export const option = createCrudOption([
{
label: '申请单号',
prop: 'applyNo',
search: true,
searchPlaceholder: '请输入',
searchOrder: 7,
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: 6,
minWidth: 180,
maxlength: 50,
rules: textRule('项目名称', 50, true),
},
{
label: '项目简称',
prop: 'projectShortName',
hide: true,
minWidth: 140,
maxlength: 20,
rules: textRule('项目简称', 20, true),
},
{
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: 10,
minWidth: 180,
rules: textRule('下游承运商', 255, true),
},
{
label: '业务部门',
prop: 'businessDeptName',
hide: true,
minWidth: 150,
rules: textRule('业务部门', 50, true),
},
{
label: '承办部门',
prop: 'undertakeDeptName',
search: true,
searchPlaceholder: '请输入',
searchOrder: 5,
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: '项目负责人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: '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: '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 })),
]);