From c339852e0412f63a6fea4168b7241532b9dc6e38 Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Thu, 6 Aug 2026 02:57:55 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug=202=E3=80=81=E5=AE=A2=E5=95=86=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 2 + src/api/vehicle/customer-archive.js | 10 + .../vehicle-attachment-upload/main.vue | 3 + src/option/base/cargo-type.js | 28 +- src/option/base/common-address.js | 251 ++++++----- src/option/business/common-cargo.js | 206 +++++++-- src/option/business/common-route.js | 184 ++++++-- src/option/business/contract-manage.js | 4 +- src/option/business/process-config.js | 118 ++++-- src/styles/element-ui.scss | 31 +- src/utils/import-excel.js | 7 +- src/views/authority/role.vue | 12 +- src/views/base/cargo-type.vue | 27 +- src/views/base/common-address.vue | 101 ++++- src/views/business/common-cargo.vue | 45 +- src/views/business/common-route.vue | 399 +++++++++++++++++- .../components/business-crud-page.vue | 1 - src/views/business/process-config.vue | 178 +++++--- src/views/business/project-apply.vue | 8 +- src/views/transportCapacity/driver.vue | 1 - src/views/transportCapacity/ship.vue | 1 - src/views/transportCapacity/vehicle.vue | 1 - .../vehicle/credit-score-quantification.vue | 212 +++------- src/views/vehicle/customer-archive.vue | 330 +++++++++++---- 24 files changed, 1612 insertions(+), 548 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 202dc20..97ba538 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -170,12 +170,14 @@ Avue 表格/表单配置独立存放于 `src/option/` 目录,与 `views` 和 ` - 表格操作列同时展示“查看、编辑、删除”等三个按钮时,操作列宽度统一不小于 `220px`;操作列最大按钮数量超过 3 个时,操作列宽度统一加宽到不小于 `320px`;最大按钮数量超过 4 个时,仍按 `320px` 保持列宽,并从第 5 个按钮开始换行展示,禁止出现按钮裁切或显示不全。 - 表格操作列按钮统一仅展示文字,禁止配置 `icon` / `:icon` 或在操作按钮、操作下拉项中嵌入图标;顶部工具栏按钮不受此条限制。 - 纯文字操作入口统一使用 ``,禁止使用带 `text` 属性的 ``;提交、确认、上传等具有明确命令语义或需要加载状态的按钮可继续使用 ``。 +- 所有表格操作列中的文字链接统一保持 `8px` 间距;操作按钮超过操作列可用宽度时必须自动换行,禁止链接连续粘连或被裁切。Avue 自定义 `#menu` 插槽和手写 `el-table-column` 操作列均适用。 - `.avue-crud__header` 顶部间距统一为 `12px`。 - 分页组件整体靠右展示,必须展示接口返回的数据总条数,`X条/页` 的页容量选择器必须放在总条数右侧。 - `.basic-container__card` 的直接子级 `.el-card__body` 内边距统一去除,保持 `padding: 0` - 所有 CRUD 页面搜索栏需与下方表格拆分为独立区域,两者垂直间距统一为 `8px`。 - 所有 CRUD 页面搜索栏操作按钮(搜索、清空等)需在搜索表单下方独占一行并放置在最右侧;搜索条件超过一行时必须显示“展开/折叠”,默认折叠且仅展示一行搜索条件;一行布局默认展示 4 个筛选项,Avue 配置统一使用 `searchIndex: 4`。 - 所有 CRUD 页面中新增、批量导入等顶部按钮组行不需要背景色,应保持透明背景。 +- 所有 CRUD 页面顶部工具栏的“新增/新建”主操作按钮统一使用蓝底白字的实心主按钮(`type="primary"` 且不使用 `plain`),视觉标准与“新建运单”一致;批量导入、导出等辅助工具按钮仍使用描边样式。 - 所有 `.basic-container__card` 内的 Avue 内层 `el-card` 需去卡片化,仅保留外层容器卡片样式,禁止出现二级卡片边框、阴影或额外内边距。 ### 4.5 全局注册组件 diff --git a/src/api/vehicle/customer-archive.js b/src/api/vehicle/customer-archive.js index 08245bc..8762746 100644 --- a/src/api/vehicle/customer-archive.js +++ b/src/api/vehicle/customer-archive.js @@ -40,6 +40,16 @@ export const submitApproval = id => { }); }; +export const withdrawApproval = id => { + return request({ + url: '/blade-transport/customer-archive/withdraw-approval', + method: 'post', + params: { + id, + }, + }); +}; + export const approve = id => { return request({ url: '/blade-transport/customer-archive/approve', diff --git a/src/components/vehicle-attachment-upload/main.vue b/src/components/vehicle-attachment-upload/main.vue index 3b0e801..206ede6 100644 --- a/src/components/vehicle-attachment-upload/main.vue +++ b/src/components/vehicle-attachment-upload/main.vue @@ -85,6 +85,9 @@ const MIME_MAP = { xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', ppt: 'application/vnd.ms-powerpoint', pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + eml: 'message/rfc822', + msg: 'application/vnd.ms-outlook', + zip: 'application/zip', txt: 'text/plain', }; diff --git a/src/option/base/cargo-type.js b/src/option/base/cargo-type.js index fcc8d2c..963b297 100644 --- a/src/option/base/cargo-type.js +++ b/src/option/base/cargo-type.js @@ -56,10 +56,10 @@ export const getCargoTypeOption = ctx => ({ type: 'radio', dataType: 'number', dicData: typeLevelDic, - search: true, - searchSpan: 6, + search: false, value: 2, span: 24, + order: 100, hide: true, minWidth: 120, editDisabled: true, @@ -70,20 +70,34 @@ export const getCargoTypeOption = ctx => ({ label: '货物类型', prop: 'cargoName', minWidth: 150, + search: true, + searchPlaceholder: '请输入', + searchSpan: 6, + searchOrder: 2, + order: 70, + placeholder: '请输入', maxlength: 50, showWordLimit: true, showOverflowTooltip: true, - rules: [{ validator: validateCargoName, trigger: 'blur' }], + rules: [ + { required: true, message: '请输入货物类型名称', trigger: 'blur' }, + { validator: validateCargoName, trigger: 'blur' }, + ], }, { label: '货物类型编码', prop: 'cargoCode', minWidth: 140, search: true, + searchPlaceholder: '请输入', searchSpan: 6, + searchOrder: 1, maxlength: 4, + order: 60, + placeholder: '请输入', editDisabled: true, rules: [ + { required: true, message: '请输入货物类型编码', trigger: 'blur' }, { validator: (rule, value, callback) => { const form = ctx.form || {}; @@ -115,6 +129,8 @@ export const getCargoTypeOption = ctx => ({ hide: true, display: false, span: 12, + order: 90, + placeholder: '请输入', rules: [{ required: true, message: '请选择上级货物类型', trigger: 'change' }], }, { @@ -128,16 +144,19 @@ export const getCargoTypeOption = ctx => ({ minWidth: 160, }, { - label: '上级货物编码', + label: '上级货物类型编码', prop: 'parentCargoCode', slot: true, readonly: true, editDisabled: true, + addDisabled: true, addDisplay: false, editDisplay: false, display: false, span: 12, + order: 80, minWidth: 160, + placeholder: '请输入', rules: [{ required: true, message: '请选择上级货物类型', trigger: 'change' }], }, { @@ -156,6 +175,7 @@ export const getCargoTypeOption = ctx => ({ minRows: 4, span: 24, minWidth: 180, + placeholder: '请输入', maxlength: 200, showWordLimit: true, overHidden: true, diff --git a/src/option/base/common-address.js b/src/option/base/common-address.js index 89d0baa..189284a 100644 --- a/src/option/base/common-address.js +++ b/src/option/base/common-address.js @@ -27,18 +27,154 @@ export const createOption = () => ({ delBtn: false, addBtn: false, dialogClickModal: false, - menuWidth: 160, + menuFixed: 'right', + menuWidth: 220, column: [ + { + label: '地址名称', + prop: 'addressName', + search: true, + searchOrder: 8, + span: 24, + minWidth: 150, + showOverflowTooltip: true, + placeholder: '请输入', + maxlength: 100, + showWordLimit: true, + rules: [ + { required: true, message: '请输入地址名称', trigger: 'blur' }, + { max: 100, message: '地址名称不能超过100个字', trigger: 'blur' }, + ], + }, + { + label: '地址编号', + prop: 'addressCode', + minWidth: 120, + addDisplay: false, + editDisplay: false, + }, { label: '类型', prop: 'addressType', type: 'select', formslot: true, search: true, + searchOrder: 7, span: 24, + minWidth: 140, dicData: addressTypeOptions, rules: [{ required: true, message: '请选择类型', trigger: 'change' }], }, + { + label: '站点编码', + prop: 'siteCodeDisplay', + search: false, + minWidth: 120, + addDisplay: false, + editDisplay: false, + }, + { + label: '详细地址', + prop: 'detailAddress', + search: true, + searchOrder: 5, + formslot: true, + type: 'textarea', + minRows: 3, + span: 24, + minWidth: 220, + showOverflowTooltip: true, + rules: [ + { required: true, message: '请输入详细地址', trigger: 'blur' }, + { max: 255, message: '详细地址不能超过255个字', trigger: 'blur' }, + ], + }, + { + label: '经度', + prop: 'longitude', + minWidth: 120, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '纬度', + prop: 'latitude', + minWidth: 120, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '行政区划', + prop: 'regionName', + search: true, + searchOrder: 4, + display: false, + minWidth: 150, + rules: [{ required: true, message: '请选择行政区划', trigger: 'change' }], + }, + { + label: '联系人', + prop: 'contactName', + search: true, + searchOrder: 2, + minWidth: 110, + placeholder: '请输入', + maxlength: 50, + rules: [{ max: 50, message: '联系人不能超过50个字', trigger: 'blur' }], + }, + { + label: '联系方式', + prop: 'contactPhone', + search: true, + searchOrder: 1, + minWidth: 130, + placeholder: '请输入', + maxlength: 20, + rules: [{ max: 20, message: '联系方式不能超过20个字', trigger: 'blur' }], + }, + { + label: '组织', + prop: 'deptName', + minWidth: 150, + addDisplay: false, + editDisplay: false, + }, + { + label: '备注', + prop: 'remark', + type: 'textarea', + minRows: 4, + span: 24, + minWidth: 160, + overHidden: true, + showOverflowTooltip: true, + placeholder: '请输入', + maxlength: 200, + showWordLimit: true, + rules: [{ max: 200, message: '备注不能超过200个字', trigger: 'blur' }], + }, + { + label: '更新时间', + prop: 'updateTime', + type: 'datetime', + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + width: 180, + addDisplay: false, + editDisplay: false, + }, + { + label: '创建时间', + prop: 'createTime', + type: 'datetime', + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + width: 180, + addDisplay: false, + editDisplay: false, + }, { label: '港口', prop: 'portId', @@ -75,133 +211,24 @@ export const createOption = () => ({ span: 24, rules: [{ required: true, message: '请选择机场标准名称', trigger: 'change' }], }, - { - label: '地址名称', - prop: 'addressName', - search: true, - span: 24, - minWidth: 150, - maxlength: 100, - showWordLimit: true, - rules: [ - { required: true, message: '请输入地址名称', trigger: 'blur' }, - { max: 100, message: '地址名称不能超过100个字', trigger: 'blur' }, - ], - }, - { - label: '地址编号', - prop: 'addressCode', - minWidth: 120, - addDisplay: false, - editDisplay: false, - }, - { - label: '站点编码', - prop: 'siteCodeDisplay', - search: false, - minWidth: 120, - addDisplay: false, - editDisplay: false, - }, { label: '站点编码', prop: 'siteCode', search: true, + searchOrder: 6, hide: true, addDisplay: false, editDisplay: false, }, - { - label: '行政区划', - prop: 'regionName', - search: true, - display: false, - minWidth: 150, - rules: [{ required: true, message: '请选择行政区划', trigger: 'change' }], - }, - { - label: '详细地址', - prop: 'detailAddress', - search: true, - formslot: true, - type: 'textarea', - minRows: 3, - span: 24, - minWidth: 220, - rules: [ - { required: true, message: '请输入详细地址', trigger: 'blur' }, - { max: 255, message: '详细地址不能超过255个字', trigger: 'blur' }, - ], - }, { label: '组织', prop: 'deptId', type: 'select', search: true, + searchOrder: 3, hide: true, display: false, dicData: [], }, - { - label: '组织', - prop: 'deptName', - minWidth: 150, - addDisplay: false, - editDisplay: false, - }, - { - label: '联系人', - prop: 'contactName', - search: true, - minWidth: 110, - maxlength: 50, - rules: [{ max: 50, message: '联系人不能超过50个字', trigger: 'blur' }], - }, - { - label: '联系方式', - prop: 'contactPhone', - search: true, - minWidth: 130, - maxlength: 20, - rules: [{ max: 20, message: '联系方式不能超过20个字', trigger: 'blur' }], - }, - { - label: '备注', - prop: 'remark', - type: 'textarea', - minRows: 4, - span: 24, - hide: true, - maxlength: 200, - showWordLimit: true, - rules: [{ max: 200, message: '备注不能超过200个字', trigger: 'blur' }], - }, - { - label: '更新人', - prop: 'updateUserName', - minWidth: 120, - addDisplay: false, - editDisplay: false, - }, - { - label: '更新时间', - prop: 'updateTime', - type: 'datetime', - format: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'YYYY-MM-DD HH:mm:ss', - minWidth: 160, - addDisplay: false, - editDisplay: false, - }, - { - label: '创建时间', - prop: 'createTime', - type: 'datetime', - format: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'YYYY-MM-DD HH:mm:ss', - minWidth: 160, - addDisplay: false, - editDisplay: false, - }, ], }); diff --git a/src/option/business/common-cargo.js b/src/option/business/common-cargo.js index 6e51b67..e0e3410 100644 --- a/src/option/business/common-cargo.js +++ b/src/option/business/common-cargo.js @@ -6,6 +6,15 @@ import { 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 []; +}; + export const config = { title: '常用货物', permission: 'common_cargo', @@ -17,12 +26,29 @@ export const config = { }; export const option = createCrudOption([ + { + label: '货物名称', + prop: 'cargoName', + minWidth: 150, + placeholder: '请输入', + rules: textRule('货物名称', 100, true), + }, + { + label: '货物编号', + prop: 'cargoCode', + formslot: true, + minWidth: 120, + maxlength: 20, + showWordLimit: true, + rules: [ + { required: true, message: '请输入货物编号', trigger: 'blur' }, + { max: 20, message: '货物编号不能超过20个字符', trigger: 'blur' }, + ], + }, { label: '一级货物类型', prop: 'firstCargoTypeName', formslot: true, - search: true, - searchOrder: 3, minWidth: 150, editDisabled: true, rules: [{ required: true, message: '请选择一级货物类型', trigger: 'change' }], @@ -39,8 +65,6 @@ export const option = createCrudOption([ label: '二级货物类型', prop: 'secondCargoTypeName', formslot: true, - search: true, - searchOrder: 4, minWidth: 150, editDisabled: true, rules: [{ required: true, message: '请选择二级货物类型', trigger: 'change' }], @@ -48,47 +72,118 @@ export const option = createCrudOption([ { label: '二级货物类型编码', prop: 'secondCargoTypeCode', - hide: true, display: false, addDisplay: false, editDisabled: true, }, + // 搜索字段与表格、表单字段独立,避免筛选配置影响数据展示和编辑布局。 { label: '货物名称', - prop: 'cargoName', + prop: 'searchCargoName', + searchProp: 'cargoName', search: true, - searchOrder: 1, - minWidth: 150, - rules: textRule('货物名称', 100, true), + searchOrder: 5, + searchPlaceholder: '请输入', + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, }, { label: '货物编号', - prop: 'cargoCode', - formslot: true, + prop: 'searchCargoCode', + searchProp: 'cargoCode', + search: true, + searchOrder: 4, + searchPlaceholder: '请输入', + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '一级货物类型', + prop: 'searchFirstCargoTypeName', + searchProp: 'firstCargoTypeName', + type: 'select', + searchType: 'select', + search: true, + searchOrder: 3, + searchPlaceholder: '请选择', + dicUrl: '/blade-system/cargo-type/list?current=1&size=9999&typeLevel=1', + dicFormatter: listDicFormatter, + props: { + label: 'cargoName', + value: 'cargoName', + }, + filterable: true, + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '二级货物类型', + prop: 'searchSecondCargoTypeName', + searchProp: 'secondCargoTypeName', + type: 'select', + searchType: 'select', search: true, searchOrder: 2, - minWidth: 120, - maxlength: 20, - showWordLimit: true, - rules: [ - { required: true, message: '请输入货物编号', trigger: 'blur' }, - { max: 20, message: '货物编号不能超过20个字符', trigger: 'blur' }, - ], + searchPlaceholder: '请选择', + dicUrl: '/blade-system/cargo-type/list?current=1&size=9999&typeLevel=2', + dicFormatter: listDicFormatter, + props: { + label: 'cargoName', + value: 'cargoName', + }, + filterable: true, + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, }, { label: '组织', - prop: 'deptName', + prop: 'searchDeptId', + searchProp: 'deptId', + type: 'select', + searchType: 'select', search: true, - searchOrder: 5, + searchOrder: 1, + searchPlaceholder: '请选择', + dicData: [], + props: { + label: 'label', + value: 'value', + }, + filterable: true, + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '包装品牌', + prop: 'packageBrand', + slot: true, minWidth: 150, addDisplay: false, editDisplay: false, + viewDisplay: false, }, { label: '品牌', prop: 'brand', search: false, + hide: true, minWidth: 120, + placeholder: '请输入', rules: textRule('品牌', 50), }, { @@ -96,10 +191,25 @@ export const option = createCrudOption([ prop: 'packageType', type: 'select', dicData: packageOptions, + hide: true, minWidth: 100, }, { - label: '货值', + label: '规格', + prop: 'specification', + minWidth: 120, + placeholder: '请输入', + rules: textRule('规格', 50), + }, + { + label: '型号', + prop: 'model', + minWidth: 120, + placeholder: '请输入', + rules: textRule('型号', 50), + }, + { + label: '单价', prop: 'cargoValue', formslot: true, minWidth: 120, @@ -129,29 +239,26 @@ export const option = createCrudOption([ minWidth: 120, }, { - label: '规格', - prop: 'specification', - minWidth: 120, - rules: textRule('规格', 50), - }, - { - label: '型号', - prop: 'model', - minWidth: 120, - rules: textRule('型号', 50), - }, - { - label: '说明', - prop: 'descriptionOne', - minWidth: 160, - rules: textRule('说明', 100), - }, - { - label: '数据来源', - prop: 'dataSource', + label: '尺寸', + prop: 'sizeText', minWidth: 120, addDisplay: false, editDisplay: false, + rules: textRule('尺寸', 100), + }, + { + label: '其他说明1', + prop: 'descriptionOne', + minWidth: 160, + placeholder: '请输入', + rules: textRule('其他说明1', 100), + }, + { + label: '其他说明2', + prop: 'descriptionTwo', + minWidth: 160, + placeholder: '请输入', + rules: textRule('其他说明2', 100), }, { label: '备注', @@ -159,12 +266,25 @@ export const option = createCrudOption([ type: 'textarea', minRows: 4, span: 24, - hide: true, maxlength: 200, showWordLimit: true, + placeholder: '请输入', rules: textRule('备注', 200), }, - ...auditColumns, + { + label: '组织', + prop: 'deptName', + minWidth: 150, + addDisplay: false, + editDisplay: false, + }, + ...auditColumns + .filter(column => ['updateTime', 'createTime'].includes(column.prop)) + .sort( + (first, second) => + ['updateTime', 'createTime'].indexOf(first.prop) - + ['updateTime', 'createTime'].indexOf(second.prop) + ), ]); export const excelOption = { diff --git a/src/option/business/common-route.js b/src/option/business/common-route.js index 507b23e..e5fd4eb 100644 --- a/src/option/business/common-route.js +++ b/src/option/business/common-route.js @@ -5,6 +5,8 @@ export const config = { permission: 'common_route', exportUrl: '/blade-transport/common-route/export-common-route', exportName: '常用线路', + importUrl: '/blade-transport/common-route/import-common-route', + templateUrl: '/blade-transport/common-route/export-template', enableAllDept: false, }; @@ -12,17 +14,14 @@ export const option = createCrudOption([ { label: '线路名称', prop: 'routeName', - search: true, - searchOrder: 1, - span: 24, + span: 12, minWidth: 150, + overHidden: true, rules: textRule('线路名称', 100, true), }, { label: '线路编号', prop: 'routeCode', - search: true, - searchOrder: 2, minWidth: 120, addDisplay: false, editDisabled: true, @@ -30,8 +29,6 @@ export const option = createCrudOption([ { label: '发货地', prop: 'departureName', - search: true, - searchOrder: 3, minWidth: 140, addDisplay: false, editDisplay: false, @@ -40,10 +37,9 @@ export const option = createCrudOption([ label: '发货地址', prop: 'departureAddress', formslot: true, - search: true, - searchOrder: 4, span: 24, minWidth: 220, + overHidden: true, rules: textRule('发货地址', 255, true), }, { @@ -53,6 +49,8 @@ export const option = createCrudOption([ precision: 6, minWidth: 120, hide: true, + addDisplay: false, + editDisplay: false, }, { label: '发货纬度', @@ -61,6 +59,8 @@ export const option = createCrudOption([ precision: 6, minWidth: 120, hide: true, + addDisplay: false, + editDisplay: false, }, { label: '发货联系人', @@ -77,8 +77,6 @@ export const option = createCrudOption([ { label: '收货地', prop: 'arrivalName', - search: true, - searchOrder: 5, minWidth: 140, addDisplay: false, editDisplay: false, @@ -87,10 +85,9 @@ export const option = createCrudOption([ label: '收货地址', prop: 'arrivalAddress', formslot: true, - search: true, - searchOrder: 6, span: 24, minWidth: 220, + overHidden: true, rules: textRule('收货地址', 255, true), }, { @@ -100,6 +97,8 @@ export const option = createCrudOption([ precision: 6, minWidth: 120, hide: true, + addDisplay: false, + editDisplay: false, }, { label: '收货纬度', @@ -108,6 +107,8 @@ export const option = createCrudOption([ precision: 6, minWidth: 120, hide: true, + addDisplay: false, + editDisplay: false, }, { label: '收货联系人', @@ -121,25 +122,160 @@ export const option = createCrudOption([ minWidth: 140, rules: [phoneRule('收货联系方式'), ...textRule('收货联系方式', 50)], }, - { - label: '组织', - prop: 'deptName', - search: true, - searchOrder: 7, - minWidth: 150, - addDisplay: false, - editDisplay: false, - }, { label: '备注', prop: 'remark', type: 'textarea', minRows: 4, span: 24, - hide: true, + minWidth: 180, maxlength: 500, showWordLimit: true, rules: textRule('备注', 500), }, - ...auditColumns, + { + label: '组织', + prop: 'deptName', + minWidth: 150, + addDisplay: false, + editDisplay: false, + }, + // 搜索字段独立于表格和表单字段,避免筛选配置影响数据展示和编辑布局。 + { + label: '线路名称', + prop: 'searchRouteName', + searchProp: 'routeName', + search: true, + searchOrder: 7, + searchPlaceholder: '请输入', + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '线路编号', + prop: 'searchRouteCode', + searchProp: 'routeCode', + search: true, + searchOrder: 6, + searchPlaceholder: '请输入', + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '发货地', + prop: 'searchDepartureName', + searchProp: 'departureName', + search: true, + searchOrder: 5, + searchPlaceholder: '请输入', + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '发货地址', + prop: 'searchDepartureAddress', + searchProp: 'departureAddress', + search: true, + searchOrder: 4, + searchPlaceholder: '请输入', + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '收货地', + prop: 'searchArrivalName', + searchProp: 'arrivalName', + search: true, + searchOrder: 3, + searchPlaceholder: '请输入', + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '收货地址', + prop: 'searchArrivalAddress', + searchProp: 'arrivalAddress', + search: true, + searchOrder: 2, + searchPlaceholder: '请输入', + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '组织', + prop: 'searchDeptId', + searchProp: 'deptId', + search: true, + searchOrder: 1, + searchType: 'cascader', + searchPlaceholder: '请选择', + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + dicData: [], + props: { + label: 'label', + value: 'value', + children: 'children', + }, + checkStrictly: true, + emitPath: false, + showAllLevels: false, + filterable: true, + }, + ...auditColumns + .filter(column => column.prop !== 'createUserName') + .map(column => + ['createTime', 'updateTime'].includes(column.prop) ? { ...column, minWidth: 190 } : column + ) + .sort( + (first, second) => + ['updateUserName', 'updateTime', 'createTime'].indexOf(first.prop) - + ['updateUserName', 'updateTime', 'createTime'].indexOf(second.prop) + ), ]); + +export const excelOption = { + submitBtn: false, + emptyBtn: false, + column: [ + { + label: '导入模板', + prop: 'excelTemplate', + formslot: true, + span: 24, + }, + { + label: 'Excel文件', + prop: 'excelFile', + type: 'upload', + drag: true, + loadText: '模板上传中,请稍等', + span: 24, + propsHttp: { + res: 'data', + }, + tip: '请上传 .xls,.xlsx 标准格式文件', + }, + ], +}; diff --git a/src/option/business/contract-manage.js b/src/option/business/contract-manage.js index dc7d4f4..3e635f9 100644 --- a/src/option/business/contract-manage.js +++ b/src/option/business/contract-manage.js @@ -241,7 +241,7 @@ export const option = createCrudOption([ prop: 'partyA', type: 'select', order: 160, - dicUrl: '/blade-transport/customer-archive/list?current=1&size=9999&approvalStatus=approved', + dicUrl: '/blade-transport/customer-archive/list?current=1&size=9999&approvalStatus=approved&status=1', dicFormatter: listDicFormatter, props: { label: 'fullName', @@ -256,7 +256,7 @@ export const option = createCrudOption([ prop: 'partyB', type: 'select', order: 150, - dicUrl: '/blade-transport/customer-archive/list?current=1&size=9999&approvalStatus=approved', + dicUrl: '/blade-transport/customer-archive/list?current=1&size=9999&approvalStatus=approved&status=1', dicFormatter: listDicFormatter, props: { label: 'fullName', diff --git a/src/option/business/process-config.js b/src/option/business/process-config.js index 2b00185..3e0c64f 100644 --- a/src/option/business/process-config.js +++ b/src/option/business/process-config.js @@ -13,7 +13,7 @@ export const config = { permission: 'process_config', exportUrl: '/blade-transport/process-config/export-process-config', exportName: '过程配置', - enableAllDept: false, + enableAllDept: true, actions: ['copy', 'enable', 'disable'], statusProp: 'status', statusTextProp: 'statusName', @@ -29,21 +29,13 @@ export const option = applyTableMenuWidth({ span: 24, hide: true, }, - { - label: '配置编号', - prop: 'configCode', - search: true, - searchOrder: 4, - minWidth: 130, - addDisplay: false, - editDisplay: false, - editDisabled: true, - }, { label: '配置名称', prop: 'configName', search: true, searchOrder: 6, + searchSpan: 6, + searchPlaceholder: '请输入', span: 12, minWidth: 150, addDisplay: false, @@ -51,13 +43,16 @@ export const option = applyTableMenuWidth({ rules: textRule('配置名称', 100, true), }, { - label: '项目ID集合', - prop: 'projectIds', - hide: true, - display: false, + label: '配置编号', + prop: 'configCode', + search: true, + searchOrder: 4, + searchSpan: 6, + searchPlaceholder: '请输入', + minWidth: 130, addDisplay: false, editDisplay: false, - rules: textRule('项目ID集合', 1000, true), + editDisabled: true, }, { label: '项目', @@ -65,7 +60,9 @@ export const option = applyTableMenuWidth({ formslot: true, search: true, searchOrder: 5, - searchType: 'select', + searchType: 'input', + searchSpan: 6, + searchPlaceholder: '请输入', type: 'textarea', minRows: 2, span: 12, @@ -77,48 +74,98 @@ export const option = applyTableMenuWidth({ rules: textRule('项目', 1000, true), }, { - label: '包含过程节点', + label: '过程节点', prop: 'includedNodes', - search: true, - searchOrder: 3, type: 'select', multiple: true, dicData: nodeOptions, - minWidth: 180, - rules: selectRule('包含过程节点'), + minWidth: 260, + overHidden: false, + slot: true, + addDisplay: false, + editDisplay: false, + rules: selectRule('过程节点'), }, { - label: '默认完成运输天数', + label: '默认运输完成天数', prop: 'defaultFinishDays', formslot: true, type: 'number', - min: 1, + min: 0, max: 999, span: 12, + minWidth: 170, + addDisplay: false, + editDisplay: false, + }, + { + label: '备注', + prop: 'remark', + type: 'textarea', + minRows: 4, + span: 24, + minWidth: 180, + addDisplay: false, + editDisplay: false, + maxlength: 500, + showWordLimit: true, + rules: textRule('备注', 500), + }, + { + label: '组织', + prop: 'deptName', minWidth: 150, addDisplay: false, editDisplay: false, }, + ...auditColumns + .filter(column => ['updateTime', 'createTime'].includes(column.prop)) + .map(column => ({ ...column, minWidth: 190 })) + .sort( + (first, second) => + ['updateTime', 'createTime'].indexOf(first.prop) - + ['updateTime', 'createTime'].indexOf(second.prop) + ), + { + label: '项目ID集合', + prop: 'projectIds', + hide: true, + display: false, + addDisplay: false, + editDisplay: false, + rules: textRule('项目ID集合', 1000, true), + }, { label: '状态', prop: 'status', type: 'select', search: true, searchOrder: 1, + searchSpan: 6, + searchPlaceholder: '请选择', dicData: processStatusOptions, slot: true, - minWidth: 100, + hide: true, + fixed: false, addDisplay: false, editDisplay: false, }, { label: '组织', - prop: 'deptName', + prop: 'searchDeptId', + searchProp: 'deptId', + type: 'select', search: true, searchOrder: 2, - minWidth: 150, + searchSpan: 6, + searchPlaceholder: '请选择', + hide: true, + display: false, addDisplay: false, editDisplay: false, + viewDisplay: false, + dicData: [], + filterable: true, }, { label: '', @@ -127,22 +174,9 @@ export const option = applyTableMenuWidth({ span: 24, hide: true, }, - { - label: '备注', - prop: 'remark', - type: 'textarea', - minRows: 4, - span: 24, - hide: true, - addDisplay: false, - editDisplay: false, - maxlength: 500, - showWordLimit: true, - rules: textRule('备注', 500), - }, - ...auditColumns, ]), + saveBtnText: '保存', + updateBtnText: '保存', dialogTop: '10px', dialogWidth: '96%', - searchSpan: 8, }, 5); diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss index 4b46cab..a165b70 100644 --- a/src/styles/element-ui.scss +++ b/src/styles/element-ui.scss @@ -267,6 +267,19 @@ margin-top: 12px; } +// 统一 CRUD 顶部新增按钮为蓝底白字,保留其他工具按钮的描边样式 +.avue-crud__header .el-button--primary.is-plain:has(.el-icon-plus) { + --el-button-bg-color: #409eff; + --el-button-border-color: #409eff; + --el-button-hover-bg-color: #66b1ff; + --el-button-hover-border-color: #66b1ff; + --el-button-active-bg-color: #337ecc; + --el-button-active-border-color: #337ecc; + --el-button-text-color: #fff; + --el-button-hover-text-color: #fff; + --el-button-active-text-color: #fff; +} + // 统一分页为按钮样式并靠右展示 .avue-crud__pagination, .empty-pagination { @@ -462,16 +475,24 @@ display: none !important; } -// 全站统一:操作列最多一行展示 4 个按钮,第 5 个开始自动换行 -.avue-crud .el-table td .cell.avue-crud__menu { - display: inline-grid; - grid-template-columns: repeat(4, max-content); - gap: 4px; +// 全站统一:Avue 操作列文字链接保持间距并支持自动换行 +.avue-crud .avue-crud__menu { + display: inline-flex !important; + flex-wrap: wrap; + gap: 8px; align-items: center; justify-content: start; text-align: left; } +// 全站统一:手写表格操作列中的文字链接保持间距并支持自动换行 +.el-table .el-table__body .cell:not(.avue-crud__menu):has(> .el-link) { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 8px; +} + .avue-crud__menu > .el-button, .avue-crud__menu > .el-dropdown { margin: 0; diff --git a/src/utils/import-excel.js b/src/utils/import-excel.js index 39a8836..8e105bb 100644 --- a/src/utils/import-excel.js +++ b/src/utils/import-excel.js @@ -47,7 +47,12 @@ const decorateFailExcel = async (blob, businessName, failDetailDecorator) => { */ export const openImportDialog = (vm, businessName, onSuccess, options = {}) => { const { failDetailDecorator } = options; - const column = vm.findColumn(vm.excelOption.column, 'excelFile'); + const excelOption = vm.excelOption || vm.excelOptionConfig; + const column = vm.findColumn(excelOption?.column || [], 'excelFile'); + if (!column) { + vm.$message.error('导入配置异常,请稍后重试'); + return; + } column.httpRequest = (option, uploadColumn) => handleImportExcel(vm, option, uploadColumn, businessName, onSuccess, { failDetailDecorator }); vm.excelBox = true; diff --git a/src/views/authority/role.vue b/src/views/authority/role.vue index 717c8f1..3070d66 100644 --- a/src/views/authority/role.vue +++ b/src/views/authority/role.vue @@ -250,7 +250,7 @@ export default { viewBtn: true, labelWidth: 'auto', searchLabelWidth: 160, - menuWidth: 160, + menuWidth: 320, dialogWidth: 600, dialogClickModal: false, column: [ @@ -466,7 +466,7 @@ export default { }); }, rowSave(row, done, loading) { - add(row).then( + add(this.withTenantId(row)).then( () => { this.onLoad(this.page); this.$message({ @@ -482,7 +482,7 @@ export default { ); }, rowUpdate(row, index, done, loading) { - update(row).then( + update(this.withTenantId(row)).then( () => { this.onLoad(this.page); this.$message({ @@ -497,6 +497,12 @@ export default { } ); }, + withTenantId(row) { + return { + ...row, + tenantId: row.tenantId || this.userInfo.tenantId || website.tenantId, + }; + }, rowDel(row) { this.$confirm('确定将选择数据删除?', { confirmButtonText: '确定', diff --git a/src/views/base/cargo-type.vue b/src/views/base/cargo-type.vue index 0043296..3ab47f6 100644 --- a/src/views/base/cargo-type.vue +++ b/src/views/base/cargo-type.vue @@ -5,7 +5,7 @@ :table-loading="loading" :data="data" v-model:page="page" - v-model:form="form" + v-model="form" ref="crud" :permission="permissionList" :before-open="beforeOpen" @@ -22,7 +22,7 @@ > + +