Files
tms-erp-web/src/option/settlement/preSettlementForm.js
T
b2894lxlx e7c76c803f ✨ 结算单业务模式运输方式与编辑体验优化
预结算/收付款结算支持业务模式与运输方式展示导出;完善结算调整、对账导入与变更记录;组织合同初始流水号未填不再显示-1。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-21 16:42:02 +08:00

84 lines
2.9 KiB
JavaScript

export const settlementTypeOptions = [
{ label: '应收', value: 'receivable' },
{ label: '应付', value: 'payable' },
];
export const preSettlementFormFields = [
{ label: '预付结算单号', prop: 'preSettlementNo', readonly: true },
{ label: '合同名称', prop: 'contractId', type: 'contract', required: true },
{ label: '合同编号', prop: 'contractNo', readonly: true },
{ label: '项目名称', prop: 'projectName', readonly: true },
{ label: '收款方', prop: 'payeeName', readonly: true },
{ label: '付款方', prop: 'payerName', readonly: true },
{ label: '结算类型', prop: 'settlementType', readonly: true },
{ label: '结算金额', prop: 'settlementAmount', readonly: true, money: true },
{ label: '业务模式', prop: 'businessModel', type: 'select', optionsKey: 'businessModelOptions' },
{ label: '运输方式', prop: 'transportType', type: 'select', optionsKey: 'transportTypeOptions' },
{ label: '汇率日期', prop: 'exchangeRateDate', type: 'date' },
{ label: '结算汇率', prop: 'exchangeRate', type: 'number', class: 'exchange-rate-input' },
{ label: '本位币合计', prop: 'localSettlementAmount', readonly: true, money: true },
{ label: '创建人', prop: 'createUserName', readonly: true },
{ label: '创建日期', prop: 'createTime', readonly: true },
{ label: '备注', prop: 'remark', type: 'textarea', span: 24, maxlength: 200 },
];
export const preSettlementFormRules = {
contractId: [{ required: true, message: '请选择合同名称', trigger: 'change' }],
exchangeRateDate: [
{
validator: (_rule, value, callback, source) => {
if (source.currency && source.currency !== 'RMB' && !value) {
callback(new Error('外币结算请选择汇率日期'));
return;
}
callback();
},
trigger: 'change',
},
],
exchangeRate: [
{
validator: (_rule, value, callback, source) => {
if (source.currency && source.currency !== 'RMB' && (!value || Number(value) <= 0)) {
callback(new Error('外币结算请输入大于0的结算汇率'));
return;
}
callback();
},
trigger: ['blur', 'change'],
},
],
remark: [{ max: 200, message: '备注不能超过200个字符', trigger: 'blur' }],
};
export const emptyPreSettlementForm = () => ({
id: '',
preSettlementNo: '',
contractId: '',
contractNo: '',
contractName: '',
projectId: '',
projectName: '',
deptId: '',
deptName: '',
payeeName: '',
payerName: '',
settlementType: 'payable',
currency: 'RMB',
settlementAmount: 0,
businessModel: '',
transportType: '',
localCurrency: 'RMB',
localSettlementAmount: 0,
exchangeRateDate: '',
exchangeRate: 1,
approvalStatus: 'draft',
approvalStatusName: '草稿',
currentNode: '草稿',
currentProcessor: '',
createUserName: '',
createTime: '',
attachmentsJson: '[]',
remark: '',
});