|
|
@@ -383,34 +383,59 @@
|
|
|
pageNum: page,
|
|
|
size: limit
|
|
|
});
|
|
|
- if (data?.length > 0) {
|
|
|
- this.tableData = data[0];
|
|
|
- const isCreateBom = sessionStorage.getItem('isCreateBom');
|
|
|
- if (
|
|
|
- (this.attributeData.approvalStatus == 0 ||
|
|
|
- this.attributeData.approvalStatus == 3) &&
|
|
|
- (Object.keys(this.tableData.processRoute).length == 0 ||
|
|
|
- this.tableData.processRoute.list.length == 0) &&
|
|
|
- isCreateBom == '2' &&
|
|
|
- !this.isWt &&
|
|
|
- this.isCategory
|
|
|
- ) {
|
|
|
- if (this.tableData.routingIdList.length != 0) {
|
|
|
- // this.selected(this.tableData.routingIdList);
|
|
|
- this.getAllRouteList();
|
|
|
- }
|
|
|
+ const record = data[0];
|
|
|
+ record.processRoute = record.processRoute || {};
|
|
|
+ record.processRoute.list = Array.isArray(record.processRoute.list)
|
|
|
+ ? record.processRoute.list
|
|
|
+ : [];
|
|
|
+
|
|
|
+ this.tableData = record;
|
|
|
+
|
|
|
+ const isCreateBom = sessionStorage.getItem('isCreateBom');
|
|
|
+
|
|
|
+ if (
|
|
|
+ (this.attributeData.approvalStatus == 0 ||
|
|
|
+ this.attributeData.approvalStatus == 3) &&
|
|
|
+ record.processRoute.list.length === 0 &&
|
|
|
+ isCreateBom == '2' &&
|
|
|
+ !this.isWt &&
|
|
|
+ this.isCategory
|
|
|
+ ) {
|
|
|
+ if (record.routingIdList && record.routingIdList.length) {
|
|
|
+ this.getAllRouteList();
|
|
|
}
|
|
|
- // console.log(this.tableData, 'tableData');
|
|
|
- // console.log(data[0].processRoute.list, 'data[0].processRoute.list');
|
|
|
- data[0].processRoute.list.forEach((item) => {
|
|
|
- item.fileParam = item.fileParam ? item.fileParam : [];
|
|
|
- });
|
|
|
-
|
|
|
- return data[0].processRoute.list || [];
|
|
|
- } else {
|
|
|
- this.tableData = {};
|
|
|
- return [];
|
|
|
}
|
|
|
+
|
|
|
+ record.processRoute.list.forEach((item) => {
|
|
|
+ item.fileParam = item.fileParam || [];
|
|
|
+ });
|
|
|
+
|
|
|
+ return record.processRoute.list;
|
|
|
+ // if (data?.length > 0) {
|
|
|
+ // this.tableData = data[0];
|
|
|
+ // const isCreateBom = sessionStorage.getItem('isCreateBom');
|
|
|
+ // if (
|
|
|
+ // (this.attributeData.approvalStatus == 0 ||
|
|
|
+ // this.attributeData.approvalStatus == 3) &&
|
|
|
+ // (Object.keys(this.tableData.processRoute).length == 0 ||
|
|
|
+ // this.tableData.processRoute.list.length == 0) &&
|
|
|
+ // isCreateBom == '2' &&
|
|
|
+ // !this.isWt &&
|
|
|
+ // this.isCategory
|
|
|
+ // ) {
|
|
|
+ // if (this.tableData.routingIdList.length != 0) {
|
|
|
+ // this.getAllRouteList();
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // data[0].processRoute.list.forEach((item) => {
|
|
|
+ // item.fileParam = item.fileParam ? item.fileParam : [];
|
|
|
+ // });
|
|
|
+
|
|
|
+ // return data[0].processRoute.list || [];
|
|
|
+ // } else {
|
|
|
+ // this.tableData = {};
|
|
|
+ // return [];
|
|
|
+ // }
|
|
|
},
|
|
|
|
|
|
fileBtn(item, index) {
|