Merge branch 'master' of http://139.159.177.244:3000/yuanye/high-web
commit
6e9bedf354
@ -0,0 +1,101 @@ |
||||
<!-- start 面包屑 --> |
||||
<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="6"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">订单号</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input formControlName="orderNo"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="6"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">客户手机号</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input formControlName="phone"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="6"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">状态</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<nz-select nzShowSearch nzAllowClear nzPlaceHolder="请选择订单状态" formControlName="status"> |
||||
<nz-option nzLabel="待支付" nzValue="1"></nz-option> |
||||
<nz-option nzLabel="已支付" nzValue="2"></nz-option> |
||||
<nz-option nzLabel="已完成" nzValue="3"></nz-option> |
||||
<nz-option nzLabel="已退款" nzValue="4"></nz-option> |
||||
<nz-option nzLabel="已取消" nzValue="5"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
</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> |
||||
<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="180px">订单号</th> |
||||
<th nzWidth="180px">支付流水号</th> |
||||
<th nzWidth="120px">客户名称</th> |
||||
<th nzWidth="130px">客户电话</th> |
||||
<th nzWidth="100px">支付模式</th> |
||||
<th nzWidth="100px">支付方式</th> |
||||
<th nzWidth="100px">支付金额</th> |
||||
<th nzWidth="140px">支付时间</th> |
||||
<th nzWidth="140px">取消时间</th> |
||||
<th nzWidth="140px">创建时间</th> |
||||
<th nzWidth="80px">状态</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||
<td>{{i+1}}</td> |
||||
<td>{{data.orderNo}}</td> |
||||
<td>{{data.paySerialNo == null ? '暂无': data.paySerialNo}}</td> |
||||
<td>{{data.memName == null ? '暂无': data.memName}}</td> |
||||
<td>{{data.memPhone == null ? '暂无': data.memPhone}}</td> |
||||
<td>{{data.payModel == null ? '暂无': data.payModel}}</td> |
||||
<td>{{data.payType == null ? '暂无': data.payType}}</td> |
||||
<td>{{data.payPrice == null ? '暂无': data.payPrice}}</td> |
||||
<td>{{data.payTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
<td>{{data.cancelTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
<td>{{data.orderStatus | orderCouponStatus}}</td> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
|
||||
|
||||
|
@ -0,0 +1,4 @@ |
||||
.head_img { |
||||
height: 60px; |
||||
width: 60px; |
||||
} |
@ -0,0 +1,84 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {environment} from '../../../../environments/environment'; |
||||
import {FormBuilder, FormGroup} from '@angular/forms'; |
||||
import {MerchantService} from '../../../services/merchant.service'; |
||||
import {IconService} from '../../../services/icon.service'; |
||||
import {NzMessageService} from 'ng-zorro-antd'; |
||||
import {Router} from '@angular/router'; |
||||
import {CommonsService} from '../../../services/commons.service'; |
||||
import {OrderService} from '../../../services/order.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-order-list', |
||||
templateUrl: './order-list.component.html', |
||||
styleUrls: ['./order-list.component.scss'] |
||||
}) |
||||
export class OrderListComponent implements OnInit { |
||||
|
||||
WEB_SERVE_URL = environment.baseUrl; |
||||
searchForm: FormGroup; // 搜索框
|
||||
requestData = []; // 列表数据
|
||||
total: number; // 页码
|
||||
pageNum = 1; // 页码
|
||||
pageSize = 10; // 条码
|
||||
loading = true; |
||||
|
||||
constructor( |
||||
private form: FormBuilder, |
||||
private order: OrderService, |
||||
private iconService: IconService, |
||||
private message: NzMessageService, |
||||
private router: Router, |
||||
private common: CommonsService |
||||
) { |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
this.init(); |
||||
} |
||||
|
||||
public init(): void { |
||||
this.searchForm = this.form.group({ |
||||
phone: [null], |
||||
orderNo: [null], |
||||
status: [null], |
||||
}); |
||||
this.getRequest(true, this.searchForm.value); |
||||
} |
||||
|
||||
// 查询列表
|
||||
public getRequest(reset: boolean = false, whereObject: object) { |
||||
|
||||
this.loading = false; |
||||
if (reset) { |
||||
this.pageNum = 1; |
||||
} |
||||
whereObject['pageNum'] = this.pageNum; |
||||
whereObject['pageSize'] = this.pageSize; |
||||
this.order.getOrderCouponList(whereObject, data => { |
||||
if (data['return_code'] === '000000') { |
||||
console.log(data); |
||||
this.requestData = data['return_data'].list; |
||||
this.total = data['return_data'].total; |
||||
} else { |
||||
this.message.error(data['return_msg']); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
// 重置
|
||||
public resetForm(): void { |
||||
this.searchForm.reset(); |
||||
} |
||||
|
||||
|
||||
// 查看详情
|
||||
public getDetail(id: number): void { |
||||
this.router.navigate(['/admin/merchant/merchant-detail'], { |
||||
queryParams: { |
||||
merchantId: id |
||||
} |
||||
}).then(r => console.log(r)); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,14 @@ |
||||
import { NgModule } from '@angular/core'; |
||||
import { Routes, RouterModule } from '@angular/router'; |
||||
import {OrderListComponent} from './order-list/order-list.component'; |
||||
|
||||
|
||||
const routes: Routes = [ |
||||
{ path: 'order-list', component: OrderListComponent }, |
||||
]; |
||||
|
||||
@NgModule({ |
||||
imports: [RouterModule.forChild(routes)], |
||||
exports: [RouterModule] |
||||
}) |
||||
export class OrderRoutingModule { } |
@ -0,0 +1,28 @@ |
||||
import { NgModule } from '@angular/core'; |
||||
import { CommonModule } from '@angular/common'; |
||||
|
||||
import { OrderRoutingModule } from './order-routing.module'; |
||||
import { OrderListComponent } from './order-list/order-list.component'; |
||||
import {NgZorroAntdModule} from 'ng-zorro-antd'; |
||||
import {SeparateModule} from '../../common/separate/separate.module'; |
||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms'; |
||||
import {BreadcrumbModule} from '../../common/breadcrumb/breadcrumb.module'; |
||||
import {RegionSelectorModule} from '../../common/region-selector/region-selector.module'; |
||||
import {AppCommonModule} from "../../app-common.module"; |
||||
|
||||
|
||||
@NgModule({ |
||||
declarations: [OrderListComponent], |
||||
imports: [ |
||||
CommonModule, |
||||
OrderRoutingModule, |
||||
NgZorroAntdModule, |
||||
SeparateModule, |
||||
ReactiveFormsModule, |
||||
FormsModule, |
||||
BreadcrumbModule, |
||||
RegionSelectorModule, |
||||
AppCommonModule |
||||
] |
||||
}) |
||||
export class OrderModule { } |
@ -1 +1,112 @@ |
||||
<p>price-list works!</p> |
||||
<!-- start 面包屑 --> |
||||
<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="6"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">商户编号</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input formControlName="merchantKey"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="6"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">商户名称</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input formControlName="merchantName"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="6"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzSpan]="6">商户电话</nz-form-label> |
||||
<nz-form-control [nzSpan]="16"> |
||||
<input nz-input formControlName="telephone"/> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col nzSpan="6"> |
||||
<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="0"></nz-option> |
||||
<nz-option nzLabel="正常" nzValue="1"></nz-option> |
||||
</nz-select> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
</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/merchant/merchant-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="80px">商户编号</th> |
||||
<th nzWidth="80px">商户名称</th> |
||||
<th nzWidth="70px">商户LOGO</th> |
||||
<th nzWidth="100px">商户电话</th> |
||||
<th nzWidth="100px">创建时间</th> |
||||
<th nzWidth="50px">状态</th> |
||||
<th nzWidth="80px" nzRight="0px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||
<td>{{i+1}}</td> |
||||
<td>{{data.merchantKey}}</td> |
||||
<td>{{data.merchantName}}</td> |
||||
<td> |
||||
<img class="head_img" src="{{WEB_SERVE_URL + data.merchantLogo}}" onerror="this.src='../../../../assets/admin/navigation/icon.png'" alt=""> |
||||
</td> |
||||
<td>{{data.telephone}}</td> |
||||
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
<td>{{data.status ===1 ? '正常' : '禁用'}}</td> |
||||
<td nzRight="0px" class="table-td-operation"> |
||||
<a (click)="getEdit(data.id)"><i nz-icon nzType="form" nzTheme="outline" nz-tooltip="编辑"></i></a> |
||||
<nz-divider nzType="vertical"></nz-divider> |
||||
<a (click)="getDetail(data.id)"><i nz-icon [nzIconfont]="'icon-xiangqing'" nz-tooltip="商户详情"></i></a> |
||||
<nz-divider nzType="vertical"></nz-divider> |
||||
<a (click)="getList(data.id , data.merchantName)"><i nz-icon nzType="unordered-list" nzTheme="outline" nz-tooltip="门店列表"></i></a> |
||||
<nz-divider nzType="vertical"></nz-divider> |
||||
<a *ngIf="data.status === 1" (click)='disableMerchant(data.id)'><i nz-icon nzType="stop" nzTheme="outline" nz-tooltip="禁用"></i></a> |
||||
<a *ngIf="data.status !== 1" (click)='enableMerchant(data.id)'><i nz-icon nzType="check-circle" nzTheme="outline" nz-tooltip="启用"></i></a> |
||||
</td> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,4 @@ |
||||
.head_img { |
||||
height: 60px; |
||||
width: 60px; |
||||
} |
@ -0,0 +1,50 @@ |
||||
<!-- start 面包屑 --> |
||||
<app-breadcrumb></app-breadcrumb> |
||||
<!-- end 面包屑 --> |
||||
|
||||
<div class="inner-content"> |
||||
<span>共计 {{total}} 条数据</span> |
||||
<div class="operating-button"> |
||||
<button nz-button nzType="primary" class="right-btn" [routerLink]="['/admin/system/sinopec-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="80px">客户AppId</th> |
||||
<th nzWidth="80px">客户密码</th> |
||||
<th nzWidth="100px">客户编码</th> |
||||
<th nzWidth="100px">客户KEY</th> |
||||
<th nzWidth="100px">创建时间</th> |
||||
<th nzWidth="80px" nzRight="0px">操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let data of ajaxTable.data; let i = index"> |
||||
<td>{{i+1}}</td> |
||||
<td>{{data.appId}}</td> |
||||
<td>{{data.appSecret}}</td> |
||||
<td>{{data.code}}</td> |
||||
<td>{{data.signkey}}</td> |
||||
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td> |
||||
<td nzRight="0px" class="table-td-operation"> |
||||
<a (click)="getEdit(data.id)"><i nz-icon nzType="form" nzTheme="outline" nz-tooltip="编辑"></i></a> |
||||
</td> |
||||
</tbody> |
||||
</nz-table> |
||||
</div> |
||||
|
||||
|
||||
|
@ -0,0 +1,90 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {environment} from '../../../../environments/environment'; |
||||
import {FormBuilder, FormGroup} from '@angular/forms'; |
||||
import {MerchantService} from '../../../services/merchant.service'; |
||||
import {IconService} from '../../../services/icon.service'; |
||||
import {NzMessageService} from 'ng-zorro-antd'; |
||||
import {Router} from '@angular/router'; |
||||
import {SystemService} from '../../../services/system.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-sinopec-config', |
||||
templateUrl: './sinopec-config.component.html', |
||||
styleUrls: ['./sinopec-config.component.scss'] |
||||
}) |
||||
export class SinopecConfigComponent implements OnInit { |
||||
|
||||
WEB_SERVE_URL = environment.imageUrl; |
||||
searchForm: FormGroup; // 搜索框
|
||||
requestData = []; // 列表数据
|
||||
total: number; // 页码
|
||||
pageNum = 1; // 页码
|
||||
pageSize = 10; // 条码
|
||||
loading = true; |
||||
|
||||
constructor( |
||||
private form: FormBuilder, |
||||
private system: SystemService, |
||||
private iconService: IconService, |
||||
private message: NzMessageService, |
||||
private router: Router, |
||||
) { |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
this.init(); |
||||
} |
||||
|
||||
public init(): void { |
||||
this.searchForm = this.form.group({ |
||||
merchantKey: [null], |
||||
merchantName: [null], |
||||
telephone: [null], |
||||
status: [null], |
||||
}); |
||||
this.getRequest(true, this.searchForm.value); |
||||
} |
||||
|
||||
// 查询列表
|
||||
public getRequest(reset: boolean = false, whereObject: object) { |
||||
|
||||
this.loading = false; |
||||
if (reset) { |
||||
this.pageNum = 1; |
||||
} |
||||
whereObject['pageNum'] = this.pageNum; |
||||
whereObject['pageSize'] = this.pageSize; |
||||
this.system.getListSinopecConfig(whereObject, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.requestData = data['return_data'].list; |
||||
this.total = data['return_data'].total; |
||||
} else { |
||||
this.message.error(data['return_msg']); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
// 重置
|
||||
public resetForm(): void { |
||||
this.searchForm.reset(); |
||||
} |
||||
|
||||
// 修改
|
||||
public getEdit(id: number): void { |
||||
this.router.navigate(['/admin/system/sinopec-edit'], { |
||||
queryParams: { |
||||
sinopecId: id |
||||
} |
||||
}).then(r => console.log(r)); |
||||
} |
||||
|
||||
// // 查看详情
|
||||
// public getDetail(id: number): void {
|
||||
// this.router.navigate(['/admin/system/sinopec-detail'], {
|
||||
// queryParams: {
|
||||
// merchantId: id
|
||||
// }
|
||||
// }).then(r => console.log(r));
|
||||
// }
|
||||
|
||||
} |
@ -0,0 +1,56 @@ |
||||
<!-- start 面包屑 --> |
||||
<nz-breadcrumb> |
||||
<nz-breadcrumb-item> |
||||
<a (click)="getBack()">系统管理</a> |
||||
</nz-breadcrumb-item> |
||||
<nz-breadcrumb-item> |
||||
编辑配置 |
||||
</nz-breadcrumb-item> |
||||
</nz-breadcrumb> |
||||
<!-- end 面包屑 --> |
||||
|
||||
<nz-content class="inner-content"> |
||||
<form nz-form [formGroup]="validateForm" class="ant-advanced-search-form"> |
||||
<div nz-row [nzGutter]="24"> |
||||
<div nz-col [nzSpan]="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzFor]="'appId'" nzRequired>客户AppId</nz-form-label> |
||||
<nz-form-control nzErrorTip="请输入客户AppId!"> |
||||
<input nz-input placeholder="请输入客户AppId..." [formControlName]="'appId'" id="'appId'" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col [nzSpan]="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzFor]="'appSecret'" nzRequired>客户密码</nz-form-label> |
||||
<nz-form-control nzErrorTip="请输入客户密码!"> |
||||
<input nz-input placeholder="请输入客户密码..." [formControlName]="'appSecret'" id="'appSecret'" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col [nzSpan]="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzFor]="'code'" nzRequired>客户编码</nz-form-label> |
||||
<nz-form-control nzErrorTip="请输入客户编码!"> |
||||
<input nz-input placeholder="请输入客户编码..." [formControlName]="'code'" id="'code'" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
<div nz-col [nzSpan]="8"> |
||||
<nz-form-item> |
||||
<nz-form-label [nzFor]="'signkey'" nzRequired>客户KEY</nz-form-label> |
||||
<nz-form-control nzErrorTip="请输入客户KEY!"> |
||||
<input nz-input placeholder="请输入客户KEY..." [formControlName]="'signkey'" id="'signkey'" /> |
||||
</nz-form-control> |
||||
</nz-form-item> |
||||
</div> |
||||
</div> |
||||
<div nz-row> |
||||
<div nz-col [nzSpan]="24" class="search-area"> |
||||
<button nz-button (click)="resetForm()">重置</button> |
||||
<button nz-button [nzType]="'primary'" (click)="getSave()">提交</button> |
||||
</div> |
||||
</div> |
||||
</form> |
||||
|
||||
</nz-content> |
@ -0,0 +1,6 @@ |
||||
button { |
||||
margin-left: 8px; |
||||
} |
||||
:host ::ng-deep .ant-upload { |
||||
background-color: #ffffff; |
||||
} |
@ -0,0 +1,100 @@ |
||||
import { Component, OnInit } from '@angular/core'; |
||||
import {FormBuilder, FormGroup, Validators} from '@angular/forms'; |
||||
import {environment} from '../../../../environments/environment'; |
||||
import {MerchantService} from '../../../services/merchant.service'; |
||||
import {NzMessageService} from 'ng-zorro-antd'; |
||||
import {ActivatedRoute} from '@angular/router'; |
||||
import {SystemService} from '../../../services/system.service'; |
||||
|
||||
@Component({ |
||||
selector: 'app-sinopec-edit', |
||||
templateUrl: './sinopec-edit.component.html', |
||||
styleUrls: ['./sinopec-edit.component.scss'] |
||||
}) |
||||
export class SinopecEditComponent implements OnInit { |
||||
|
||||
validateForm!: FormGroup; |
||||
data: any; |
||||
editFlag = false; |
||||
id: number; |
||||
WEB_SERVE_URL = environment.baseUrl; |
||||
|
||||
constructor( |
||||
private fb: FormBuilder, |
||||
private system: SystemService, |
||||
private message: NzMessageService, // 信息提示
|
||||
private activatedRoute: ActivatedRoute, |
||||
) { |
||||
} |
||||
|
||||
ngOnInit(): void { |
||||
this.activatedRoute.queryParams.subscribe(queryParams => { |
||||
if (queryParams.sinopecId != null) { |
||||
this.editFlag = true; |
||||
this.id = queryParams.sinopecId; |
||||
this.getDetails(queryParams.sinopecId); |
||||
} |
||||
}); |
||||
this.validateForm = this.fb.group({ |
||||
appId: [null, [Validators.required]], |
||||
appSecret: [null, [Validators.required]], |
||||
code: [null, [Validators.required]], |
||||
signkey: [null, [Validators.required]], |
||||
}); |
||||
} |
||||
|
||||
// 返回
|
||||
getBack() { |
||||
history.back(); |
||||
} |
||||
|
||||
// 重置
|
||||
public resetForm(): void { |
||||
this.validateForm.reset(); |
||||
} |
||||
|
||||
// 保存
|
||||
public getSave(): void { |
||||
// tslint:disable-next-line:forin
|
||||
for (const i in this.validateForm.controls) { |
||||
this.validateForm.controls[i].markAsDirty(); |
||||
this.validateForm.controls[i].updateValueAndValidity(); |
||||
if (this.validateForm.controls[i].errors != null) { |
||||
this.message.error('必填项不能为空'); |
||||
return; |
||||
} |
||||
} |
||||
if (this.editFlag) { |
||||
this.validateForm.value.id = this.id; |
||||
this.system.updateMerchant(this.validateForm.value, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.getBack(); |
||||
this.message.success('修改成功'); |
||||
} else { |
||||
this.message.create('error', data['return_msg']); |
||||
} |
||||
}); |
||||
} else { |
||||
this.system.insertMerchant(this.validateForm.value, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.getBack(); |
||||
this.message.success('添加成功'); |
||||
} else { |
||||
this.message.create('error', data['return_msg']); |
||||
} |
||||
}); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
public getDetails(id) { |
||||
this.system.findById(id, data => { |
||||
if (data['return_code'] === '000000') { |
||||
this.validateForm.patchValue(data['return_data']); |
||||
} else { |
||||
this.message.create('error', data['return_msg']); |
||||
} |
||||
}); |
||||
} |
||||
} |
@ -0,0 +1,22 @@ |
||||
import { Pipe, PipeTransform } from '@angular/core'; |
||||
|
||||
@Pipe({ |
||||
name: 'orderCouponStatus' |
||||
}) |
||||
export class OrderCouponStatusPipe implements PipeTransform { |
||||
|
||||
transform(value: number): string { |
||||
switch (value) { |
||||
case 1: |
||||
return '待支付'; |
||||
case 2: |
||||
return '已支付'; |
||||
case 3: |
||||
return '已完成'; |
||||
case 4: |
||||
return '已退款'; |
||||
case 5: |
||||
return '已取消'; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,27 @@ |
||||
import { Injectable } from '@angular/core'; |
||||
import {environment} from '../../environments/environment'; |
||||
import {HttpClient} from '@angular/common/http'; |
||||
import {CommonsService} from './commons.service'; |
||||
|
||||
@Injectable({ |
||||
providedIn: 'root' |
||||
}) |
||||
export class OrderService { |
||||
|
||||
constructor( |
||||
private http: HttpClient, |
||||
private common: CommonsService |
||||
) { } |
||||
|
||||
/** |
||||
* 查询订单列表 |
||||
* |
||||
* @param paramsObject 对象 |
||||
* @param callBack 回调 |
||||
*/ |
||||
public getOrderCouponList(paramsObject: object, callBack) { |
||||
this.http.get(environment.baseUrl + 'highOrder/getOrderList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => { |
||||
callBack(data); |
||||
}); |
||||
} |
||||
} |
@ -1,5 +1,5 @@ |
||||
export const environment = { |
||||
production: true, |
||||
baseUrl: 'https://hsgcs.dctpay.com/brest/', // 正式环境服务器地址(请求数据地址)
|
||||
imageUrl: 'https://hsgcs.dctpay.com/filesystem/', |
||||
baseUrl: 'https://hsg.dctpay.com/brest/', // 正式环境服务器地址(请求数据地址)
|
||||
imageUrl: 'https://hsg.dctpay.com/filesystem/', |
||||
}; |
||||
|
@ -1,5 +1,5 @@ |
||||
export const environment = { |
||||
production: true, |
||||
baseUrl: 'https://newhigh.shinwoten.cn/crest/', // 测试环境服务器地址(请求数据地址)
|
||||
imageUrl: 'http://newhigh.shinwoten.cn/filesystem/', |
||||
baseUrl: 'https://hsgcs.dctpay.com/brest/', // 测试环境服务器地址(请求数据地址)
|
||||
imageUrl: 'https://hsgcs.dctpay.com/filesystem/', |
||||
}; |
||||
|
Loading…
Reference in new issue