🐛 修复常用货物组织筛选,并调整列表字段与常用地址行政区划禁用

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-27 23:39:38 +08:00
parent b92625528c
commit b5043575e4
3 changed files with 169 additions and 144 deletions
+1 -1
View File
@@ -182,8 +182,8 @@
<el-input
v-model="form.regionName"
readonly
disabled
placeholder="行政区划自动带出"
:disabled="dialogReadonly"
/>
<el-input
v-model="form.detailAddress"
+25 -4
View File
@@ -260,6 +260,7 @@ export default {
},
},
created() {
this.applyDefaultDeptSearch();
this.initDeptTree();
this.loadPriceUnitOptions();
},
@@ -273,6 +274,21 @@ export default {
if (Array.isArray(data)) return data;
return (data && data.records) || [];
},
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;
}
});
},
initDeptTree() {
getDeptTree(this.userInfo.tenantId).then(res => {
this.deptOptions = this.flattenDept(res.data.data || []);
@@ -485,7 +501,7 @@ export default {
return false;
}
if (row.cargoValue && !/^\d+(\.\d{1,2})?$/.test(String(row.cargoValue))) {
this.$message.warning('货值只能输入数字,最多保留2位小数');
this.$message.warning('单价只能输入数字,最多保留2位小数');
return false;
}
if (!row.model) {
@@ -619,8 +635,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;
@@ -649,7 +666,11 @@ export default {
onLoad(page, params = {}) {
this.loading = true;
api
.getList(page.currentPage, page.pageSize, { ...params, ...this.query, allDept: 0 })
.getList(page.currentPage, page.pageSize, {
...params,
...this.query,
allDept: this.isAdmin ? 1 : 0,
})
.then(res => {
const result = res.data.data;
this.page.total = result.total;
@@ -663,7 +684,7 @@ export default {
buildExportParams() {
return {
...this.query,
allDept: 0,
allDept: this.isAdmin ? 1 : 0,
ids: this.ids,
[this.website.tokenHeader]: getToken(),
};