- 解决客户档案编辑页不可编辑状态下不同电脑显示颜色不一致问题 - 统一覆盖 Element Plus 默认 disabled 文字色为 #a8abb2 - 防止主题或浏览器导致的颜色差异,保持全站一致性 - 样式修改添加至 element-ui.scss,紧跟表头颜色统一规则 - 提供便捷调整建议,如需更深色可改为 #606266
11 KiB
2026-08-26
el-table 内嵌 el-autocomplete 撑满列宽(全局规则补充)
问题: business/transport-plan/form?mode=add 独立表单页"货物信息"表格,
「货物名称」列 placeholder 请输入货物名称 只显示 请输入货物名…。
根因: element-ui.scss 兜底规则只覆盖 .el-input,而 <el-autocomplete> 在 Element Plus 中
根节点是 .el-autocomplete 包装层,内部才是 .el-input,中间多了一层导致选择器不命中,
autocomplete 没有拉满 cell,placeholder 被内边距 / clear 图标挤压截断。
修复:
src/styles/element-ui.scss第 663 行兜底规则追加:.cell > .el-autocompletewidth:100%.cell > .el-autocomplete > .el-inputwidth:100%.cell > .el-autocomplete .el-input__wrapperwidth:100%
src/views/business/components/business-crud-page.vue:1520独立表单页 "货物名称"列min-width="150"→240(与 1544 行「货物类型」cascader 列一致)。
其它内嵌 <el-select> / <el-input> / <el-cascader> 不受影响(选择器依旧命中),
3626 行(调度明细「货物名称」用的是 el-select)未做改动。
全站搜索栏 label 宽度统一 88px
问题: 主人反馈 business/master-order 搜索区 label 宽度 160px,要求全站统一改成 88px,
参考 business/shipping-template(已经是 88px)。
调研:
src/styles/element-ui.scss:133-136已有.avue-crud__search .el-form-item__label { min-width: 88px; }, 全站 Avue 自动搜索栏视觉上就是 88px。- shipping-template 走
<business-crud-page>(Avue),所以 label 是 88px。 - 但是项目里有 18 个文件,22 处直接手写
<el-form ... label-width="160px">,不走.avue-crud__search, 视觉就是 160px。这些都是搜索/筛选<el-form>(顶层 query 或子表单),不是表单 dialog 内填表。
改动: 全部 22 处 label-width="160px" → label-width="88px"。
涉及文件:
- business: master-order.vue, voucher-manage.vue(3 处), loading-manage.vue
- payment: invoice-application, invoice-receipt, receipt-flow, receipt-claim-record, payment-application, components/bill-ledger-search, components/bill-payment-search
- settlement: settlement-adjustment, receivable-payable-detail, pre-settlement, formal-settlement, transport-reconciliation, components/transport-reconciliation-editor, components/formal-settlement-editor(3 处,都是子筛选)
- transit: risk-disposal, exception-disposal
遗漏补丁: transit/exception-disposal.vue 搜索区不走 Avue,而是在 scoped 样式里用
:deep(.el-form-item__label) { min-width: 160px } 写死,盖过了全局 88px。
已改为 min-width: 88px(文件第 443 行)。risk-disposal.vue 无此 scoped 覆盖,本来就是 88px。
未做改动: 表单 dialog 内填写项(shipping-template-dialog /
transport-plan-dialog / waybill-manage-dialog 等)走专门的 dialogCustomClass + labelWidth:100,
不受本规则影响。
其余残留 160px 均非搜索栏: project-apply.vue:2095(表单详情弹窗 label,故意留 6 汉字)、
customer-archive.vue:4980(按钮 min-width)、cargo-type.vue:604(选择器拼错不生效,设 50px)。
payment-application 表单 input 文字居左
src/views/payment/payment-application-form.vue:追加 scoped 样式,使el-input-number的输入文字居左对齐(付款比例、申请付款金额等数字字段),与 bill-ledger-form 保持一致。
正式结算查看页去除内容行高
问题: settlement/formal-settlement/form?mode=view 中只读字段(如项目名称、合同名称)
多行文本行高过大,Element Plus 默认 .el-form-item__content 的 line-height 导致显示松散。
修复: src/views/settlement/components/formal-settlement-editor.vue scoped 样式追加:
.formal-editor :deep(.el-form-item__content) {
line-height: normal;
}
全站表单项间距统一 14px
诉求: settlement/pre-settlement/form?mode=add 中 .el-form-item 间距偏大,要求统一为 14px 且全站一致(用户指"表单项间距")。
排查: 全站 .el-form-item 的 margin-bottom 取值不一致——表单填写区有 16px / 18px / 20px,
搜索栏统一 8px(保留),个别特殊分组 28px(risk-disposal,保留)。全局 .el-form-item--default
已是 14px,但各页面 scoped :deep(.xxx .el-form-item) 覆盖成了 16/18/20px。
改动(表单填写区统一 14px,16/18/20 → 14):
- settlement:
components/pre-settlement-editor.vue:1637(16→14)、components/formal-settlement-editor.vue:1560(16→14)、receivable-payable-detail.vue:1860(16→14)、components/transport-reconciliation-editor.vue:805(16→14)、components/settlement-adjustment-editor.vue:560(16→14) - business:
voucher-manage.vue:1022(16→14)、loading-manage.vue:2751(16→14)、project-apply.vue:2091(16→14)、contract-manage.vue:2253(16→14)、components/business-crud-page.vue:13380/13894(16→14)、components/master-order-dispatch.vue:700(16→14) - payment:
invoice-receipt-form.vue:755(16→14)、user.vue:1097(16→14)、bill-ledger-form.vue:564(16→14)、payment-application-form.vue:1324(16→14)、bill-payment-form.vue:382(16→14) - 全局:
components/cron-editor/main.vue:579(18→14)、styles/element-ui.scss:430(.dialog-form--carded20→14)
保留未动: 所有 __search 搜索栏的 8px、risk-disposal 的 28px 特殊分组、transportCapacity
vehicle/driver/ship 与 customer-archive 等本就是 14px(含 !important)。
project-apply 表头颜色在不同电脑不一致
问题: 客户反馈 business/project-apply/form?mode=add 页面中「客户信息」等表格表头颜色
在用户电脑是 #374151,客户电脑是 #909399。
根因:
src/styles/theme/go.scss中.theme-go .el-table tr th .cell { color: #374151 }把表头文字写死为#374151。- 客户电脑未使用
theme-go,表头文字走 Element Plus 默认 CSS 变量--el-table-header-text-color: #909399。 src/views/business/project-apply.vue里的:deep(.el-table__header th) { color: #303133 }只作用在th上,颜色靠继承,优先级敌不过直接写在.cell上的规则和 Element Plus 默认值, 所以实际没生效。
修复:
src/styles/element-ui.scss在「统一全站 el-table 表头背景色」之后追加规则:直接作用于.el-table .el-table__header-wrapper th.el-table__cell .cell { color: #374151; }.cell,特异性高于theme-go和 Element Plus 默认,全站统一为#374151。src/views/business/project-apply.vue清理两处与全局冲突且不生效的局部表头样式: 删除background: #f5f7fa; color: #303133;,保留font-weight: 600, 选择器改为:deep(.el-table__header th .cell)。
弹窗 / 独立表单页底栏「保存+提交+返回」按钮统一风格
问题: 主人截图 business/project-apply/form?mode=add 页面底部 [保存][提交][返回] 三个按钮,
- 保存 + 提交 都是
type="primary"蓝实心,视觉层级无区分。 - 排序「主→主→次」,主操作不靠右,与全站其它页面(business-crud-page 等)已用的「次→中→主」不一致。
修复: 统一定 3 档层级 + 「次→中→主」排序。
| 语义 | 写法 |
|---|---|
| 次要(返回/取消) | 默认(无 type)灰描边 |
| 中间步骤(保存草稿) | type="primary" plain 蓝描边 |
| 主操作(提交) | type="primary" 蓝实心 |
排序模板:[可选辅助(如同步)][返回/取消][保存草稿][提交],主操作永远最右。
改动文件:
business/project-apply.vue:617-651— 主 footer + 变更 footer 都重排,保存加 plain。payment/invoice-receipt-form.vue:242-252— 保存加 plain,返回挪到保存前面。payment/invoice-application-form.vue:419-429— 同上。
未改动(已合规):
settlement/components/pre-settlement-editor.vue— 默认已是「默认保存 + primary 提交」。settlement/components/transport-reconciliation-editor.vue— 两个 plain 中间步骤 + 完成对账 实心,层级清晰。
沉淀: MEMORY.md 新增「弹窗 / 独立表单页底栏按钮统一规则」一节,作为新页面 footer 写法标准。
customer-archive 全部 footer 同步按新增项目模块标准对齐
问题: 主人指出客户档案页面 /vehicle/customer-archive/form?name=新增客商档案 没有按统一规则调整,
并明确要求「浮动页面底部、按钮区域靠右对齐,返回在第一个,中间的用浅蓝色,最后一个是 primary 深蓝色」,
参考新增项目模块 /business/project-apply/form?mode=add。
customer-archive.vue 共 5 处 footer 改动
archive-form__footer(802-809) 原状「取消/返回 + 保存 primary + 提交 success 绿」混合 4 按钮。改为[返回/取消/关闭] + 保存 plain + 提交 primary,并删掉「success 绿」换成 primary 深蓝。contact-dialog(867-870) 原状[保存 primary][返回],容器居中。改为[返回][保存 plain],容器 flex-end。receipt-dialog(965-969) 同上模式。invoice-dialog(1085-1089) 同上模式。score-detail-dialog(1343-1359) 原状 total 左 +[保存 primary][复评确认 primary][返回]。改为 total 左 +[返回][保存 plain][复评确认 primary]。
customer-archive.vue SCSS 同步
.contact-dialog__footer-actionsjustify-content: center改flex-end。.receipt-dialog__footer-actions同上。.invoice-dialog__footer-actions同上。.archive-form__footer维持 flex-end 不变(独立页.archive-page-form &下position: fixed浮动底部已经写好)。
顺序小结(标准模板)
<div class="xxx-dialog__footer-actions">
<!-- 最左:信息聚合(如总分合计、统计)用 flex:1 自己推 -->
<!-- 次要:默认描边灰按钮 -->
<el-button @click="close">返回</el-button>
<!-- 中间:浅蓝实心 plain -->
<el-button type="primary" plain @click="saveDraft">保存</el-button>
<!-- 主操作:蓝实心 -->
<el-button type="primary" @click="submit">提交</el-button>
</div>
左→右阅读顺序:辅助信息聚合 → 次要 → 中间步骤 → 主操作。视觉权重递增,颜色从「灰 → 蓝描边 → 蓝实心」。
全站 disabled 输入框文字颜色统一
问题: 客户档案编辑页等「不可编辑」状态下,el-input / el-textarea / el-input-number 的文字颜色
在不同电脑显示不一致(有的深、有的浅)。
根因: Element Plus 默认 disabled 文字色由 --el-disabled-text-color 控制,不同主题/浏览器/变量覆盖下可能表现为 #374151 / #606266 / #a8abb2 / #909399 等。
修复: src/styles/element-ui.scss 在表头颜色统一规则后追加:
.el-input.is-disabled .el-input__inner,
.el-textarea.is-disabled .el-textarea__inner,
.el-input-number.is-disabled .el-input__inner {
color: #a8abb2;
}
直接写死为 #a8abb2,覆盖 Element Plus 默认 CSS 变量及主题差异,保证全站一致。
如需再深,可把 #a8abb2 改为 #606266。