|
@@ -50,6 +50,7 @@ export class OrderDetailService extends BaseService<modelType> {
|
|
|
val.spec_file = res.file[0];
|
|
|
res = await this.userModel.findById(val.user).lean();
|
|
|
val.user_name = res.name;
|
|
|
+ val.user_role = res.role;
|
|
|
res = await this.userModel.findById(val.supplier).lean();
|
|
|
val.supplier_name = res.name;
|
|
|
}
|
|
@@ -62,14 +63,33 @@ export class OrderDetailService extends BaseService<modelType> {
|
|
|
const info: any = {};
|
|
|
arr = await this.goodModel.findById(res.good).lean();
|
|
|
info.good_name = arr.name;
|
|
|
- info.good_file = info.file[0];
|
|
|
+ info.good_type = arr.type;
|
|
|
+ info.good_file = arr.file;
|
|
|
arr = await this.specModel.findById(res.spec).lean();
|
|
|
info.spec_name = arr.name;
|
|
|
- info.spec_file = arr.file[0];
|
|
|
+ info.spec_file = arr.file;
|
|
|
arr = await this.userModel.findById(res.user).lean();
|
|
|
info.user_name = arr.name;
|
|
|
+ info.user_tel = arr.tel;
|
|
|
+ info.user_role = arr.role;
|
|
|
arr = await this.userModel.findById(res.supplier).lean();
|
|
|
info.supplier_name = arr.name;
|
|
|
+ if (res.leader && res.leader.length > 0) {
|
|
|
+ const leader = [];
|
|
|
+ for (const val of res.leader) {
|
|
|
+ arr = await this.userModel.findById(val).lean();
|
|
|
+ leader.push(arr.name);
|
|
|
+ }
|
|
|
+ info.leader_name = leader.toString();
|
|
|
+ }
|
|
|
+ if (res.accounting && res.accounting.length > 0) {
|
|
|
+ const accounting = [];
|
|
|
+ for (const val of res.accounting) {
|
|
|
+ arr = await this.userModel.findById(val).lean();
|
|
|
+ accounting.push(arr.name);
|
|
|
+ }
|
|
|
+ info.accounting_name = accounting.toString();
|
|
|
+ }
|
|
|
const result = _.assign(info, res);
|
|
|
return result;
|
|
|
}
|