|
@@ -1271,14 +1271,16 @@
|
|
|
console.log('res=====', res);
|
|
console.log('res=====', res);
|
|
|
const info = JSON.parse(localStorage.getItem('info'));
|
|
const info = JSON.parse(localStorage.getItem('info'));
|
|
|
console.log('info=====', info);
|
|
console.log('info=====', info);
|
|
|
- let obj = res.find(
|
|
|
|
|
- (item) => item.id === info.deptId[info.deptId.length - 1]
|
|
|
|
|
- );
|
|
|
|
|
- console.log('obj=====', obj);
|
|
|
|
|
- this.formData.extInfo.deptName = obj?.name;
|
|
|
|
|
- this.formData.extInfo.deptCode = obj?.id;
|
|
|
|
|
- this.formData.extInfo.createUserName = info.name;
|
|
|
|
|
- this.formData.createUserId = info.userId;
|
|
|
|
|
|
|
+ if (info && info.deptId?.length > 0) {
|
|
|
|
|
+ let obj = res.find(
|
|
|
|
|
+ (item) => item.id === info.deptId[info.deptId.length - 1]
|
|
|
|
|
+ );
|
|
|
|
|
+ console.log('obj=====', obj);
|
|
|
|
|
+ this.formData.extInfo.deptName = obj?.name;
|
|
|
|
|
+ this.formData.extInfo.deptCode = obj?.id;
|
|
|
|
|
+ this.formData.extInfo.createUserName = info.name;
|
|
|
|
|
+ this.formData.createUserId = info.userId;
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
addStock() {
|
|
addStock() {
|
|
|
// this.title = this.formData.extInfo.assetTypeName;
|
|
// this.title = this.formData.extInfo.assetTypeName;
|