Files
tms-erp-web/src/option/business/shipping-template.js
T
2026-08-13 14:07:04 +08:00

275 lines
6.8 KiB
JavaScript

import {
auditColumns,
createCrudOption,
selectRule,
textRule,
transportTypeOptions,
withSearchPlaceholders,
} from './common';
const templateTypeOptions = [
{ label: '运输计划', value: '运输计划' },
{ label: '运单', value: '运单' },
];
export const config = {
title: '发货模板',
permission: 'shipping_template',
tableColumnOrder: [
'templateCode',
'templateName',
'templateType',
'transportType',
'createUserName',
'remark',
'updateTime',
'createTime',
],
exportColumns: [
{ prop: 'templateCode', label: '模板编号' },
{ prop: 'templateName', label: '模板名称' },
{ prop: 'templateType', label: '模板类型' },
{ prop: 'transportType', label: '运输方式' },
{ prop: 'createUserName', label: '创建人' },
{ prop: 'remark', label: '备注' },
{ prop: 'updateTime', label: '更新时间' },
{ prop: 'createTime', label: '创建时间' },
],
enableAllDept: false,
enableProjectSelect: true,
projectQueryParams: {
approvalStatuses: 'approved,change_approved',
},
excludeVoidedProjects: true,
enableAttachmentTable: true,
enableTransportPlanForm: true,
enableShippingTemplateFreight: true,
editableRoadAddress: true,
fixedTransportAddressType: true,
enableTemplateCodePreview: true,
attachmentTitle: '附件',
defaultForm: {
templateType: '运输计划',
},
transportFormRequiredFields: [
['projectName', '项目'],
['contractName', '客户合同'],
['transportType', '运输方式'],
['departureAddress', '发货地址'],
['arrivalAddress', '收货地址'],
],
actions: ['copy'],
operations: [
{
action: 'createFromTemplate',
label: '从模板新建',
permission: 'shipping_template_add',
},
],
};
export const option = {
...createCrudOption(
withSearchPlaceholders([
{
label: '',
prop: 'templateInfoTitle',
formslot: true,
span: 24,
order: 400,
hide: true,
labelWidth: 0,
},
{
label: '模板编号',
prop: 'templateCode',
search: true,
searchOrder: 4,
span: 8,
order: 390,
minWidth: 170,
disabled: true,
placeholder: '系统自动生成',
display: true,
},
{
label: '模板名称',
prop: 'templateName',
search: true,
searchOrder: 3,
span: 8,
order: 380,
minWidth: 150,
rules: textRule('模板名称', 50, true),
display: true,
},
{
label: '模板类型',
prop: 'templateType',
type: 'select',
search: true,
searchOrder: 2,
span: 8,
order: 370,
dicData: templateTypeOptions,
minWidth: 120,
rules: selectRule('模板类型'),
display: true,
},
{
label: '备注',
prop: 'remark',
type: 'textarea',
minRows: 3,
span: 24,
order: 360,
minWidth: 180,
maxlength: 200,
showWordLimit: true,
rules: textRule('备注', 200),
display: true,
},
{
label: '',
prop: 'basicInfoTitle',
formslot: true,
span: 24,
order: 350,
hide: true,
labelWidth: 0,
},
{
label: '项目',
prop: 'projectName',
formslot: true,
search: true,
searchOrder: 1,
span: 8,
order: 340,
minWidth: 150,
rules: textRule('项目', 100, true),
display: true,
},
{
label: '客户合同',
prop: 'contractName',
formslot: true,
span: 8,
order: 330,
minWidth: 160,
rules: textRule('客户合同', 100, true),
display: true,
},
{
label: '运输方式',
prop: 'transportType',
type: 'select',
span: 8,
order: 320,
dicData: transportTypeOptions,
minWidth: 130,
rules: selectRule('运输方式'),
display: true,
},
{
label: '备注',
prop: 'basicRemark',
type: 'textarea',
minRows: 3,
span: 24,
order: 315,
minWidth: 180,
maxlength: 200,
showWordLimit: true,
rules: textRule('备注', 200),
display: true,
},
{
label: '',
prop: 'shippingInfoTitle',
formslot: true,
span: 24,
order: 310,
hide: true,
labelWidth: 0,
},
{
label: '发货地址',
prop: 'departureAddress',
formslot: true,
span: 24,
order: 300,
minWidth: 220,
rules: textRule('发货地址', 255, true),
display: true,
},
{
label: '收货地址',
prop: 'arrivalAddress',
formslot: true,
span: 24,
order: 290,
minWidth: 220,
rules: textRule('收货地址', 255, true),
display: true,
},
{
label: '',
prop: 'goodsInfoTitle',
formslot: true,
span: 24,
order: 280,
hide: true,
labelWidth: 0,
},
{
label: '',
prop: 'goodsJson',
type: 'textarea',
formslot: true,
span: 24,
order: 270,
hide: true,
labelWidth: '0px',
className: 'business-crud-page__full-form-item',
},
{ label: '运费信息', prop: 'freightJson', hide: true, display: false },
{
label: '',
prop: 'attachmentTitle',
formslot: true,
span: 24,
order: 260,
hide: true,
labelWidth: 0,
},
{
label: '',
prop: 'attachmentsJson',
type: 'textarea',
formslot: true,
span: 24,
order: 250,
hide: true,
labelWidth: '0px',
className: 'business-crud-page__full-form-item',
},
{ label: '项目ID', prop: 'projectId', hide: true, display: false },
{ label: '客户合同ID', prop: 'contractId', hide: true, display: false },
{ label: '发货地', prop: 'departureName', hide: true, display: false },
{ label: '发货联系人', prop: 'departureContact', hide: true, display: false },
{ label: '发货联系方式', prop: 'departurePhone', hide: true, display: false },
{ label: '收货地', prop: 'arrivalName', hide: true, display: false },
{ label: '收货联系人', prop: 'arrivalContact', hide: true, display: false },
{ label: '收货联系方式', prop: 'arrivalPhone', hide: true, display: false },
{ label: '所属组织', prop: 'deptName', minWidth: 150, addDisplay: false, editDisplay: false, display: false },
...auditColumns.map(column => ({
...column,
display: false,
})),
])
),
dialogWidth: '96%',
dialogTop: '10px',
};