|
@@ -39,6 +39,7 @@ export class BasedataMaterialFileProductAddComponent implements OnInit {
|
|
id: string = '';
|
|
id: string = '';
|
|
clickProObj: {};
|
|
clickProObj: {};
|
|
sort = 1;
|
|
sort = 1;
|
|
|
|
+ status = false;
|
|
|
|
|
|
formatterDollar = (value: number) => {
|
|
formatterDollar = (value: number) => {
|
|
if (value) {
|
|
if (value) {
|
|
@@ -67,7 +68,7 @@ export class BasedataMaterialFileProductAddComponent implements OnInit {
|
|
code: [null, [Validators.required]],
|
|
code: [null, [Validators.required]],
|
|
name: [null, [Validators.required]],
|
|
name: [null, [Validators.required]],
|
|
sort: ['number', [Validators.required]],
|
|
sort: ['number', [Validators.required]],
|
|
- status: [null, [Validators.required]],
|
|
+ status: [],
|
|
attribute: [null, [Validators.required]],
|
|
attribute: [null, [Validators.required]],
|
|
baseMaterialFileClassificationId: [null, [Validators.required]],
|
|
baseMaterialFileClassificationId: [null, [Validators.required]],
|
|
});
|
|
});
|
|
@@ -78,23 +79,28 @@ export class BasedataMaterialFileProductAddComponent implements OnInit {
|
|
|
|
|
|
this.baseMaterialFileProduct.id = this.id;
|
|
this.baseMaterialFileProduct.id = this.id;
|
|
|
|
|
|
- if (this.baseMaterialFileProduct.id == '') {
|
|
+ if (!this.id) {
|
|
} else {
|
|
} else {
|
|
|
|
|
|
return new Promise(resolve => {
|
|
return new Promise(resolve => {
|
|
this.baseMaterialFileProduct.pkOrg = sessionStorage.getItem('pkOrg');
|
|
this.baseMaterialFileProduct.pkOrg = sessionStorage.getItem('pkOrg');
|
|
this.baseMaterialFileProductService.queryMainAndChildById(this.baseMaterialFileProduct.id).then(res => {
|
|
this.baseMaterialFileProductService.queryMainAndChildById(this.baseMaterialFileProduct.id).then(res => {
|
|
- console.log('所有产品数据', res);
|
|
+ this.baseMaterialFileProduct = res.result;
|
|
- let clickProObj = res.result;
|
|
+ console.log('点击的产品数据', this.baseMaterialFileProduct);
|
|
- this.baseMaterialFileProduct = clickProObj;
|
|
+ if (this.baseMaterialFileProduct.status == '0') {
|
|
|
|
+ this.status = false;
|
|
|
|
+ } else {
|
|
|
|
+ this.status = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
this.baseMaterialFileProduct.status = this.baseMaterialFileProduct.status + '';
|
|
this.baseMaterialFileProduct.status = this.baseMaterialFileProduct.status + '';
|
|
- if (clickProObj.baseMaterialFileModularList) {
|
|
+ if (this.baseMaterialFileProduct.baseMaterialFileModularList) {
|
|
|
|
|
|
|
|
|
|
- this.modData = clickProObj.baseMaterialFileModularList;
|
|
+ this.modData = this.baseMaterialFileProduct.baseMaterialFileModularList;
|
|
this.sort = this.modData.length + 1;
|
|
this.sort = this.modData.length + 1;
|
|
}
|
|
}
|
|
- console.log('点击的产品对象', this.baseMaterialFileProduct.baseMaterialFileModularList);
|
|
+ console.log('模块列表', this.baseMaterialFileProduct.baseMaterialFileModularList);
|
|
});
|
|
});
|
|
resolve();
|
|
resolve();
|
|
});
|
|
});
|
|
@@ -126,6 +132,11 @@ export class BasedataMaterialFileProductAddComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
proSubForm() {
|
|
proSubForm() {
|
|
|
|
+ if (this.status) {
|
|
|
|
+ this.baseMaterialFileProduct.status = '0';
|
|
|
|
+ } else {
|
|
|
|
+ this.baseMaterialFileProduct.status = '1';
|
|
|
|
+ }
|
|
|
|
|
|
if (this.id == '') {
|
|
if (this.id == '') {
|
|
console.log('空', this.baseMaterialFileProduct);
|
|
console.log('空', this.baseMaterialFileProduct);
|
|
@@ -162,9 +173,10 @@ export class BasedataMaterialFileProductAddComponent implements OnInit {
|
|
return new Promise(resolve => {
|
|
return new Promise(resolve => {
|
|
this.baseMaterialFileProduct.pkOrg = sessionStorage.getItem('pkOrg');
|
|
this.baseMaterialFileProduct.pkOrg = sessionStorage.getItem('pkOrg');
|
|
this.baseMaterialFileProduct.baseMaterialFileModularList = this.modData;
|
|
this.baseMaterialFileProduct.baseMaterialFileModularList = this.modData;
|
|
- console.log('----->', this.baseMaterialFileProduct.baseMaterialFileModularList);
|
|
+
|
|
this.baseMaterialFileProductService.updateMainAndChild(this.baseMaterialFileProduct).then(res => {
|
|
this.baseMaterialFileProductService.updateMainAndChild(this.baseMaterialFileProduct).then(res => {
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
|
+
|
|
this.clickProObj = res.result;
|
|
this.clickProObj = res.result;
|
|
this.notification.success(this.i18NService.fanyi('successful.revision'), '');
|
|
this.notification.success(this.i18NService.fanyi('successful.revision'), '');
|
|
this.getProductList();
|
|
this.getProductList();
|