Merge branch 'pre'

* pre:
  提交代码
  提交代码
  提交代码
  提交代码
  提交代码
pull/1/head
袁野 2 years ago
commit 40b7d92be2
  1. 2
      src/app/admin/device/device-list/device-list.component.html
  2. 359
      src/app/admin/discount-package/discount-package-list/discount-package-list.component.html
  3. 32
      src/app/admin/discount-package/discount-package-list/discount-package-list.component.scss
  4. 215
      src/app/admin/discount-package/discount-package-list/discount-package-list.component.ts
  5. 4
      src/app/admin/merchant-store/gas-station-list/gas-station-list.component.html
  6. 79
      src/app/admin/system/oils-discount/oils-discount.component.html
  7. 3
      src/app/admin/system/oils-discount/oils-discount.component.scss
  8. 95
      src/app/admin/system/oils-discount/oils-discount.component.ts
  9. 4
      src/app/admin/system/system-user/system-user.component.html
  10. 2
      src/app/admin/tuanyou-agent/petrol-station-manage/petrol-station-manage.component.html
  11. 16
      src/app/services/commons.service.ts
  12. 25
      src/app/services/discount-package.service.ts
  13. 40
      src/app/services/gas-channel-config.service.ts

@ -154,7 +154,7 @@
<i nz-icon nz-tooltip nzTooltipTitle="“小票顶部标题” 最多7位字符" nzType="question-circle" nzTheme="outline"></i>
</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input formControlName="receiptTop" maxlength="7" [placeholder]="'默认嗨森逛'"/>
<input nz-input formControlName="receiptTop" maxlength="9" [placeholder]="'默认嗨森逛'"/>
</nz-form-control>
</nz-form-item>

