From 56729c8cc97da299aa61bc8686e27270976641b7 Mon Sep 17 00:00:00 2001
From: b2894lxlx <517289602@qq.com>
Date: Fri, 7 Aug 2026 13:36:51 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9F=BA=E7=A1=80=E6=95=B0?=
=?UTF-8?q?=E6=8D=AE=E6=A8=A1=E5=9D=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/option/base/common-address.js | 134 ++++++++++++++++++++++----
src/option/business/common-cargo.js | 22 ++---
src/views/base/common-address.vue | 20 +++-
src/views/business/common-cargo.vue | 33 ++++---
src/views/business/common-route.vue | 16 ++-
src/views/business/process-config.vue | 19 +++-
6 files changed, 194 insertions(+), 50 deletions(-)
diff --git a/src/option/base/common-address.js b/src/option/base/common-address.js
index bbf6df1..a44a275 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: '组织',
@@ -214,8 +206,6 @@ export const createOption = () => ({
{
label: '站点编码',
prop: 'siteCode',
- search: true,
- searchOrder: 6,
hide: true,
addDisplay: false,
editDisplay: false,
@@ -224,11 +214,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/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 @@
+ >
+
+ {{ getCargoCodePrefix() }}
+
+
@@ -143,10 +147,6 @@
-
- {{ [row.packageType, row.brand].filter(Boolean).join(' / ') || '-' }}
-
-
{
+ if (this.$refs.crud?.searchForm) {
+ this.$refs.crud.searchForm.searchDeptId = deptId;
+ }
+ });
+ },
resetAddressQuery() {
this.addressQuery = {
addressName: '',
@@ -883,8 +896,9 @@ export default {
},
searchReset() {
this.query = {};
+ this.applyDefaultDeptSearch();
this.page.currentPage = 1;
- this.onLoad(this.page);
+ this.onLoad(this.page, this.query);
},
searchChange(params, done) {
this.query = params;
diff --git a/src/views/business/process-config.vue b/src/views/business/process-config.vue
index c233f51..69676b2 100644
--- a/src/views/business/process-config.vue
+++ b/src/views/business/process-config.vue
@@ -527,6 +527,7 @@ export default {
created() {
this.resetNodeRows();
this.loadProjectOptions('');
+ this.applyDefaultDeptSearch();
this.initDeptOptions();
},
methods: {
@@ -545,6 +546,21 @@ export default {
}
});
},
+ defaultDeptId() {
+ return (this.userInfo && (this.userInfo.deptId || this.userInfo.dept_id)) || '';
+ },
+ applyDefaultDeptSearch() {
+ const deptId = this.defaultDeptId();
+ const deptColumn = this.findColumn(this.option.column, 'searchDeptId');
+ if (!deptId || !deptColumn) return;
+ deptColumn.searchValue = deptId;
+ this.query = { ...this.query, deptId };
+ this.$nextTick(() => {
+ if (this.$refs.crud?.searchForm) {
+ this.$refs.crud.searchForm.searchDeptId = deptId;
+ }
+ });
+ },
flattenDept(tree, level = 0) {
return tree.flatMap(item => [
{
@@ -953,8 +969,9 @@ export default {
},
searchReset() {
this.query = {};
+ this.applyDefaultDeptSearch();
this.page.currentPage = 1;
- this.onLoad(this.page);
+ this.onLoad(this.page, this.query);
},
searchChange(params, done) {
this.query = params;