diff --git a/src/views/equiptManagement/workwearManagement/columnData.js b/src/views/equiptManagement/workwearManagement/columnData.js
index 605ca21..2fcd74c 100644
--- a/src/views/equiptManagement/workwearManagement/columnData.js
+++ b/src/views/equiptManagement/workwearManagement/columnData.js
@@ -108,8 +108,8 @@ export const feiBaOption = {
selection: true,
viewBtn: false,
delBtn: false,
- labelWidth: 120,
- searchLabelWidth: 120,
+ labelWidth: 80,
+ searchLabelWidth: 80,
menuWidth: 80,
menuAlign:"center",
dialogWidth: 600,
@@ -123,7 +123,7 @@ export const feiBaOption = {
searchLabelPosition: "left",
searchGutter: 24,
searchSpan: 6,
- menuAlign: "left",
+ menuAlign: "center",
gridBtn: false,
searchMenuPosition: "right",
addBtnIcon: " ",
@@ -191,8 +191,8 @@ export const rackOption = {
selection: true,
viewBtn: false,
delBtn: false,
- labelWidth: 120,
- searchLabelWidth: 120,
+ labelWidth: 80,
+ searchLabelWidth: 80,
menuWidth: 80,
menuAlign:"center",
dialogWidth: 600,
@@ -206,7 +206,7 @@ export const rackOption = {
searchLabelPosition: "left",
searchGutter: 24,
searchSpan: 6,
- menuAlign: "left",
+ menuAlign: "center",
gridBtn: false,
searchMenuPosition: "right",
addBtnIcon: " ",
diff --git a/src/views/oem/oemCustomer/index.vue b/src/views/oem/oemCustomer/index.vue
index 9f3d80b..9de1292 100644
--- a/src/views/oem/oemCustomer/index.vue
+++ b/src/views/oem/oemCustomer/index.vue
@@ -160,7 +160,6 @@ export default {
sortable: true,
search: true,
overHidden: true,
- width: 120,
rules: [
{
required: true,
@@ -176,7 +175,6 @@ export default {
search: false,
overHidden: true,
hide: true,
- width: 120,
rules: [
{
required: true,
@@ -191,7 +189,6 @@ export default {
sortable: true,
search: false,
overHidden: true,
- width: 260,
rules: [
{
required: true,
diff --git a/src/views/processManagement/platingTypeInfo.vue b/src/views/processManagement/platingTypeInfo.vue
index 627a139..a02caba 100644
--- a/src/views/processManagement/platingTypeInfo.vue
+++ b/src/views/processManagement/platingTypeInfo.vue
@@ -17,6 +17,7 @@
@on-load="onLoad"
@row-save="rowSave"
@row-update="rowUpdate"
+ :before-open="beforeOpen"
>
@@ -25,7 +26,24 @@
导入
-
+
+ {{ row.bcName }}
+
+
+
+
+
+
+
+
{{ scope.row.bsBasicClass ? scope.row.bsBasicClass.name : '-' }}
@@ -75,6 +93,7 @@ import {
getQueryAllCaDel,
} from '@/api/processManagement/processCapability';
import { getDictionary } from '@/api/system/dict';
+import { getList } from '@/api/basicData/platingAssort';
import basicImport from '@/components/basic-import/main.vue';
export default {
components: {
@@ -93,6 +112,7 @@ export default {
currentPage: 1,
total: 0,
},
+ bcIdData: [],
formOption: {
menuSpan: 12,
enter: true,
@@ -173,13 +193,13 @@ export default {
filterable: true,
remote: true,
props: {
- label: "name",
- value: "id",
- desc:"code",
- res:"data.records"
+ label: 'name',
+ value: 'id',
+ desc: 'code',
+ res: 'data.records',
},
- dicUrl: '/api/blade-desk/BA/BasicClazz/list?current=1&size=9999&descs=CODE&name={{key}}',
- // dicUrl: "/blade-desk/BA/BasicClazz/listForSelectPlatingAssort",
+ dicUrl:
+ '/api/blade-desk/BA/BasicClazz/list?current=1&size=9999&descs=CODE&name={{key}}',
rules: [
{
required: true,
@@ -483,12 +503,35 @@ export default {
this.$refs.crud.toggleSelection();
},
// 打开弹框 前操作 打开表单前会执行beforeOpen方法
- beforeOpen(done, type) {
- if (['add'].includes(type)) {
- this.form.flagCycleTest = 0;
- }
- if (['edit', 'view'].includes(type)) {
- this.form.bcId = this.form.bcId + '';
+ async beforeOpen(done, type, loading) {
+ try {
+ // 1. 拉取镀种分类全量数据
+ await this.remoteMethod('');
+ // 2. 新增默认值
+ if (['add'].includes(type)) {
+ this.form.flagCycleTest = 0;
+ }
+ // 3. 编辑 / 查看时:自动补全 bcId 到下拉数组(解决500条以外不显示)
+ if (['edit', 'view'].includes(type)) {
+ const currentId = (this.form.bcId || '').toString().trim();
+ const currentName = this.form.bcName || '-'; // 你后台返回的名称
+ // 判断:如果id不在数组里,就插入到第一个
+ if (currentId) {
+ const hasItem = this.bcIdData.some(item => item.id == currentId);
+ console.log('hasItem =', hasItem);
+ if (!hasItem) {
+ // 插入到数组最前面
+ this.bcIdData.unshift({
+ id: currentId,
+ name: currentName,
+ });
+ }
+ }
+ // 转字符串保证选中
+ this.form.bcId = currentId;
+ }
+ } catch (err) {
+ console.error('加载镀种分类失败', err);
}
done();
},
@@ -512,22 +555,48 @@ export default {
refreshChange() {
this.onLoad(this.page, this.query);
},
+ async remoteMethod(query) {
+ const res = await getList({ current: 1, size: 9999, descs: 'CODE',name:query })
+ this.bcIdData = res.data.data.records || []
+ },
+ // 根据ID查询镀种分类名称 —— 异步Promise
+ getBcName(id) {
+ if (!id) return Promise.resolve('-');
+ return getList({
+ current: 1,
+ size: 1,
+ id_equal: id,
+ descs: 'CODE',
+ })
+ .then(res => {
+ return res.data?.data?.records?.[0]?.name || id;
+ })
+ .catch(() => id);
+ },
+ // 加载页面数据
// 加载页面数据
- onLoad(page, params = {}) {
+ async onLoad(page, params = {}) {
this.loading = true;
- getPlatingTypeList({
- current: this.page.currentPage,
- size: this.page.pageSize,
- ...this.query,
- }).then(res => {
- res.data.data.records.map(item => {
- item.bcId = item.bcId + '';
- item.subClass = item.subClass + '';
+ try {
+ const res = await getPlatingTypeList({
+ current: this.page.currentPage,
+ size: this.page.pageSize,
+ ...this.query,
});
- this.data = res.data.data.records;
+ let list = res.data.data.records;
+ // 批量获取 bcName —— 正确用法!
+ await Promise.all(
+ list.map(async item => {
+ item.bcId = item.bcId + '';
+ item.subClass = item.subClass + '';
+ item.bcName = await this.getBcName(item.bcId); // ✅ 等待返回
+ console.log('item.bcName =', item.bcName); // 现在一定有值
+ })
+ );
+ this.data = list;
this.page.total = res.data.data.total;
- this.loading = false;
- });
+ } catch (e) {}
+ this.loading = false;
// // getLazyList(this.parentId, Object.assign(params, this.query)).then(res => {
// // this.data = res.data.data;
@@ -1018,4 +1087,4 @@ export default {
},
},
};
-
+
\ No newline at end of file