|
@@ -95,7 +95,11 @@ export default {
|
|
|
created() {
|
|
|
getCompanyListByCorId(this.corpId).then(response => {
|
|
|
this.companyList = response.data.filter(item => item.dictValue !== this.companyId)
|
|
|
- this.handleQuery()
|
|
|
+ if (!Array.isArray(this.companyList) || this.companyList.length === 0) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.queryParams.companyId = this.companyList[0].dictValue;
|
|
|
+ this.handleQuery();
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
@@ -117,15 +121,18 @@ export default {
|
|
|
handleQuery() {
|
|
|
this.queryParams.pageNum = 1;
|
|
|
this.queryParams.corpId = this.corpId;
|
|
|
- if (!this.companyList) {
|
|
|
+ if (!Array.isArray(this.companyList) || this.companyList.length === 0) {
|
|
|
return
|
|
|
}
|
|
|
- this.queryParams.companyId = this.companyList[0].dictValue;
|
|
|
this.getList();
|
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
this.resetForm("queryForm");
|
|
|
+ if (!Array.isArray(this.companyList) || this.companyList.length === 0) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.queryParams.companyId = this.companyList[0].dictValue;
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
// 选中数据
|