|
@@ -209,14 +209,17 @@
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
handleClick() {
|
|
handleClick() {
|
|
|
- this.form.directoryId = '';
|
|
|
|
|
- this.form.businessCodeId = '';
|
|
|
|
|
- this.form.codeType = '';
|
|
|
|
|
if (this.activeName == 2) {
|
|
if (this.activeName == 2) {
|
|
|
this.folderList = this.myFolderList;
|
|
this.folderList = this.myFolderList;
|
|
|
} else {
|
|
} else {
|
|
|
this.folderList = this.allFolderList;
|
|
this.folderList = this.allFolderList;
|
|
|
}
|
|
}
|
|
|
|
|
+ // 切换 tab 时使用新 tab 的默认值(文档位置 / 编码分类 / 编码方案)联动更新
|
|
|
|
|
+ // 其他字段(type / 备注 / 已上传文件等)保留不动
|
|
|
|
|
+ if (this.folderList && this.folderList.length > 0) {
|
|
|
|
|
+ this.form.directoryId = this.folderList[0].id;
|
|
|
|
|
+ this.initFileCode();
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
async getTreeCode() {
|
|
async getTreeCode() {
|
|
|
let nodeData = {};
|
|
let nodeData = {};
|
|
@@ -242,10 +245,22 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
async open() {
|
|
async open() {
|
|
|
|
|
+ // 每次重新打开都回到"文档工作区"标签
|
|
|
|
|
+ this.activeName = '1';
|
|
|
|
|
+ this.folderList = this.allFolderList;
|
|
|
this.showEditFlag = true;
|
|
this.showEditFlag = true;
|
|
|
this.$nextTick(async () => {
|
|
this.$nextTick(async () => {
|
|
|
this.list = await selectTreeList();
|
|
this.list = await selectTreeList();
|
|
|
|
|
+ // 强制使用 文档工作区 的默认值(避免 cancel() 保留的旧 directoryId 导致默认值缺失)
|
|
|
|
|
+ if (this.folderList && this.folderList.length > 0) {
|
|
|
|
|
+ this.form.directoryId = this.folderList[0].id;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 触发 initFileCode,根据选中的文档位置默认填充 编码分类 / 编码方案
|
|
|
await this.initFileCode();
|
|
await this.initFileCode();
|
|
|
|
|
+ // 文档类型默认值
|
|
|
|
|
+ if (!this.form.type) {
|
|
|
|
|
+ this.form.type = '1';
|
|
|
|
|
+ }
|
|
|
this.setTree(this.list);
|
|
this.setTree(this.list);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|