diff --git a/src/option/base/common-address.js b/src/option/base/common-address.js index ea43503..4f431ca 100644 --- a/src/option/base/common-address.js +++ b/src/option/base/common-address.js @@ -33,8 +33,6 @@ export const createOption = () => ({ { label: '地址名称', prop: 'addressName', - search: true, - searchOrder: 8, span: 24, minWidth: 150, showOverflowTooltip: true, @@ -58,8 +56,6 @@ export const createOption = () => ({ prop: 'addressType', type: 'select', formslot: true, - search: true, - searchOrder: 7, span: 24, minWidth: 140, dicData: addressTypeOptions, @@ -76,8 +72,6 @@ export const createOption = () => ({ { label: '详细地址', prop: 'detailAddress', - search: true, - searchOrder: 5, formslot: true, type: 'textarea', minRows: 3, @@ -108,8 +102,6 @@ export const createOption = () => ({ { label: '行政区划', prop: 'regionName', - search: true, - searchOrder: 4, display: false, minWidth: 150, rules: [{ required: true, message: '请选择行政区划', trigger: 'change' }], @@ -117,8 +109,6 @@ export const createOption = () => ({ { label: '联系人', prop: 'contactName', - search: true, - searchOrder: 2, minWidth: 110, placeholder: '请输入', maxlength: 50, @@ -127,12 +117,14 @@ export const createOption = () => ({ { label: '联系方式', prop: 'contactPhone', - search: true, - searchOrder: 1, minWidth: 130, placeholder: '请输入', maxlength: 20, - rules: [{ max: 20, message: '联系方式不能超过20个字', trigger: 'blur' }], + formslot: true, + rules: [ + { max: 20, message: '联系方式不能超过20个字', trigger: 'blur' }, + { pattern: /^\d*$/, message: '联系方式只能输入数字', trigger: 'blur' }, + ], }, { label: '组织', @@ -216,8 +208,6 @@ export const createOption = () => ({ { label: '站点编码', prop: 'siteCode', - search: true, - searchOrder: 6, hide: true, addDisplay: false, editDisplay: false, @@ -226,11 +216,121 @@ export const createOption = () => ({ label: '组织', prop: 'deptId', type: 'select', - search: true, - searchOrder: 3, hide: true, display: false, dicData: [], }, + // 搜索字段与表格、表单字段独立,避免筛选配置影响数据展示和编辑布局。 + { + label: '地址名称', + prop: 'searchAddressName', + searchProp: 'addressName', + search: true, + searchOrder: 8, + searchPlaceholder: '请输入', + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '类型', + prop: 'searchAddressType', + searchProp: 'addressType', + type: 'select', + searchType: 'select', + search: true, + searchOrder: 7, + searchPlaceholder: '请选择', + dicData: addressTypeOptions, + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '详细地址', + prop: 'searchDetailAddress', + searchProp: 'detailAddress', + search: true, + searchOrder: 6, + searchPlaceholder: '请输入', + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '行政区划', + prop: 'searchRegionName', + searchProp: 'regionName', + search: true, + searchOrder: 5, + searchPlaceholder: '请输入', + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '站点编码', + prop: 'searchSiteCode', + searchProp: 'siteCode', + search: true, + searchOrder: 4, + searchPlaceholder: '请输入', + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '组织', + prop: 'searchDeptId', + searchProp: 'deptId', + type: 'select', + searchType: 'select', + search: true, + searchOrder: 3, + searchPlaceholder: '请选择', + dicData: [], + filterable: true, + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '联系人', + prop: 'searchContactName', + searchProp: 'contactName', + search: true, + searchOrder: 2, + searchPlaceholder: '请输入', + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '联系方式', + prop: 'searchContactPhone', + searchProp: 'contactPhone', + search: true, + searchOrder: 1, + searchPlaceholder: '请输入', + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, ], }); diff --git a/src/option/business/common-cargo.js b/src/option/business/common-cargo.js index e0e3410..644f316 100644 --- a/src/option/business/common-cargo.js +++ b/src/option/business/common-cargo.js @@ -75,6 +75,7 @@ export const option = createCrudOption([ display: false, addDisplay: false, editDisabled: true, + minWidth: 180, }, // 搜索字段与表格、表单字段独立,避免筛选配置影响数据展示和编辑布局。 { @@ -169,31 +170,20 @@ export const option = createCrudOption([ viewDisplay: false, }, { - label: '包装品牌', - prop: 'packageBrand', - slot: true, - minWidth: 150, - addDisplay: false, - editDisplay: false, - viewDisplay: false, + label: '包装', + prop: 'packageType', + type: 'select', + dicData: packageOptions, + minWidth: 100, }, { label: '品牌', prop: 'brand', search: false, - hide: true, minWidth: 120, placeholder: '请输入', rules: textRule('品牌', 50), }, - { - label: '包装', - prop: 'packageType', - type: 'select', - dicData: packageOptions, - hide: true, - minWidth: 100, - }, { label: '规格', prop: 'specification', diff --git a/src/option/business/shipping-template.js b/src/option/business/shipping-template.js index 8ca887e..bc31478 100644 --- a/src/option/business/shipping-template.js +++ b/src/option/business/shipping-template.js @@ -12,8 +12,12 @@ export const config = { exportName: '发货模板', enableAllDept: false, enableProjectSelect: true, + excludeVoidedProjects: true, enableAttachmentTable: true, enableTransportPlanForm: true, + enableShippingTemplateFreight: true, + editableRoadAddress: true, + fixedTransportAddressType: true, enableTemplateCodePreview: true, attachmentTitle: '附件', defaultForm: { @@ -178,6 +182,7 @@ export const option = { labelWidth: '0px', className: 'business-crud-page__full-form-item', }, + { label: '运费信息', prop: 'freightJson', hide: true, display: false }, { label: '', prop: 'attachmentTitle', diff --git a/src/option/business/transport-plan.js b/src/option/business/transport-plan.js index 8ab8982..54e27a8 100644 --- a/src/option/business/transport-plan.js +++ b/src/option/business/transport-plan.js @@ -97,7 +97,7 @@ const formatGoodsInfo = row => { const text = Object.entries(groups) .map(([unit, group]) => { const quantity = `${formatGoodsQuantity(group.quantity)}${unit}`; - return `${group.typeName}等${group.count}中货物 | ${quantity}`; + return `${group.typeName}等${group.count}种货物 | ${quantity}`; }) .join('; '); diff --git a/src/option/business/waybill-manage.js b/src/option/business/waybill-manage.js index fb9b1fe..5c07a81 100644 --- a/src/option/business/waybill-manage.js +++ b/src/option/business/waybill-manage.js @@ -32,6 +32,23 @@ const parseJsonArray = value => { } }; +const hasProcessConfig = value => { + if (isEmpty(value)) return false; + if (typeof value !== 'string') { + return Array.isArray(value) ? value.length > 0 : typeof value === 'object'; + } + const text = value.trim(); + if (!text) return false; + try { + const result = JSON.parse(text); + return Array.isArray(result) + ? result.length > 0 + : Boolean(result && Object.keys(result).length); + } catch (error) { + return true; + } +}; + const getFirstValue = (row, props) => { const prop = props.find(item => !isEmpty(row[item])); return prop ? row[prop] : ''; @@ -96,6 +113,11 @@ export const config = { exportUrl: '/blade-transport/waybill-manage/export-waybill-manage', exportName: '运单管理', importUrl: '/blade-transport/waybill-manage/import-waybill-manage', + defaultForm: { + carrierType: '承运商', + quantityUnit: '吨', + priceUnit: '元/吨', + }, enableAllDept: false, enableProjectSelect: true, templateCreateTarget: 'waybill-manage', @@ -103,6 +125,13 @@ export const config = { enableShippingPlanSelect: true, enableShippingInfoForm: true, enableTaskInfoForm: true, + enableWaybillFooterFreightSummary: true, + enableDraftSave: true, + saveAsDraft: true, + skipDraftValidation: true, + draftStatusProp: 'businessStatus', + draftStatus: 'draft', + draftSaveText: '暂存', batchDelete: false, actionButtonLikeSearch: true, createText: '新建运单', @@ -118,6 +147,16 @@ export const config = { actions: ['copy', 'cancel', 'reassign', 'complete', 'batchComplete'], statusProp: 'businessStatus', statusTextProp: 'businessStatusName', + formatStatus(row, prop, defaultText) { + if ( + prop === 'businessStatus' && + row.businessStatus === 'pending' && + !hasProcessConfig(row.processJson) + ) { + return '进行中'; + } + return defaultText; + }, deleteStatus: ['draft'], editStatus: ['draft', 'pending'], }; diff --git a/src/views/base/common-address.vue b/src/views/base/common-address.vue index 9c34efd..2fae585 100644 --- a/src/views/base/common-address.vue +++ b/src/views/base/common-address.vue @@ -195,6 +195,17 @@ /> + + { this.deptOptions = this.flattenDept(res.data.data || []); - const deptColumn = this.findColumn(this.option.column, 'deptId'); + const deptColumn = this.findColumn(this.option.column, 'searchDeptId'); deptColumn.dicData = this.deptOptions; }); }, @@ -736,6 +747,9 @@ export default { const numberValue = Number(value); return Number.isFinite(numberValue) ? numberValue.toFixed(6) : ''; }, + handleContactPhoneInput(value) { + this.form.contactPhone = String(value || '').replace(/\D/g, ''); + }, normalizeRow(row) { const trimValue = value => String(value || '').trim(); const submitRow = { @@ -820,6 +834,10 @@ export default { this.$message.warning('联系方式不能超过20个字'); return false; } + if (row.contactPhone && !/^\d+$/.test(row.contactPhone)) { + this.$message.warning('联系方式只能输入数字'); + return false; + } if (row.remark && row.remark.length > 200) { this.$message.warning('备注不能超过200个字'); return false; diff --git a/src/views/business/common-cargo.vue b/src/views/business/common-cargo.vue index 574ae20..a564991 100644 --- a/src/views/business/common-cargo.vue +++ b/src/views/business/common-cargo.vue @@ -108,14 +108,18 @@ - - + + + + + + @@ -245,25 +279,36 @@ v-model="form.departureName" readonly :placeholder="transportStationNamePlaceholder" - :suffix-icon="transportStationMode ? Search : undefined" :disabled="transportAddressSelectDisabled" @click="openTransportPrimaryAddressPicker('departure')" - /> + > + + + @click="handleTransportSecondaryAddressInputClick('departure')" + > + + 联系人 @@ -283,25 +328,36 @@ v-model="form.arrivalName" readonly :placeholder="transportStationNamePlaceholder" - :suffix-icon="transportStationMode ? Search : undefined" :disabled="transportAddressSelectDisabled" @click="openTransportPrimaryAddressPicker('arrival')" - /> + > + + + @click="handleTransportSecondaryAddressInputClick('arrival')" + > + + 联系人 @@ -312,19 +368,19 @@ @@ -1653,6 +1946,21 @@ @@ -2208,18 +2516,21 @@ - + + - - -
将 Excel 文件拖到此处,或点击上传
- -
+
+ + 上传 + + + 点击下载模板 +
+ +
+ + + + + + + + + + + + +
+ +
+