提交订单修改

pull/1/head
袁野 4 years ago
parent 7a679909e6
commit 097bd42168
  1. 131
      src/app/admin/order/order-list/order-list.component.html
  2. 65
      src/app/admin/order/order-list/order-list.component.ts
  3. 16
      src/app/services/merchant.service.ts
  4. 16
      src/app/services/order.service.ts

@ -6,7 +6,27 @@
<div class="inner-content">
<form nz-form [formGroup]="searchForm" (ngSubmit)="getRequest(true , searchForm.value)">
<div nz-row>
<div nz-col nzSpan="6">
<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]="'companyId'" (ngModelChange)="getMerchantListByCompany($event)">
<nz-option *ngFor="let item of companyData" nzValue="{{item.id}}" nzLabel="{{item.name}}"></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]="'merchantId'">
<nz-option *ngFor="let item of merchantData" nzValue="{{item.id}}" nzLabel="{{item.merchantName}}"></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">
@ -14,15 +34,39 @@
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="6">
<div nz-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">客户手机</nz-form-label>
<nz-form-label [nzSpan]="6">订单流水</nz-form-label>
<nz-form-control [nzSpan]="16">
<input nz-input formControlName="memPhone"/>
<input nz-input formControlName="paySerialNo"/>
</nz-form-control>
</nz-form-item>
</div>
<div nz-col nzSpan="6">
<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="payModel" 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-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">支付方式</nz-form-label>
<nz-form-control [nzSpan]="16">
<nz-select nzShowSearch nzAllowClear formControlName="payType" 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-col nzSpan="8">
<nz-form-item>
<nz-form-label [nzSpan]="6">状态</nz-form-label>
<nz-form-control [nzSpan]="16">
@ -36,6 +80,14 @@
</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-range-picker [nzShowTime]="{ nzFormat: 'HH:mm' }" formControlName="payTime"></nz-range-picker>
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
@ -50,6 +102,9 @@
<div class="inner-content">
<span>共计 {{total}} 条数据</span>
<div class="operating-button">
<button nz-button nzType="primary" class="right-btn" (click)="downloadTemplate(searchForm.value)" ><i nz-icon nzType="download" nzTheme="outline"></i>导出订单</button>
</div>
<nz-table
class="table"
#ajaxTable
@ -75,8 +130,10 @@
<th nzWidth="110px">支付模式</th>
<th nzWidth="100px">支付方式</th>
<th nzWidth="100px">支付金额</th>
<th nzWidth="140px">创建时间</th>
<th nzWidth="80px">状态</th>
<th nzWidth="140px">生成时间</th>
<th nzWidth="140px">支付时间</th>
<th nzWidth="140px">取消时间</th>
<th nzRight="0px" nzWidth="100px">状态</th>
<!-- <th nzWidth="150px" nzRight="0px">操作</th>-->
</tr>
</thead>
@ -84,58 +141,18 @@
<tr *ngFor="let data of ajaxTable.data; let i = index">
<td>{{i+1}}</td>
<td>{{data.goodsName}}</td>
<td>{{data.giveawayType === true ? '赠送' : '购买'}}</td>
<td>
<span *ngIf="data.giveawayType">
赠送订单
</span>
<span *ngIf="!data.giveawayType">
{{data.orderNo}}
</span>
</td>
<td>
<span *ngIf="data.giveawayType">
赠送订单
</span>
<span *ngIf="!data.giveawayType">
{{data.paySerialNo}}
</span>
</td>
<td>{{data.giveawayType}}</td>
<td>{{data.orderNo}}</td>
<td>{{data.paySerialNo}}</td>
<td>{{data.memName == null ? '暂无': data.memName}}</td>
<td>{{data.memPhone == null ? '暂无': data.memPhone}}</td>
<td>
<span *ngIf="data.giveawayType">
赠送
</span>
<span *ngIf="!data.giveawayType">
{{data.payModel == null ? '暂无': data.payModel | paymodel}}
</span>
</td>
<td>
<span *ngIf="data.giveawayType">
赠送
</span>
<span *ngIf="!data.giveawayType">
{{data.payType == null ? '暂无': data.payType | paytype}}
</span>
</td>
<td>
<span *ngIf="data.giveawayType">
0
</span>
<span *ngIf="!data.giveawayType">
{{data.payPrice == null ? '暂无': data.payPrice}}
</span>
</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>
<td>
<span *ngIf="data.giveawayType">
赠送订单
</span>
<span *ngIf="!data.giveawayType">
{{data.orderStatus | orderCouponStatus}}
</span>
</td>
<td>{{data.payModel}}</td>
<td>{{data.payType}}</td>
<td>{{data.payPrice}}</td>
<td>{{data.createTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.payTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{data.cancelTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
<td nzRight="0px">{{data.orderStatus}}</td>
<!-- <td nzRight="0px" class="table-td-operation">-->
<!-- <a *ngIf="data.status !== 101" (click)="getDetail(data.id)">订单详情</a>-->
<!-- </td>-->

@ -7,6 +7,7 @@ import {NzMessageService} from 'ng-zorro-antd';
import {Router} from '@angular/router';
import {CommonsService} from '../../../services/commons.service';
import {OrderService} from '../../../services/order.service';
import {CompanyService} from '../../../services/company.service';
@Component({
selector: 'app-order-list',
@ -16,8 +17,11 @@ import {OrderService} from '../../../services/order.service';
export class OrderListComponent implements OnInit {
WEB_SERVE_URL = environment.baseUrl;
FILE_URL = environment.imageUrl;
searchForm: FormGroup; // 搜索框
requestData = []; // 列表数据
companyData = []; // 列表数据
merchantData = []; // 列表数据
total: number; // 页码
pageNum = 1; // 页码
pageSize = 10; // 条码
@ -29,19 +33,37 @@ export class OrderListComponent implements OnInit {
private iconService: IconService,
private message: NzMessageService,
private router: Router,
private company: CompanyService,
private merchant: MerchantService,
private common: CommonsService
) {
}
ngOnInit(): void {
this.init();
const whereObject = {};
whereObject['pageNum'] = 1;
whereObject['pageSize'] = 10000;
this.company.selectCompanyList(whereObject, data => {
if (data['return_code'] === '000000') {
this.companyData = data['return_data'].list;
} else {
this.message.error(data['return_msg']);
}
});
this.getMerchantListByCompany(this.searchForm.value.companyId)
}
public init(): void {
this.searchForm = this.form.group({
memPhone: [null],
companyId: [null],
merchantId: [null],
orderNo: [null],
paySerialNo: [null],
payModel: [null],
payType: [null],
orderStatus: [null],
payTime: [null]
});
this.getRequest(true, this.searchForm.value);
}
@ -49,6 +71,12 @@ export class OrderListComponent implements OnInit {
// 查询列表
public getRequest(reset: boolean = false, whereObject: object) {
if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) {
whereObject['payTimeS'] = whereObject['payTime'][0].getTime();
whereObject['payTimeE'] = whereObject['payTime'][1].getTime();
}
this.loading = false;
if (reset) {
this.pageNum = 1;
@ -57,7 +85,6 @@ export class OrderListComponent implements OnInit {
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 {
@ -66,6 +93,21 @@ export class OrderListComponent implements OnInit {
});
}
// 查询商户
public getMerchantListByCompany(companyId: number): void {
this.merchant.getMerchantListByCompany(companyId, data => {
if (data['return_code'] === '000000') {
if (data['return_code'] === '000000') {
this.merchantData = data['return_data'];
} else {
this.message.error(data['return_msg']);
}
} else {
this.message.error(data['return_msg']);
}
});
}
// 重置
public resetForm(): void {
this.searchForm.reset();
@ -81,4 +123,23 @@ export class OrderListComponent implements OnInit {
}).then(r => console.log(r));
}
// 下载模板
downloadTemplate(whereObject) {
if (whereObject['payTime'] != null && whereObject['payTime'].length !== 0) {
whereObject['payTimeS'] = whereObject['payTime'][0].getTime();
whereObject['payTimeE'] = whereObject['payTime'][1].getTime();
}
this.order.exportGoodsOrderList(whereObject, data => {
if (data['return_code'] === '000000') {
window.location.href = this.FILE_URL + data['return_data'];
} else {
this.message.error(data['return_msg']);
}
});
}
provinceChange(e) {
console.log(e);
}
}

@ -88,5 +88,21 @@ export class MerchantService {
});
}
/**
*
*
* @param companyId companyId
* @param callBack
*/
public getMerchantListByCompany(companyId: number, callBack) {
let id = null;
if (companyId != null) {
id = 'companyId=' + companyId;
}
this.http.get(environment.baseUrl + 'highMerchant/getMerchantListByCompany?' + id).subscribe(data => {
callBack(data);
});
}
}

@ -20,8 +20,22 @@ export class OrderService {
* @param callBack
*/
public getOrderCouponList(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'highOrder/getOrderBList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
this.http.get(environment.baseUrl + 'highOrder/getGoodsOrderList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
/**
*
*
* @param paramsObject
* @param callBack
*/
public exportGoodsOrderList(paramsObject: object, callBack) {
this.http.get(environment.baseUrl + 'highOrder/exportGoodsOrderList?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
callBack(data);
});
}
}

Loading…
Cancel
Save