|
@@ -19,6 +19,7 @@ import { messageShared } from '@shared/utils/message';
|
|
|
import { I18NService } from '@core';
|
|
|
import { BasedataMaterialFileProductAddComponent } from './product-add/product-add.component';
|
|
|
import { BaseMaterialFileProduct } from 'app/entity/basedata/base-material-file-product';
|
|
|
+import { BasedataMaterialFileDetailsComponent } from './details/details.component';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'app-basedata-material-file',
|
|
@@ -35,10 +36,13 @@ export class BasedataMaterialFileComponent implements OnInit {
|
|
|
materialNodes: any; //物料分类 数据
|
|
|
materialId = ''; //物料分类 id
|
|
|
|
|
|
- page: Page; //分页对象
|
|
|
+ //分页对象
|
|
|
+ page = {
|
|
|
+ total: 0,
|
|
|
+ current: 0,
|
|
|
+ };
|
|
|
|
|
|
proTable = []; //产品数据
|
|
|
-
|
|
|
clickProId = ''; //点击产品id
|
|
|
|
|
|
constructor(
|
|
@@ -52,11 +56,6 @@ export class BasedataMaterialFileComponent implements OnInit {
|
|
|
) {}
|
|
|
|
|
|
ngOnInit() {
|
|
|
- // 修改初始化的信息
|
|
|
- this.page = {
|
|
|
- pageNo: 1, //当前页码
|
|
|
- pageSize: 6, //当前页显示的条数
|
|
|
- };
|
|
|
this.getMaterialTree(); //物料分类树
|
|
|
this.getProductList(); // 产品数据
|
|
|
}
|
|
@@ -76,13 +75,14 @@ export class BasedataMaterialFileComponent implements OnInit {
|
|
|
|
|
|
//查询产品 列表
|
|
|
getProductList() {
|
|
|
+ this.isSpinning = true;
|
|
|
return new Promise(resolve => {
|
|
|
- var page = new Page();
|
|
|
- page.pageSize = 500;
|
|
|
- this.baseMaterialFileProduct.pkOrg = sessionStorage.getItem('pkOrg'); //组织
|
|
|
+ this.baseMaterialFileProduct.pkOrg = sessionStorage.getItem('pkOrg');
|
|
|
// 根据页面绑定的查询条件进行查询
|
|
|
this.baseMaterialFileProductService.list(this.baseMaterialFileProduct).then(res => {
|
|
|
+ this.page = res.result;
|
|
|
this.proTable = res.result.records;
|
|
|
+ this.isSpinning = false;
|
|
|
console.log('产品列表(无模块)', this.proTable);
|
|
|
resolve();
|
|
|
});
|
|
@@ -160,7 +160,7 @@ export class BasedataMaterialFileComponent implements OnInit {
|
|
|
nzWidth: 1200,
|
|
|
nzContent: BasedataMaterialFileProductAddComponent,
|
|
|
nzContentParams: {
|
|
|
- id: id, //页面点击的产品ID 传参给抽屉
|
|
|
+ id: id, //页面点击的产品ID 传参给抽屉
|
|
|
materialId: this.materialId, //物料分类id (给抽屉的回显树)
|
|
|
},
|
|
|
});
|
|
@@ -168,7 +168,8 @@ export class BasedataMaterialFileComponent implements OnInit {
|
|
|
drawerAddPro.afterClose.subscribe(clo => {
|
|
|
//不成功时 清空 物料分类ID
|
|
|
this.materialId = '';
|
|
|
- if (clo) { //成功
|
|
|
+ if (clo) {
|
|
|
+ //成功
|
|
|
//判断是否刷新树列表数据
|
|
|
this.getMaterialTree();
|
|
|
this.getProductList();
|
|
@@ -185,7 +186,7 @@ export class BasedataMaterialFileComponent implements OnInit {
|
|
|
|
|
|
//按页码查询
|
|
|
pageIndexChange(event) {
|
|
|
- console.log('当前页码', event);
|
|
|
+ // console.log('当前页码', event);
|
|
|
this.baseMaterialFileProduct.pageNo = event;
|
|
|
this.getProductList();
|
|
|
}
|
|
@@ -229,6 +230,18 @@ export class BasedataMaterialFileComponent implements OnInit {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ //产品详情
|
|
|
+ detailProduct(id) {
|
|
|
+ this.drawerService.create({
|
|
|
+ nzTitle: this.i18NService.fanyi('product.details'),
|
|
|
+ nzWidth: 800,
|
|
|
+ nzContent: BasedataMaterialFileDetailsComponent,
|
|
|
+ nzContentParams: {
|
|
|
+ id: id,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
//删除产品
|
|
|
delPro(id) {
|
|
|
this.baseMaterialFileProduct.pkOrg = sessionStorage.getItem('pkOrg'); //组织
|