f78e61b433
2、调整对账
318 lines
8.0 KiB
JavaScript
318 lines
8.0 KiB
JavaScript
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 projectNameDicFormatter = res => {
|
|
const list = listDicFormatter(res);
|
|
// 过滤掉 projectName 为空的记录
|
|
return list.filter(item => item && item.projectName && String(item.projectName).trim());
|
|
};
|
|
|
|
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: false,
|
|
enableProjectSelect: true,
|
|
projectQueryParams: {
|
|
temporaryCreditLimitSelectable: true,
|
|
},
|
|
enableAttachmentTable: true,
|
|
detailAttachmentUploadTimeWidth: 220,
|
|
enableDraftSave: true,
|
|
saveAsDraft: true,
|
|
defaultForm: {
|
|
usedFundLimit: 0,
|
|
remainingFundLimit: 0,
|
|
},
|
|
statusProp: 'approvalStatus',
|
|
statusTextProp: 'approvalStatusName',
|
|
deleteStatus: ['draft', 'withdrawn', 'rejected', '草稿'],
|
|
editStatus: ['draft', 'withdrawn', 'rejected', '草稿', '已撤回'],
|
|
ignoreReadonlyEditStatus: ['draft', 'withdrawn', '草稿', '已撤回'],
|
|
ignoreReadonlyDeleteStatus: ['draft', '草稿'],
|
|
detailButton: true,
|
|
detailButtonIgnoreDraftStatus: true,
|
|
detailAlignCenter: true,
|
|
detailSections: [
|
|
{
|
|
title: '申请信息',
|
|
fields: [
|
|
['applicationNo', '申请单号', 1],
|
|
['projectName', '项目', 1],
|
|
['projectCode', '项目编号', 1],
|
|
['undertakeDeptName', '承办部门', 1],
|
|
['applyDeptName', '申请部门', 1],
|
|
['applicantName', '申请人', 1],
|
|
['approvalStatus', '审批状态', 1],
|
|
['currentNode', '当前节点', 1],
|
|
['currentProcessor', '当前处理人', 1],
|
|
['validUntil', '申请有效期至', 1],
|
|
['remark', '备注', 1],
|
|
],
|
|
},
|
|
{
|
|
title: '额度信息',
|
|
fields: [
|
|
['projectFundLimit', '项目资金使用额度(万元)', 1],
|
|
['usedFundLimit', '已使用项目资金使用额度(万元)', 1],
|
|
['remainingFundLimit', '剩余项目资金使用额度(万元)', 1],
|
|
['applyLimit', '申请临时额度(万元)', 1],
|
|
],
|
|
},
|
|
],
|
|
operations: [
|
|
{
|
|
action: 'submitApproval',
|
|
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: '撤回',
|
|
statusProp: 'approvalStatus',
|
|
status: ['reviewing'],
|
|
permission: 'temporary_credit_limit_withdraw',
|
|
},
|
|
{
|
|
action: 'approve',
|
|
label: '审批通过',
|
|
type: 'success',
|
|
statusProp: 'approvalStatus',
|
|
status: ['reviewing'],
|
|
permission: 'temporary_credit_limit_approve',
|
|
},
|
|
{
|
|
action: 'reject',
|
|
label: '审批驳回',
|
|
type: 'warning',
|
|
statusProp: 'approvalStatus',
|
|
status: ['reviewing'],
|
|
permission: 'temporary_credit_limit_reject',
|
|
},
|
|
],
|
|
};
|
|
|
|
export const option = {
|
|
dialogCustomClass: 'temporary-credit-limit-dialog',
|
|
...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: projectNameDicFormatter,
|
|
props: {
|
|
label: 'projectName',
|
|
value: 'projectName',
|
|
},
|
|
filterable: true,
|
|
span: 6,
|
|
minWidth: 180,
|
|
rules: textRule('项目名称', 100, true),
|
|
},
|
|
{
|
|
label: '项目ID',
|
|
prop: 'projectId',
|
|
hide: true,
|
|
display: false,
|
|
},
|
|
{
|
|
label: '项目编号',
|
|
prop: 'projectCode',
|
|
hide: true,
|
|
disabled: true,
|
|
span: 6,
|
|
minWidth: 150,
|
|
rules: textRule('项目编号', 50),
|
|
},
|
|
{
|
|
label: '承办部门',
|
|
prop: 'undertakeDeptName',
|
|
hide: true,
|
|
disabled: true,
|
|
span: 6,
|
|
minWidth: 150,
|
|
rules: textRule('承办部门', 50, true),
|
|
},
|
|
{
|
|
label: '项目资金使用额度(万元)',
|
|
prop: 'projectFundLimit',
|
|
hide: true,
|
|
disabled: true,
|
|
span: 6,
|
|
minWidth: 200,
|
|
rules: [nonNegativeRule('项目资金使用额度')],
|
|
},
|
|
{
|
|
label: '已使用项目资金使用额度(万元)',
|
|
prop: 'usedFundLimit',
|
|
hide: true,
|
|
disabled: true,
|
|
span: 6,
|
|
minWidth: 220,
|
|
value: 0,
|
|
rules: [nonNegativeRule('已使用项目资金额度')],
|
|
},
|
|
{
|
|
label: '剩余项目资金使用额度(万元)',
|
|
prop: 'remainingFundLimit',
|
|
hide: true,
|
|
disabled: true,
|
|
span: 6,
|
|
minWidth: 230,
|
|
value: 0,
|
|
rules: [nonNegativeRule('剩余项目资金使用额度')],
|
|
},
|
|
{
|
|
label: '申请临时额度(万元)',
|
|
prop: 'applyLimit',
|
|
formslot: true,
|
|
span: 6,
|
|
minWidth: 180,
|
|
rules: [
|
|
{ required: true, message: '请输入申请临时额度', trigger: 'blur' },
|
|
nonNegativeRule('申请临时额度'),
|
|
],
|
|
},
|
|
{
|
|
label: '申请有效期至',
|
|
prop: 'validUntil',
|
|
type: 'date',
|
|
format: 'YYYY-MM-DD',
|
|
valueFormat: 'YYYY-MM-DD',
|
|
span: 6,
|
|
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,
|
|
minRows: 2,
|
|
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: '96%',
|
|
menuFixed: 'right',
|
|
menuWidth: 320,
|
|
index: false,
|
|
};
|