@ -2,125 +2,126 @@
<app-breadcrumb></app-breadcrumb>
<!-- end 面包屑 -->
<!--条件搜索-->
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">优惠券包名称</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input formControlName="title"/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">类型</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="salesType" nzPlaceHolder="请选择类型">
<nz-option nzLabel="售卖" nzValue="1"></nz-option>
<nz-option nzLabel="赠送" nzValue="2"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">使用归属</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select formControlName="usingAttribution" nzAllowClear nzPlaceHolder="选择类型">
<nz-option *ngFor="let item of usingAttribution" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">优惠券包状态</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="status" nzPlaceHolder="请选择优惠券包状态">
<nz-option nzLabel="上架中" nzValue="1"></nz-option>
<nz-option nzLabel="下架中" nzValue="2"></nz-option>
<nz-option nzLabel="编辑中" nzValue="3"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
<nz-spin nzTip="{{spinObject.title}}" [nzSpinning]="spinObject.status">
<!--条件搜索-->
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">优惠券包名称</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input formControlName="title"/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">类型</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="salesType" nzPlaceHolder="请选择类型">
<nz-option nzLabel="售卖" nzValue="1"></nz-option>
<nz-option nzLabel="赠送" nzValue="2"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">使用归属</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select formControlName="usingAttribution" nzAllowClear nzPlaceHolder="选择类型">
<nz-option *ngFor="let item of usingAttribution" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">优惠券包状态</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="status" nzPlaceHolder="请选择优惠券包状态">
<nz-option nzLabel="上架中" nzValue="1"></nz-option>
<nz-option nzLabel="下架中" nzValue="2"></nz-option>
<nz-option nzLabel="编辑中" nzValue="3"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-row>
<div nz-col nzSpan="24" class="search-button">
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button>
<button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button>
</div>
</div>
</form>
</div>
<div class="inner-content">
<span>共计 {{total}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" [routerLink]="['/admin/discount-package/discount-package-edit']" ><i nz-icon nzType="plus" nzTheme="outline"></i>添加</button>
<div nz-row>
<div nz-col nzSpan="24" class="search-button">
<button nz-button nzType="primary"><i nz-icon nzType="search" nzTheme="outline"></i>搜索</button>
<button nz-button nzType="default" (click)="resetForm()"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button>
</div>
</div>
</form>
</div>
<nz-table
class="table"
#ajaxTable
nzShowSizeChanger
[nzFrontPagination]="false"
[nzData]="requestData"
[nzLoading]="loading"
[nzTotal]="total"
[(nzPageIndex)]="pageNum"
[(nzPageSize)]="pageSize"
[nzScroll]="{ x: '1200px' }"
(nzPageIndexChange)="getRequest(false , searchForm.value)"
(nzPageSizeChange)="getRequest(false , searchForm.value)">
<thead nzSingleSort>
<tr>
<th nzWidth="50px">编号</th>
<th nzWidth="150px">优惠券标题</th>
<th nzWidth="70px">销售类型</th>
<th nzWidth="70px">销售价格</th>
<th nzWidth="70px">限购数量</th>
<th nzWidth="100px">创建时间</th>
<th nzWidth="70px" nzRight>总库存</th>
<th nzWidth="70px" nzRight>剩余库存</th>
<th nzWidth="70px" nzRight>状态</th>
<th nzWidth="100px" nzRight>操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i+1}}</td>
<td>{{data.title}}</td>
<td>{{data.salesType === 1 ? '售卖' : '赠送'}}</td>
<td>{{data.price === null ? '暂无': data.price}}</td>
<td>{{data.purchaseNum === null? '暂无': data.purchaseNum}}</td>
<td>{{data.createdTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td nzRight>{{data.totalStock == null ? 0:data.totalStock }}</td>
<td nzRight>{{data.surplusStock == null ? 0:data.surplusStock }}</td>
<td nzRight>{{data.status | discountPackageStatus}}</td>
<td nzRight class="table-td-operation">
<a (click)="getDetails(data.id)">详情</a>
<nz-divider nzType="vertical" ></nz-divider>
<a nz-dropdown [nzDropdownMenu]="menu">更多</a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li class="li-a" *ngIf="data.status == 2 || data.status == 3" nz-menu-item><a (click)="getEdit(data.id)">编辑</a></li>
<li class="li-a" nz-menu-item><a (click)="addInventory(data.id)" >增加库存</a></li>
<li class="li-a" *ngIf="data.status == 2 || data.status == 3" nz-menu-item><a (click)="upDiscountPackage(data.id)" >上架</a></li>
<li class="li-a" *ngIf="data.status == 1" nz-menu-item><a (click)="downDiscountPackage(data.id)">下架</a></li>
<li class="li-a" *ngIf="data.status == 2 || data.status == 3" nz-menu-item><a (click)="deleteDiscountPackage(data.id)">删除</a></li>
</ul>
</nz-dropdown-menu>
</td>
</tbody>
</nz-table>
</div>
<div class="inner-content">
<span>共计 {{total}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" [routerLink]="['/admin/discount-package/discount-package-edit']" ><i nz-icon nzType="plus" nzTheme="outline"></i>添加</button>
</div>
<nz-table
class="table"
#ajaxTable
nzShowSizeChanger
[nzFrontPagination]="false"
[nzData]="requestData"
[nzLoading]="loading"
[nzTotal]="total"
[(nzPageIndex)]="pageNum"
[(nzPageSize)]="pageSize"
[nzScroll]="{ x: '1200px' }"
(nzPageIndexChange)="getRequest(false , searchForm.value)"
(nzPageSizeChange)="getRequest(false , searchForm.value)">
<thead nzSingleSort>
<tr>
<th nzWidth="50px">编号</th>
<th nzWidth="150px">优惠券标题</th>
<th nzWidth="70px">销售类型</th>
<th nzWidth="70px">销售价格</th>
<th nzWidth="70px">限购数量</th>
<th nzWidth="100px">创建时间</th>
<th nzWidth="70px" nzRight>总库存</th>
<th nzWidth="70px" nzRight>剩余库存</th>
<th nzWidth="70px" nzRight>状态</th>
<th nzWidth="100px" nzRight>操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i+1}}</td>
<td>{{data.title}}</td>
<td>{{data.salesType === 1 ? '售卖' : '赠送'}}</td>
<td>{{data.price === null ? '暂无': data.price}}</td>
<td>{{data.purchaseNum === null? '暂无': data.purchaseNum}}</td>
<td>{{data.createdTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td nzRight>{{data.totalStock == null ? 0:data.totalStock }}</td>
<td nzRight>{{data.surplusStock == null ? 0:data.surplusStock }}</td>
<td nzRight>{{data.status | discountPackageStatus}}</td>
<td nzRight class="table-td-operation">
<a (click)="getDetails(data.id)">详情</a>
<nz-divider nzType="vertical" ></nz-divider>
<a nz-dropdown [nzDropdownMenu]="menu">更多</a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li class="li-a" *ngIf="data.status == 2 || data.status == 3" nz-menu-item><a (click)="getEdit(data.id)">编辑</a></li>
<li class="li-a" nz-menu-item><a (click)="addInventory(data.id)" >增加库存</a></li>
<li class="li-a" *ngIf="data.status == 2 || data.status == 3" nz-menu-item><a (click)="upDiscountPackage(data.id)" >上架</a></li>
<li class="li-a" *ngIf="data.status == 1" nz-menu-item><a (click)="downDiscountPackage(data.id)">下架</a></li>
<li class="li-a" *ngIf="data.status == 2 || data.status == 3" nz-menu-item><a (click)="deleteDiscountPackage(data.id)">删除</a></li>
<li class="li-a" *ngIf="data.status == 1" nz-menu-item><a (click)="showDeliverUserModal(data.id, data.title)">赠送用户</a></li>
</ul>
</nz-dropdown-menu>
</td>
</tbody>
</nz-table>
</div>
</nz-spin>
<nz-modal [(nzVisible)]="isVisible" nzTitle="优惠券包规则内容" (nzOnCancel)="handleCancel()" (nzOnOk)="handleCancel()">
<nz-table #basicTable [nzData]="listOfData">
@ -147,3 +148,133 @@
</nz-form-control>
</nz-form-item>
</nz-modal>
<nz-modal [(nzVisible)]="deliverUserModal" nzTitle="赠送【{{deliverUserForm.controls.packageName.value}}】卷包-用户配置" (nzOnCancel)="closeDeliverUserModal()" [nzFooter]="null" nzWidth="1000px">
<form nz-form [formGroup]="deliverUserSearchForm" class="ant-advanced-search-form">
<!-- <div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label>手机号</nz-form-label>
<nz-form-control>
<input nz-input formControlName="phone" />
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label>注册状态</nz-form-label>
<nz-form-control>
<nz-select ngModel="lucy" formControlName="registerStatus">
<nz-option nzValue="true" nzLabel="已注册"></nz-option>
<nz-option nzValue="false" nzLabel="未注册"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="8">
<nz-form-item>
<nz-form-label>数据状态</nz-form-label>
<nz-form-control>
<nz-select ngModel="lucy" formControlName="errorStatus">
<nz-option nzValue="true" nzLabel="有误"></nz-option>
<nz-option nzValue="false" nzLabel="正常"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col [nzSpan]="24" class="search-area">
<button nz-button [nzType]="'primary'">搜索</button>
<button nz-button (click)="resetForm()">重置</button>
</div>
</div>-->
<div nz-row>
<div nz-col [nzSpan]="24" style="text-align: right">
<button nz-button [nzType]="'primary'" (click)="showDeliverUserAddModal()">添加用户</button>
<button nz-button [nzType]="'primary'" (click)="downloadTemp()">下载excel模板</button>
<button nz-button [nzType]="'primary'" (click)="showExcelUserModal()">excel导入</button>
</div>
</div>
</form>
<span nz-typography nzType="danger">注意:提交赠送时系统会自动过滤 ”有误“ 和 ”重复“ 的数据,有误的数据不会赠送卷包。</span><br>
<span nz-typography >共计 {{deliverUserArray.length}} 条数据</span>
<nz-table #deliverUserTable [nzData]="deliverUserArray" [nzFrontPagination]="true">
<thead>
<tr>
<th>序号</th>
<th>用户手机号</th>
<th>注册状态</th>
<th>数据状态</th>
<th>错误描述</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of deliverUserTable.data" style="{{data.errorStatus?'color: #aa1111':''}}">
<td>{{data.serialNum}}</td>
<td>{{data.phone}}</td>
<td>{{data.registerStatus?'已注册':'未注册'}}</td>
<td>{{data.errorStatus?'有误':'正常'}}</td>
<td>{{data.errorMsg?data.errorMsg:'无'}}</td>
<td>
<a nz-popconfirm nzPopconfirmTitle="确定删除此数据吗?" (nzOnConfirm)="delDeliverUser(data.serialNum)">删除</a>
</td>
</tr>
</tbody>
</nz-table>
<div nz-row>
<div nz-col [nzSpan]="24" style="text-align: center;margin-top: 10px;">
<button nz-button [nzType]="'primary'" style="width: 200px;" (click)="submitDeliverUser()">提交</button>
</div>
</div>
</nz-modal>
<nz-modal [(nzVisible)]="deliverUserAddModal" nzTitle="添加用户" (nzOnCancel)="closeDeliverUserAddModal()" [nzFooter]="null" nzWidth="450">
<form nz-form [formGroup]="deliverUserAddForm" class="ant-advanced-search-form">
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label nzRequired>用户手机号</nz-form-label>
<nz-form-control>
<input nz-input formControlName="phone" placeholder="请输入需要赠送的用户手机号" />
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col [nzSpan]="24" style="text-align: center">
<button nz-button style="width: 150px;" (click)="submitDeliverUserAdd()" [nzType]="'primary'">确定</button>
</div>
</div>
</form>
</nz-modal>
<nz-modal [(nzVisible)]="excelUserModal" nzTitle="导入用户" (nzOnCancel)="closeExcelUserModal()" [nzFooter]="null" nzWidth="450">
<nz-spin nzTip="{{spinObject.title}}" [nzSpinning]="spinObject.status">
<span *ngIf="deliverUserArray.length > 0" nz-typography nzType="danger">注意:导入用户会清空现有列表中的数据。 </span>
<div nz-row [nzGutter]="24">
<div nz-col [nzSpan]="24">
<nz-form-item>
<nz-form-label nzRequired>excel文件</nz-form-label>
<nz-form-control>
<nz-upload
[nzAccept]="'.xls,.xlsx'"
[(nzFileList)]="excelUploadFile"
nzAction="{{BASE_URL}}/fileUpload/uploadfile"
[nzHeaders]="{ authorization: 'authorization-text' }"
(nzChange)="excelUserHandleChange($event)"
>
<button nz-button><i nz-icon nzType="upload"></i>{{excelUploadBtn?'上传文件':'重新上传'}}</button>
</nz-upload>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col [nzSpan]="24" style="text-align: center">
<button nz-button style="width: 150px;" (click)="submitExcelUser()" [nzType]="'primary'">确定</button>
</div>
</div>
</nz-spin>
</nz-modal>

@ -1,3 +1,35 @@
.table-td-operation a {
margin-right: 8px;
}
.ant-advanced-search-form {
padding: 24px;
background: #fbfbfb;
border: 1px solid #d9d9d9;
border-radius: 6px;
margin-bottom: 10px;
}
.search-result-list {
margin-top: 16px;
border: 1px dashed #e9e9e9;
border-radius: 6px;
background-color: #fafafa;
min-height: 200px;
text-align: center;
padding-top: 80px;
}
[nz-form-label] {
overflow: visible;
}
button {
margin-left: 8px;
}
.collapse {
margin-left: 8px;
font-size: 12px;
}
.search-area {
text-align: center;
}

@ -1,13 +1,14 @@
import { Component, OnInit } from '@angular/core';
import {environment} from '../../../../environments/environment';
import {FormBuilder, FormGroup} from '@angular/forms';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {CompanyService} from '../../../services/company.service';
import {ActivateService} from '../../../services/activate.service';
import {IconService} from '../../../services/icon.service';
import {NzMessageService} from 'ng-zorro-antd';
import {NzMessageService, NzModalService, NzUploadChangeParam} from 'ng-zorro-antd';
import {Router} from '@angular/router';
import {CommonsService} from '../../../services/commons.service';
import {DiscountPackageService} from '../../../services/discount-package.service';
import {ValidatorsService} from '../../../services/validators.service';
@Component({
selector: 'app-discount-package-list',
@ -15,7 +16,7 @@ import {DiscountPackageService} from '../../../services/discount-package.service
styleUrls: ['./discount-package-list.component.scss']
})
export class DiscountPackageListComponent implements OnInit {
BASE_URL = environment.baseUrl;
WEB_SERVE_URL = environment.imageUrl;
searchForm: FormGroup; // 搜索框
requestData = []; // 列表数据
@ -29,12 +30,33 @@ export class DiscountPackageListComponent implements OnInit {
isVisibleInventory = false;
id: number;
num: number;
deliverUserAddForm: FormGroup;
deliverUserAddModal = false;
userInterval;
deliverUserSearchForm: FormGroup;
deliverUserModal = false;
deliverUserArray = [];
deliverUserForm: FormGroup;
serialNumber: string;
excelUserModal = false;
excelUploadBtn = true;
excelUploadFile = [];
spinObject = {
title: '处理中',
status: false
};
constructor(
private form: FormBuilder,
private company: CompanyService,
private activate: ActivateService,
private iconService: IconService,
private message: NzMessageService,
private modal: NzModalService,
private router: Router,
private discountPackage: DiscountPackageService,
private commonsService: CommonsService,
@ -54,6 +76,23 @@ export class DiscountPackageListComponent implements OnInit {
status: [null],
phone: [null],
});
this.deliverUserSearchForm = this.form.group({
phone: [null],
registerStatus: [null],
errorStatus: [null],
});
this.deliverUserForm = this.form.group({
packageId: [null],
packageName: [''],
phoneArray: [null],
});
this.deliverUserAddForm = this.form.group({
phone: [null, [Validators.required, ValidatorsService.mobile]],
});
this.getRequest(true, this.searchForm.value);
this.commonsService.getDictionary('USING_ATTRIBUTION ', data => {
this.usingAttribution = data['return_data'];
@ -185,5 +224,175 @@ export class DiscountPackageListComponent implements OnInit {
});
}
// 打开 发送优惠券包给用户模态框
showDeliverUserModal(packageId: number, packageName: string) {
this.discountPackage.getHandleByPackageId({ packageId: packageId}, data => {
if (data['return_code'] === '000000') {
if (data['return_data'] != null) {
this.modal.confirm({
nzTitle: '提示',
nzContent: '当前卷包有赠送任务进行中,是否查看赠送进度?',
nzOnOk: () => this.processRate(data['return_data']['serialNumber'])
})
} else {
this.deliverUserForm.patchValue({ packageId: packageId, packageName: packageName});
this.deliverUserModal = true;
}
}
});
}
// 关闭 发送优惠券包给用户模态框
closeDeliverUserModal() {
this.deliverUserForm.reset();
this.deliverUserModal = false;
}
// 删除赠送用户
delDeliverUser(serialNum: number) {
this.deliverUserArray = this.deliverUserArray.filter(o => o.serialNum != serialNum);
}
// 展示导入模态框
showExcelUserModal() {
this.excelUserModal = true;
}
// 关闭导入模态框
closeExcelUserModal() {
this.spinObject.status = false;
this.excelUploadBtn = true;
this.excelUploadFile = [];
this.excelUserModal = false;
}
// 提交赠送数据
submitDeliverUser() {
if (this.deliverUserArray.length == 0) {
this.modal.warning({ nzTitle: '提示', nzContent: '没有需要赠送的用户'});
}
this.deliverUserForm.patchValue({ phoneArray: this.deliverUserArray.filter(o => o.errorStatus == false)});
this.spinObject.status = true;
this.spinObject.title = '处理中...';
const param = this.deliverUserForm.value;
this.closeDeliverUserModal();
this.discountPackage.giveAway(param, data => {
if (data['return_code'] === '000000') {
this.serialNumber = data['return_data'];
this.processRate(this.serialNumber);
} else {
this.showDeliverUserModal(this.deliverUserForm.controls.packageId.value, this.deliverUserForm.controls.packageName.value);
this.message.create('error', data['return_msg']);
this.spinObject.status = false;
}
});
}
// 处理进度
processRate(serialNum: string) {
this.spinObject.status = true;
this.userInterval = setInterval(() => this.commonsService.getRedisValueByType(serialNum, data => {
if (data['return_data'] != null) {
this.spinObject.title = '已处理' + data['return_data'] + '条数据';
} else {
this.spinObject.status = false;
this.getRequest(true, this.searchForm.value);
clearTimeout(this.userInterval);
}
}), 1000);
}
// 提交excel数据
submitExcelUser() {
this.spinObject.title = '文件导入中... 数据太多会占用较长时间';
this.spinObject.status = true;
this.discountPackage.getPhoneListByFileUrl({ fileUrl: this.excelUploadFile[0]['url']}, data => {
if (data['return_code'] === '000000') {
this.deliverUserArray = data['return_data']['data'];
this.closeExcelUserModal();
} else {
this.spinObject.status = false;
this.message.error(data['return_msg']);
}
});
}
// 上传excel回调
excelUserHandleChange(info: NzUploadChangeParam): void {
if (info.file.status !== 'uploading') {
this.excelUploadFile = [];
}
if (info.file.status === 'done') {
this.excelUploadBtn = false;
this.excelUploadFile.push(
{
uid: '1',
name: info.file.name,
status: 'done',
url: info.file['response']['return_data'][0],
thumbUrl: this.WEB_SERVE_URL + info.file['response']['return_data'][0],
}
)
} else if (info.file.status === 'error') {
this.message.error('文件上传失败');
}
}
// 打开 发送优惠券包给用户模态框
showDeliverUserAddModal() {
this.deliverUserAddModal = true;
}
// 关闭 发送优惠券包给用户模态框
closeDeliverUserAddModal() {
this.deliverUserAddForm.reset();
this.deliverUserAddModal = false;
}
submitDeliverUserAdd() {
for (const i in this.deliverUserAddForm.controls) {
this.deliverUserAddForm.controls[i].markAsDirty();
this.deliverUserAddForm.controls[i].updateValueAndValidity();
}
if (this.deliverUserAddForm.status == null || this.deliverUserAddForm.status !== 'VALID') {
this.modal.warning({
nzTitle: '提示',
nzContent: '请规范填写所有的必填项信息',
});
return;
}
let phoneObject = this.deliverUserArray.find(o => o.phone == this.deliverUserAddForm.controls.phone.value);
if (phoneObject != null) {
this.modal.warning({
nzTitle: '提示',
nzContent: '手机号在列表中已存在',
});
return;
}
this.discountPackage.getPhoneRegisterStatus(this.deliverUserAddForm.value, data => {
if (data['return_code'] === '000000') {
this.deliverUserArray.push({
serialNum: this.deliverUserArray.length + 1,
phone: this.deliverUserAddForm.controls.phone.value,
registerStatus: data['return_data'],
errorStatus: false,
errorMsg: null
});
this.deliverUserArray = this.deliverUserArray.slice();
this.closeDeliverUserAddModal();
}
});
}
// 下载模板
downloadTemp() {
window.location.href = this.WEB_SERVE_URL + 'template/导入模板.xlsx';
}
}

@ -83,8 +83,8 @@
<th nzWidth="140px">所在商户</th>
<th nzWidth="200px">油站名称</th>
<th nzWidth="90px">预存类型</th>
<th nzWidth="90px">账户余额</th>
<th nzWidth="90px">预警余额</th>
<th nzWidth="120px">账户余额</th>
<th nzWidth="120px">预警余额</th>
<th nzWidth="90px">预警状态</th>
<th nzWidth="100px">油站编号</th>
<th nzWidth="150px">油站地址</th>

@ -31,8 +31,8 @@
<div class="inner-content">
<span>共计 {{total}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" (click)="showConfigOilMerNum()" ><i nz-icon nzType="plus" nzTheme="outline"></i>配置商户号</button>
<button nz-button nzType="primary" class="right-btn" (click)="getAdd()" ><i nz-icon nzType="plus" nzTheme="outline"></i>添加</button>
<button nz-button nzType="primary" class="right-btn" (click)="showTripartitePlatformModal()" >渠道支付配置</button>
<button nz-button nzType="primary" class="right-btn" (click)="getAdd()" >添加油品优惠</button>
</div>
<nz-table
class="table"
@ -102,6 +102,79 @@
</form>
</nz-modal>
<nz-modal [(nzVisible)]="tripartitePlatformModal" nzTitle="渠道支付配置" (nzOnCancel)="closeTripartitePlatformModal()" nzWidth="500px" [nzFooter]="null">
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired >渠道</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select [(ngModel)]="channelId" (ngModelChange)="selectChannel($event)">
<nz-option *ngFor="let item of gasChannelConfigChannelArray" nzValue="{{item.codeValue}}" nzLabel="{{item.codeName}}"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<form nz-form [formGroup]="tripartitePlatformForm">
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired >第三方平台</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-select formControlName="payPlatformType">
<nz-option nzValue="1" nzLabel="微信"></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]="14">
<input nz-input placeholder="请输入第三方平台商户全称" formControlName="payPlatformMerName" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired >商户号</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="请输入第三方平台商户号" formControlName="payPlatformMerNo" />
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzRequired >是否分账</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-radio-group formControlName="profitSharingStatus">
<label nz-radio nzValue="true"></label>
<label nz-radio nzValue="false"></label>
</nz-radio-group>
</nz-form-control>
</nz-form-item>
<nz-form-item *ngIf="tripartitePlatformForm.value.profitSharingStatus == 'true'">
<nz-form-label [nzSpan]="6" nzRequired >分账比例(%)</nz-form-label>
<nz-form-control [nzSpan]="14">
<nz-input-number formControlName="profitSharingRatio" [nzPrecision]="2" [nzMin]="0" [nzMax]="30" [nzPlaceHolder]="'分账比例(%)'"></nz-input-number>
</nz-form-control>
</nz-form-item>
<nz-form-item *ngIf="tripartitePlatformForm.value.profitSharingStatus == 'true'">
<nz-form-label [nzSpan]="6" nzRequired >接收方全称</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="分账接收方全称" formControlName="profitSharingReceiversName" />
</nz-form-control>
</nz-form-item>
<nz-form-item *ngIf="tripartitePlatformForm.value.profitSharingStatus == 'true'">
<nz-form-label [nzSpan]="6" nzRequired >接收方商户号</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="分账接收方商户号" formControlName="profitSharingReceiversNo" />
</nz-form-control>
</nz-form-item>
<div style="text-align: center;">
<button nz-button nzType="primary" style="width: 150px;" (click)="submitTripartitePlatform()">确定</button>
</div>
</form>
</nz-modal>
<!--
<nz-modal [(nzVisible)]="configOilMerNumModal" nzTitle="配置商户号" (nzOnCancel)="closeConfigOilMerNum()" (nzOnOk)="submitConfigOilMerNum()">
<form nz-form [formGroup]="configOilMerNumForm">
<div nz-row>
@ -117,4 +190,4 @@
</div>
</div>
</form>
</nz-modal>
</nz-modal>-->

@ -6,6 +6,7 @@ import {CommonsService} from '../../../services/commons.service';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {Router} from '@angular/router';
import {GasChannelConfigService} from '../../../services/gas-channel-config.service';
@Component({
selector: 'app-oils-discount',
@ -25,15 +26,21 @@ export class OilsDiscountComponent implements OnInit {
isVisible = false;
roleTypeArray;
gasChannelConfigChannelArray = [];
configOilMerNumModal = false;
configOilMerNumForm: FormGroup;
channelId = '1';
tripartitePlatformModal = false;
tripartitePlatformForm: FormGroup;
constructor(
private form: FormBuilder,
private modal: NzModalService,
private company: CompanyService,
private iconService: IconService,
private message: NzMessageService,
private gasChannelConfigService: GasChannelConfigService,
private router: Router,
private common: CommonsService
) {
@ -43,6 +50,10 @@ export class OilsDiscountComponent implements OnInit {
this.common.getDictionary('GAS_OIL_TYPE', data => {
this.roleTypeArray = data['return_data'];
});
this.common.getDictionary('GAS_CHANNEL_CONFIG_CHANNEL', data => {
this.gasChannelConfigChannelArray = data['return_data'];
});
this.init();
}
@ -60,6 +71,15 @@ export class OilsDiscountComponent implements OnInit {
codeValue: [null, [Validators.required]],
});
this.tripartitePlatformForm = this.form.group({
payPlatformType: ['1', [Validators.required]],
payPlatformMerName: [null, [Validators.required]],
payPlatformMerNo: [null, [Validators.required]],
profitSharingStatus: ['false', [Validators.required]],
profitSharingRatio: [null],
profitSharingReceiversNo: [null],
profitSharingReceiversName: [null],
});
this.getRequest(true, this.searchForm.value);
}
@ -167,5 +187,80 @@ export class OilsDiscountComponent implements OnInit {
}
});
}
// 打开配置第三方模态框
showTripartitePlatformModal () {
this.selectChannel(this.channelId);
this.tripartitePlatformModal = true;
}
// 关闭配置第三方模态框
closeTripartitePlatformModal () {
this.tripartitePlatformModal = false;
}
// 提交第三方
submitTripartitePlatform() {
for (const i in this.tripartitePlatformForm.controls) {
this.tripartitePlatformForm.controls[i].markAsDirty();
this.tripartitePlatformForm.controls[i].updateValueAndValidity();
}
if (this.tripartitePlatformForm.status == null || this.tripartitePlatformForm.status !== 'VALID') {
this.modal.warning({
nzTitle: '提示',
nzContent: '请填写所有必填项',
});
return;
}
if (this.tripartitePlatformForm.value.profitSharingStatus === 'true'
&& (this.tripartitePlatformForm.value.profitSharingRatio == null ||
this.tripartitePlatformForm.value.profitSharingReceiversNo == null ||
this.tripartitePlatformForm.value.profitSharingReceiversName == null)) {
this.modal.warning({
nzTitle: '提示',
nzContent: '请填写所有必填项',
});
return;
}
this.tripartitePlatformForm.value['channelId'] = this.channelId;
this.gasChannelConfigService.editTripartitePlatform(this.tripartitePlatformForm.value, data => {
if (data['return_code'] === '000000') {
this.modal.success({
nzTitle: '提示',
nzContent: '保存成功',
});
this.closeTripartitePlatformModal();
} else {
this.modal.error({
nzTitle: '提示',
nzContent: data['return_msg'],
});
}
});
}
// 选择商户号
selectChannel(channelId: string) {
this.channelId = channelId;
this.gasChannelConfigService.getDetail(Number(channelId), this.tripartitePlatformForm.value['payPlatformType'], data => {
if (data['return_data'] != null) {
data['return_data']['channelId'] = String(data['return_data']['channelId']);
data['return_data']['payPlatformType'] = String(data['return_data']['payPlatformType']);
data['return_data']['profitSharingStatus'] = String(data['return_data']['profitSharingStatus']);
this.tripartitePlatformForm.patchValue(data['return_data'])
} else {
const param = {
channelId: channelId,
payPlatformType: String(this.tripartitePlatformForm.value['payPlatformType']),
profitSharingStatus: 'false'
}
this.tripartitePlatformForm.reset();
this.tripartitePlatformForm.patchValue(param);
}
});
}
}

@ -148,9 +148,9 @@
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>通知权限</nz-form-label>
<nz-form-label [nzSm]="6" [nzXs]="24">通知权限</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-select style="width: 100%;" formControlName="roleId" nzShowSearch nzAllowClear nzPlaceHolder="请选择功能标签">
<nz-select style="width: 100%;" nzMode="multiple" formControlName="label" nzShowSearch nzAllowClear nzPlaceHolder="请选择功能标签">
<nz-option *ngFor="let item of userLabelArray" [nzValue]="item.codeValue" [nzLabel]="item.codeName"></nz-option>
</nz-select>
</nz-form-control>

@ -7,7 +7,7 @@
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="search(searchForm.value)">
<div nz-row>
<div nz-col nzSpan="8">
<div nz-col nzSpan="8" *ngIf="roleType == 1">
<nz-form-item>
<nz-form-label [nzSpan]="8">地区</nz-form-label>
<nz-form-control [nzSpan]="14">

@ -183,12 +183,24 @@ export class CommonsService {
* @param codeType
* @param callback
*/
public getDictionary(codeType: string , callback): any {
this.http.get(environment.baseUrl + '/common/getDictionaryByCodeType?codeType=' + codeType).subscribe( data => {
public getRedisValueByType(key: string , callback): any {
this.http.get(environment.baseUrl + '/common/getRedisValueByType?key=' + key).subscribe( data => {
callback(data);
});
}
/**
*
*
* @param codeType
* @param callback
*/
public getDictionary(codeType: string , callback): any {
this.http.get(environment.baseUrl + '/common/getDictionaryByCodeType?codeType=' + codeType).subscribe( data => {
callback(data);
});
}
public mappingSysNameOl(codeType: string , callback): any {
this.http.get(environment.baseUrl + '/common/getDictionaryByCodeTypeOl?codeType=' + codeType).subscribe( data => {
callback(data);

@ -193,5 +193,30 @@ export class DiscountPackageService {
});
}
public getPhoneListByFileUrl(paramsObject: object, callBack) {
this.http.post(environment.baseUrl + 'highDiscountPackage/getPhoneListByFileUrl', paramsObject).subscribe(data => {
callBack(data);
});
}
public getPhoneRegisterStatus(paramsObject: object, callBack) {
this.http.post(environment.baseUrl + 'highDiscountPackage/getPhoneRegisterStatus', paramsObject).subscribe(data => {
callBack(data);
});
}
public getHandleByPackageId(paramsObject: object, callBack) {
this.http.post(environment.baseUrl + 'highDiscountPackage/getHandleByPackageId', paramsObject).subscribe(data => {
callBack(data);
});
}
public giveAway(paramsObject: object, callBack) {
this.http.post(environment.baseUrl + 'highDiscountPackage/giveAway', paramsObject).subscribe(data => {
callBack(data);
});
}
}

@ -0,0 +1,40 @@
import { Injectable } from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {CommonsService} from './commons.service';
import {environment} from '../../environments/environment';
@Injectable({
providedIn: 'root'
})
export class GasChannelConfigService {
constructor(
private http: HttpClient,
private common: CommonsService
) { }
/**
*
*
* @param param
* @param callBack
*/
public editTripartitePlatform(param: object, callBack) {
this.http.post(environment.baseUrl + 'gasChannelConfig/editTripartitePlatform', param).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param param
* @param callBack
*/
public getDetail(channelId: number, payPlatformType: number, callBack) {
this.http.get(environment.baseUrl + 'gasChannelConfig/getDetail?channelId=' + channelId + '&payPlatformType=' + payPlatformType).subscribe(data => {
callBack(data);
});
}
}
Loading…
Cancel
Save