胡锐 1 year ago
commit 600c9592ba
  1. 9544
      package-lock.json
  2. 85
      src/app/admin/agent/agent-list/agent-list.component.html
  3. 102
      src/app/admin/agent/agent-list/agent-list.component.ts
  4. 16
      src/app/admin/config-manage/brand/brand.component.html
  5. 3
      src/app/admin/config-manage/brand/brand.component.ts
  6. 2
      src/app/admin/goods/list/list.component.html
  7. 2
      src/app/admin/goods/list/list.component.ts
  8. 34
      src/app/services/agent.service.ts
  9. 8
      src/environments/environment.ts

9544
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -109,9 +109,11 @@
<nz-dropdown-menu #menu="nzDropdownMenu"> <nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable> <ul nz-menu nzSelectable>
<li class="li-a" nz-menu-item><a (click)="getDistribution(data.id)">分发卡券</a></li> <li class="li-a" nz-menu-item><a (click)="getDistribution(data.id)">分发卡券</a></li>
<li class="li-a" nz-menu-item><a (click)="getDistributeCoupons(data.id)">分发优惠券包</a></li>
<li class="li-a" nz-menu-item><a (click)="generateAgentQrCode(data.id)">生成二维码</a></li> <li class="li-a" nz-menu-item><a (click)="generateAgentQrCode(data.id)">生成二维码</a></li>
<li class="li-a" nz-menu-item><a (click)="getDiscount(data.id)">绑定优惠券</a></li> <li class="li-a" nz-menu-item><a (click)="getDiscount(data.id)">绑定优惠券</a></li>
<li class="li-a" nz-menu-item><a (click)="getDiscountList(data.id)">优惠券列表</a></li> <li class="li-a" nz-menu-item><a (click)="getDiscountList(data.id)">优惠券列表</a></li>
<li class="li-a" nz-menu-item><a (click)="getDistributeCouponsList(data.id)">优惠券包分发列表</a></li>
<li class="li-a" nz-menu-item><a [routerLink]="['/admin/order-manage/discount-use-condition-list']" [queryParams]="{agentId: data.id}">优惠券使用</a></li> <li class="li-a" nz-menu-item><a [routerLink]="['/admin/order-manage/discount-use-condition-list']" [queryParams]="{agentId: data.id}">优惠券使用</a></li>
<li class="li-a" nz-menu-item><a (click)="getDistributionList(data.id)">分发列表</a></li> <li class="li-a" nz-menu-item><a (click)="getDistributionList(data.id)">分发列表</a></li>
<li class="li-a" nz-menu-item><a (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 1 ? '禁用': '启用'}}</a></li> <li class="li-a" nz-menu-item><a (click)='getForbiddenUser(data.id , data.status)'>{{data.status === 1 ? '禁用': '启用'}}</a></li>
@ -231,6 +233,29 @@
</nz-spin> </nz-spin>
</nz-modal> </nz-modal>
<nz-modal [(nzVisible)]="isVisibleDistributeCoupons" nzTitle="分发优惠券" (nzOnCancel)="isVisibleDistributeCoupons=false" [nzOkLoading]="isOkCouponsLoading" (nzOnOk)="addDisCoupon()">
<nz-spin [nzSpinning]="isSpinningDistributeCoupons">
<form nz-form [formGroup]="validateFormDiscountPackage" class="login-form">
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>优惠券包</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="请选择优惠券包!">
<nz-select nzShowSearch nzAllowClear formControlName="discountPackageId" nzPlaceHolder="请选择优惠券包">
<nz-option *ngFor="let item of discountPackageList" nzLabel="【{{item['title']}}】"
nzValue="{{item.id}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired>数量</nz-form-label>
<nz-form-control [nzSpan]="16" nzErrorTip="分发数量不能小于1!">
<input [type]="'number'" nz-input formControlName="num" nzPlaceHolder="请填写分发数量" />
</nz-form-control>
</nz-form-item>
</form>
</nz-spin>
</nz-modal>
<nz-modal [(nzVisible)]="isVisibleList" nzWidth="1000" nzTitle="分发卡券列表" (nzOnCancel)="handleCancelList()" (nzOnOk)="handleCancelList()"> <nz-modal [(nzVisible)]="isVisibleList" nzWidth="1000" nzTitle="分发卡券列表" (nzOnCancel)="handleCancelList()" (nzOnOk)="handleCancelList()">
<nz-table <nz-table
class="table" class="table"
@ -271,6 +296,66 @@
</nz-table> </nz-table>
</nz-modal> </nz-modal>
<nz-modal [(nzVisible)]="isVisibleDistributeCouponsList" nzWidth="1000" nzTitle="优惠券包分发列表" (nzOnCancel)="isVisibleDistributeCouponsList=false" (nzOnOk)="isVisibleDistributeCouponsList=false">
<nz-table #basicTable1 [nzData]="distributeCouponsList" [nzLoading]="loadingCouponsList" [nzPageSize]="10" [nzScroll]="{ y: '500px' }">
<thead>
<tr>
<th nzWidth="50px">优惠券包名称</th>
<th nzWidth="50px">代理商名称</th>
<th nzWidth="50px">库存数量</th>
<th nzWidth="50px">销售数量</th>
<th nzWidth="70px">分发时间</th>
<th nzWidth="70px">操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable1.data">
<td>{{data.discountPackageTitle}}</td>
<td>{{data.agentName}}</td>
<td>{{data.stockCount}}</td>
<td>{{data.salesCount}}</td>
<td>{{data['createTime'] | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>
<a (click)="getRecordList(data['discountPackageId'])">分发历史</a>
</td>
</tr>
</tbody>
</nz-table>
</nz-modal>
<nz-modal [(nzVisible)]="isVisibleAgentRecordList" nzWidth="900" nzTitle="分发记录列表" (nzOnCancel)="isVisibleAgentRecordList=false" (nzOnOk)="isVisibleAgentRecordList=false">
<nz-table #basicTable2 [nzData]="packageAgentRecordList" [nzPageSize]="10" [nzScroll]="{ y: '500px' }">
<thead>
<tr>
<th>优惠券包名称</th>
<th>代理商名称</th>
<th>分发数量</th>
<th>分发前数量</th>
<th>分发后数量</th>
<th>分发时间</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of basicTable2.data">
<td>{{data.discountPackageTitle}}</td>
<td>{{data.agentName}}</td>
<td>{{data.frontCount}}</td>
<td>{{data.frontCount}}</td>
<td>{{data.afterCount}}</td>
<td>{{data['createTime'] | date: 'yyyy-MM-dd HH:mm'}}</td>
</tr>
</tbody>
</nz-table>
</nz-modal>
<nz-modal [(nzVisible)]="isVisibleShow" nzWidth="700" nzTitle="分发记录" (nzOnCancel)="handleCancelListShow()" (nzOnOk)="handleCancelListShow()"> <nz-modal [(nzVisible)]="isVisibleShow" nzWidth="700" nzTitle="分发记录" (nzOnCancel)="handleCancelListShow()" (nzOnOk)="handleCancelListShow()">
<nz-table #basicTable [nzData]="dataSet"> <nz-table #basicTable [nzData]="dataSet">
<thead> <thead>

@ -23,10 +23,15 @@ export class AgentListComponent implements OnInit {
searchForm: FormGroup; // 搜索框 searchForm: FormGroup; // 搜索框
validateForm: FormGroup; // 搜索框 validateForm: FormGroup; // 搜索框
validateFormDistribute: FormGroup; // 搜索框 validateFormDistribute: FormGroup; // 搜索框
validateFormDiscountPackage:FormGroup;//搜索框
requestData = []; // 列表数据 requestData = []; // 列表数据
discountList = []; // 列表数据 discountList = []; // 列表数据
couponList = []; // 列表数据 couponList = []; // 列表数据
distributeList = []; // 列表数据 distributeList = []; // 列表数据
discountPackageList=[];//优惠券包列表
distributeCouponsList=[];//优惠券包分发列表
packageAgentRecordList=[];//优惠券包分发记录列表
total: number; // 页码 total: number; // 页码
pageNum = 1; // 页码 pageNum = 1; // 页码
pageSize = 10; // 条码 pageSize = 10; // 条码
@ -34,10 +39,14 @@ export class AgentListComponent implements OnInit {
isVisible = false; isVisible = false;
isVisibleDiscount = false; isVisibleDiscount = false;
isVisibleDistribute = false; isVisibleDistribute = false;
isVisibleDistributeCoupons=false;
isVisibleDistributeCouponsList=false;
isVisibleAgentRecordList=false;
isVisibleList = false; isVisibleList = false;
id: number; id: number;
isSpinning = false; isSpinning = false;
isSpinningDistribute = false; isSpinningDistribute = false;
isSpinningDistributeCoupons=false;
requestDataDiscount = []; // 列表数据 requestDataDiscount = []; // 列表数据
totalDiscount: number; // 页码 totalDiscount: number; // 页码
pageNumDiscount = 1; // 页码 pageNumDiscount = 1; // 页码
@ -49,7 +58,9 @@ export class AgentListComponent implements OnInit {
pageNumList = 1; // 页码 pageNumList = 1; // 页码
pageSizeList = 10; // 条码 pageSizeList = 10; // 条码
loadingList = true; loadingList = true;
loadingCouponsList=false;
isOkLoading = false; isOkLoading = false;
isOkCouponsLoading=false;
isVisibleShow = false; isVisibleShow = false;
dataSet; dataSet;
constructor( constructor(
@ -86,6 +97,12 @@ export class AgentListComponent implements OnInit {
type: [null, [Validators.required]], type: [null, [Validators.required]],
stockCount: [null, [Validators.required]], stockCount: [null, [Validators.required]],
}); });
this.validateFormDiscountPackage=this.form.group({
discountPackageId:[null,[Validators.required]],
num:[null, [Validators.required,Validators.min(1)]]
})
this.getRequest(true, this.searchForm.value); this.getRequest(true, this.searchForm.value);
this.coupon.getCouponListByAll({} , data => { this.coupon.getCouponListByAll({} , data => {
@ -341,6 +358,91 @@ export class AgentListComponent implements OnInit {
}); });
} }
// 获取优惠券包列表
public getDistributeCoupons(id: number): void{
this.validateFormDiscountPackage.reset();
this.isSpinningDistributeCoupons = true;
this.agentId = id;
const whereObject = {};
whereObject['pageNum'] = 1;
whereObject['pageSize'] = 10000;
whereObject['status']=1;
this.agent.getDiscountPackageList(whereObject,(data)=>{
if (data['return_code'] === '000000') {
this.discountPackageList = data['return_data'].list;
} else {
this.message.error(data['return_msg']);
}
this.isSpinningDistributeCoupons=false;
})
this.isVisibleDistributeCoupons=true;
}
//分发优惠券包 确定
public addDisCoupon(): void{
for (const i in this.validateFormDiscountPackage.controls) {
this.validateFormDiscountPackage.controls[i].markAsDirty();
this.validateFormDiscountPackage.controls[i].updateValueAndValidity();
if (this.validateFormDiscountPackage.controls[i].errors != null) {
this.message.error('必填项不能为空');
return;
}
}
this.isOkCouponsLoading=true;
this.validateFormDiscountPackage.value['agentId'] = this.agentId;
this.agent.distribute(this.validateFormDiscountPackage.value,(data)=>{
this.isOkCouponsLoading=false;
if (data['return_code'] === '000000') {
this.validateFormDiscountPackage.reset();
this.message.success('分发成功');
this.isVisibleDistributeCoupons = false;
} else {
this.message.error(data['return_msg']);
}
})
}
// 优惠券包分发列表
public getDistributeCouponsList(id:number):void{
this.agentId = id;
this.isVisibleDistributeCouponsList=true;
this.loadingCouponsList=true;
this.distributeCouponsList=[];
this.agent.getDiscountPackageAgentRelList(this.agentId,(data)=>{
this.loadingCouponsList=false;
if (data['return_code'] === '000000') {
this.distributeCouponsList = data['return_data'];
} else {
this.message.error(data['return_msg']);
}
})
}
// 获取优惠券包代理商分发记录列表
public getRecordList(discountPackageId:number):void{
const params={};
params["discountPackageId"]=discountPackageId;
params["agentId"]=this.agentId;
this.isVisibleAgentRecordList=true;
this.packageAgentRecordList=[];
this.agent.getDiscountPackageAgentRecord(params,(data)=>{
if (data['return_code'] === '000000') {
this.packageAgentRecordList = data['return_data'];
} else {
this.message.error(data['return_msg']);
}
})
}
public getList(id: number): void { public getList(id: number): void {
const whereObject = {}; const whereObject = {};
whereObject['pageNum'] = 1; whereObject['pageNum'] = 1;

@ -90,14 +90,14 @@
<input nz-input placeholder="请输入标题..." [formControlName]="'title'" /> <input nz-input placeholder="请输入标题..." [formControlName]="'title'" />
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<!-- <nz-form-item>--> <nz-form-item>
<!-- <nz-form-label [nzSpan]="4" nzRequired>商品类别</nz-form-label>--> <nz-form-label [nzSpan]="4" nzRequired>商品类别</nz-form-label>
<!-- <nz-form-control [nzSpan]="12" nzErrorTip="请选择商品类别!">--> <nz-form-control [nzSpan]="12" nzErrorTip="请选择商品类别!">
<!-- <nz-select nzShowSearch nzAllowClear formControlName="goodTypeId" nzPlaceHolder="请选择商品类别">--> <nz-select nzShowSearch nzAllowClear formControlName="goodTypeId" nzPlaceHolder="请选择商品类别">
<!-- <nz-option *ngFor="let item of goodTypData" nzLabel="{{item.title}}" nzValue="{{item.id}}"></nz-option>--> <nz-option *ngFor="let item of goodTypData" nzLabel="{{item.title}}" nzValue="{{item.id}}"></nz-option>
<!-- </nz-select>--> </nz-select>
<!-- </nz-form-control>--> </nz-form-control>
<!-- </nz-form-item>--> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired>图片</nz-form-label> <nz-form-label [nzSpan]="4" nzRequired>图片</nz-form-label>
<nz-form-control [nzSpan]="20" nzErrorTip="请上传图片!"> <nz-form-control [nzSpan]="20" nzErrorTip="请上传图片!">

@ -61,6 +61,7 @@ export class BrandComponent implements OnInit {
}); });
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
title: [null, [Validators.required]], title: [null, [Validators.required]],
goodTypeId: [null, [Validators.required]],
}); });
this.getRequest(true, this.searchForm.value); this.getRequest(true, this.searchForm.value);
@ -162,6 +163,7 @@ export class BrandComponent implements OnInit {
this.validateForm.value.img = this.imgFile[0].name; this.validateForm.value.img = this.imgFile[0].name;
} }
} }
console.log(this.validateForm.value);
if (this.editFlag) { if (this.editFlag) {
this.validateForm.value.id = this.id; this.validateForm.value.id = this.id;
this.config.updateBrand(this.validateForm.value, data => { this.config.updateBrand(this.validateForm.value, data => {
@ -174,7 +176,6 @@ export class BrandComponent implements OnInit {
} }
}); });
} else { } else {
console.log('123');
this.config.insertBrand(this.validateForm.value, data => { this.config.insertBrand(this.validateForm.value, data => {
if (data['return_code'] === '000000') { if (data['return_code'] === '000000') {
this.isVisible = false; this.isVisible = false;

@ -10,7 +10,7 @@
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="6">商品名称</nz-form-label> <nz-form-label [nzSpan]="6">商品名称</nz-form-label>
<nz-form-control [nzSpan]="16"> <nz-form-control [nzSpan]="16">
<input nz-input formControlName="name"/> <input nz-input formControlName="title"/>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>

@ -110,7 +110,7 @@ export class ListComponent implements OnInit {
// 初始化搜索表单 // 初始化搜索表单
this.searchForm = this.form.group({ this.searchForm = this.form.group({
name: [null], title: [null],
status: [null], status: [null],
goodsLabel: [null], goodsLabel: [null],
}); });

@ -191,4 +191,38 @@ export class AgentService {
callBack(data); callBack(data);
}); });
} }
/*
*/
public distribute(params: object, callBack) {
this.http.post(environment.baseUrl + 'discountPackageAgent/distribute', params).subscribe(data => {
callBack(data);
});
}
/*
*/
public getDiscountPackageList(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'highDiscountPackage/getDiscountPackageList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
/* 获取优惠券包代理商关联列表 */
public getDiscountPackageAgentRelList(agentId: number, callBack) {
this.http.get(environment.baseUrl + 'discountPackageAgent/getDiscountPackageAgentRelList?agentId=' + agentId).subscribe(data => {
callBack(data);
});
}
/* 获取优惠券包代理商分发记录列表 */
public getDiscountPackageAgentRecord(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'discountPackageAgent/getDiscountPackageAgentRecord?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
} }

@ -4,11 +4,11 @@
export const environment = { export const environment = {
production: false, production: false,
baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址) // baseUrl: 'http://localhost:9302/brest/', // 测试环境服务器地址(请求数据地址)
orderUrl: 'http://localhost:9304/order/', // 测试环境服务器地址(请求数据地址) // orderUrl: 'http://localhost:9304/order/', // 测试环境服务器地址(请求数据地址)
// baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址) // baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
// baseUrl: 'https://hsg.dctpay.com/brest/', // 正式环境服务器地址(请求数据地址) baseUrl: 'https://hsg.dctpay.com/brest/', // 正式环境服务器地址(请求数据地址)
// orderUrl: 'https://hsg.dctpay.com/order/', // 测试环境服务器地址(请求数据地址) orderUrl: 'https://hsg.dctpay.com/order/', // 测试环境服务器地址(请求数据地址)
// orderUrl: 'https://hsgcs.dctpay.com/order/', // 测试环境服务器地址(请求数据地址) // orderUrl: 'https://hsgcs.dctpay.com/order/', // 测试环境服务器地址(请求数据地址)
imageUrl: 'https://hsgcs.dctpay.com/filesystem/', imageUrl: 'https://hsgcs.dctpay.com/filesystem/',
key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=', key: 'https://hsgcs.dctpay.com/phone-recharge-H5/index.html?codeValue=',

Loading…
Cancel
Save