|
|
@ -55,9 +55,10 @@ export class PriceListComponent implements OnInit { |
|
|
|
type: [null, [Validators.required]], |
|
|
|
type: [null, [Validators.required]], |
|
|
|
price: [null, [Validators.required]], |
|
|
|
price: [null, [Validators.required]], |
|
|
|
realPrice: [{value: null, disabled: true}, [Validators.required]], |
|
|
|
realPrice: [{value: null, disabled: true}, [Validators.required]], |
|
|
|
goodsId: [null, [Validators.required]], |
|
|
|
// goodsId: [null, [Validators.required]],
|
|
|
|
discount: [null, [Validators.required]], |
|
|
|
discount: [null, [Validators.required]], |
|
|
|
channel: [null, [Validators.required]], |
|
|
|
sort: [null, [Validators.required]], |
|
|
|
|
|
|
|
// channel: [null, [Validators.required]],
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -124,7 +125,7 @@ export class PriceListComponent implements OnInit { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.validateForm.value.realPrice = this.realPrice; |
|
|
|
this.validateForm.value.realPrice = this.validateForm.value.price * this.validateForm.value.discount / 100; |
|
|
|
if (this.edit) { |
|
|
|
if (this.edit) { |
|
|
|
this.validateForm.value['id'] = this.id; |
|
|
|
this.validateForm.value['id'] = this.id; |
|
|
|
this.recharge.updatePrice(this.validateForm.value, data => { |
|
|
|
this.recharge.updatePrice(this.validateForm.value, data => { |
|
|
@ -157,14 +158,32 @@ export class PriceListComponent implements OnInit { |
|
|
|
handleCancelGoods(): void { |
|
|
|
handleCancelGoods(): void { |
|
|
|
this.isVisibleGoods = false; |
|
|
|
this.isVisibleGoods = false; |
|
|
|
} |
|
|
|
} |
|
|
|
public getForbiddenUser(id): void { |
|
|
|
public getForbiddenUser(id, status: any): void { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const message = (status === 1 ? '是否禁用' : '是否启用'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.common.showConfirm(message, data => { |
|
|
|
|
|
|
|
if (data) { |
|
|
|
|
|
|
|
this.recharge.onAndOffShelves(id, dataUser => { |
|
|
|
|
|
|
|
if (dataUser['return_code'] === '000000') { |
|
|
|
|
|
|
|
this.message.success('操作成功'); |
|
|
|
|
|
|
|
this.getRequest(false , this.searchForm.value); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.message.error(dataUser['return_msg']); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public getForbiddenUserD(id): void { |
|
|
|
|
|
|
|
|
|
|
|
this.common.showConfirm('是否删除', item => { |
|
|
|
this.common.showConfirm('是否删除', item => { |
|
|
|
if (item) { |
|
|
|
if (item) { |
|
|
|
this.recharge.deletePrice(id, data => { |
|
|
|
this.recharge.deletePrice(id, data => { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
if (data['return_code'] === '000000') { |
|
|
|
this.getRequest(false, this.searchForm.value); |
|
|
|
|
|
|
|
this.message.success('删除成功'); |
|
|
|
this.message.success('删除成功'); |
|
|
|
|
|
|
|
this.getRequest(false, this.searchForm.value); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.message.error(data['return_msg']); |
|
|
|
this.message.error(data['return_msg']); |
|
|
|
} |
|
|
|
} |
|
|
@ -176,7 +195,6 @@ export class PriceListComponent implements OnInit { |
|
|
|
public getMemberGoods(): void { |
|
|
|
public getMemberGoods(): void { |
|
|
|
this.isVisibleGoods = true; |
|
|
|
this.isVisibleGoods = true; |
|
|
|
this.recharge.getMemberGoods(data => { |
|
|
|
this.recharge.getMemberGoods(data => { |
|
|
|
console.log(data); |
|
|
|
|
|
|
|
this.goodsArray = data['return_data']['data']; |
|
|
|
this.goodsArray = data['return_data']['data']; |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -185,4 +203,6 @@ export class PriceListComponent implements OnInit { |
|
|
|
this.realPrice = this.validateForm.value.price * this.validateForm.value.discount / 100; |
|
|
|
this.realPrice = this.validateForm.value.price * this.validateForm.value.discount / 100; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|