袁野 3 months ago
parent ef17d9f108
commit b1bc3d43c7
  1. 8
      package-lock.json
  2. 2
      package.json
  3. 14
      src/app/pages/body/index/index.component.html
  4. 22
      src/app/pages/body/index/index.component.less
  5. 19
      src/app/pages/body/index/index.component.ts
  6. 2
      src/app/pages/trade/goods-list/goods-list.component.html
  7. 27
      src/app/pages/trade/goods-list/goods-list.component.ts
  8. 2
      src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.html
  9. 4
      src/app/pages/trade/goods-logistics-list/goods-logistics-list.component.ts

8
package-lock.json generated

@ -22,7 +22,7 @@
"ng-zorro-antd": "^17.1.0", "ng-zorro-antd": "^17.1.0",
"rxjs": "~7.8.0", "rxjs": "~7.8.0",
"tslib": "^2.3.0", "tslib": "^2.3.0",
"typescript": "5.4", "typescript": "5.2",
"zone.js": "~0.14.2" "zone.js": "~0.14.2"
}, },
"devDependencies": { "devDependencies": {
@ -11348,9 +11348,9 @@
"dev": true "dev": true
}, },
"node_modules/typescript": { "node_modules/typescript": {
"version": "5.4.5", "version": "5.2.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
"tsserver": "bin/tsserver" "tsserver": "bin/tsserver"

@ -25,7 +25,7 @@
"ng-zorro-antd": "^17.1.0", "ng-zorro-antd": "^17.1.0",
"rxjs": "~7.8.0", "rxjs": "~7.8.0",
"tslib": "^2.3.0", "tslib": "^2.3.0",
"typescript": "5.4", "typescript": "5.2",
"zone.js": "~0.14.2" "zone.js": "~0.14.2"
}, },
"devDependencies": { "devDependencies": {

@ -34,10 +34,9 @@
<nz-list-item *ngFor="let item of tableData | dataUtils : 5;"> <nz-list-item *ngFor="let item of tableData | dataUtils : 5;">
<span *ngIf="item.status == 1" style="font-size: 20px" nz-icon [nzType]="'check-circle'" [nzTheme]="'twotone'" [nzTwotoneColor]="'#52c41a'"></span> <span *ngIf="item.status == 1" style="font-size: 20px" nz-icon [nzType]="'check-circle'" [nzTheme]="'twotone'" [nzTwotoneColor]="'#52c41a'"></span>
<span *ngIf="item.status === 2" style="font-size: 20px" nz-icon [nzType]="'sync'" [nzSpin]="true"></span> <span *ngIf="item.status === 2" style="font-size: 20px" nz-icon [nzType]="'sync'" [nzSpin]="true"></span>
<span *ngIf="item.status === 3" style="font-size: 20px" nz-icon nzType="close-circle" nzTheme="twotone" [nzTwotoneColor]="'red'"></span>
<span nz-typography>{{item.title}}</span> <span nz-typography>{{item.title}}</span>
<a><span *ngIf="item.status == 1" style="font-size: 20px" nz-icon [nzIconfont]="'icon-xiazai'"></span></a> <a><span *ngIf="item.status == 1" style="font-size: 20px" nz-icon [nzIconfont]="'icon-xiazai'" (click)="getDownLoad(item.id)"></span></a>
<span *ngIf="item.status == 3" style="font-size: 20px; color: red">失败</span> <span *ngIf="item.status === 3" style="font-size: 20px" nz-icon nzType="close-circle" nzTheme="twotone" [nzTwotoneColor]="'red'"></span>
</nz-list-item> </nz-list-item>
<nz-list-empty *ngIf="tableData.length == 0" /> <nz-list-empty *ngIf="tableData.length == 0" />
<nz-list-footer *ngIf="tableData.length != 0" style="text-align: center"> <nz-list-footer *ngIf="tableData.length != 0" style="text-align: center">
@ -47,6 +46,10 @@
</div> </div>
</ng-template> </ng-template>
<div class="button-up" *ngIf="showComponent">
正在导出中,请稍后在此处进行下载
</div>
<div class="to_top" *ngIf="showComponent"></div>
</div> </div>
</div> </div>
</div> </div>
@ -100,8 +103,9 @@
<td>{{ data.downloadTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td> <td>{{ data.downloadTime | date: 'yyyy-MM-dd HH:mm:ss'}}</td>
<td>{{ data.status | status}}</td> <td>{{ data.status | status}}</td>
<td> <td>
<a *ngIf="data.downloadStatus == 2" (click)="getDownLoad(data.id)">下载</a> <a *ngIf="data.downloadStatus == 2 && data.status == 1" (click)="getDownLoad(data.id)">下载</a>
<a *ngIf="data.downloadStatus == 1" (click)="getDownLoad(data.id)">重新下载</a> <a *ngIf="data.downloadStatus == 1 && data.status == 1" (click)="getDownLoad(data.id)">重新下载</a>
<span *ngIf="data.status === 3" style="font-size: 20px" nz-icon nzType="close-circle" nzTheme="twotone" [nzTwotoneColor]="'red'"></span>
</td> </td>
</tr> </tr>
</tbody> </tbody>

@ -70,3 +70,25 @@ nz-content {
.file-downLoad { .file-downLoad {
width: 300px; width: 300px;
} }
.button-up {
font-size: 16px;
padding: 10px;
top: 48px;
left: 22px;
z-index: 999;
border-radius: 5px;
position:absolute;
height: 80px;
width: 280px;
background-color: rgba(0, 0, 0, 0.7);
}
.to_top {
z-index: 999;
top: 40px;
position:absolute;
width: 0;
height: 0;
border-bottom: 8px solid rgba(0, 0, 0, 0.7);
border-left: 8px solid transparent;
border-right: 8px solid transparent;
}

@ -38,6 +38,9 @@ import {NzTimelineComponent, NzTimelineItemComponent} from "ng-zorro-antd/timeli
import {NzTableComponent, NzTableModule} from "ng-zorro-antd/table"; import {NzTableComponent, NzTableModule} from "ng-zorro-antd/table";
import {BusinessTypePipe} from "../../../pipes/file/business-type.pipe"; import {BusinessTypePipe} from "../../../pipes/file/business-type.pipe";
import {StatusPipe} from "../../../pipes/file/status.pipe"; import {StatusPipe} from "../../../pipes/file/status.pipe";
import {NzPopconfirmDirective} from "ng-zorro-antd/popconfirm";
import {NzButtonComponent} from "ng-zorro-antd/button";
import {NzBadgeComponent} from "ng-zorro-antd/badge";
@Component({ @Component({
selector: 'app-index', selector: 'app-index',
@ -85,7 +88,10 @@ import {StatusPipe} from "../../../pipes/file/status.pipe";
NzTableComponent, NzTableComponent,
NzModalContentDirective, NzModalContentDirective,
BusinessTypePipe, BusinessTypePipe,
StatusPipe StatusPipe,
NzPopconfirmDirective,
NzButtonComponent,
NzBadgeComponent
], ],
templateUrl: './index.component.html', templateUrl: './index.component.html',
styleUrl: './index.component.less', styleUrl: './index.component.less',
@ -111,6 +117,7 @@ export class IndexComponent {
currentParentMenu: any = {}; currentParentMenu: any = {};
downloadType = 1; downloadType = 1;
interval: any; interval: any;
showComponent = false;
constructor( constructor(
private commonService: CommonService, private commonService: CommonService,
private storage: BrowserStorageService, private storage: BrowserStorageService,
@ -124,6 +131,7 @@ export class IndexComponent {
) { ) {
this.communicationService.currentMessage.subscribe(message => { this.communicationService.currentMessage.subscribe(message => {
this.showComponent = true;
this.fileRecords(); this.fileRecords();
this.findFileRecords(message.id); this.findFileRecords(message.id);
this.downloadType = 2; this.downloadType = 2;
@ -212,13 +220,14 @@ export class IndexComponent {
public findFileRecords(id: number) { public findFileRecords(id: number) {
this.interval = setInterval(() => this.fileService.findFileRecords(id, (data: any) => { this.interval = setInterval(() => this.fileService.findFileRecords(id, (data: any) => {
if (data['return_code'] == '000000') { if (data['return_code'] == '000000') {
if (data['return_data'].status == 1) { if (data['return_data'].status == 1 || data['return_data'].status == 3) {
this.showComponent = false;
clearTimeout(this.interval); clearTimeout(this.interval);
console.log("完成");
this.downloadType = 1; this.downloadType = 1;
this.fileRecords(); this.fileRecords();
} }
}else { }else {
this.showComponent = false;
clearTimeout(this.interval); clearTimeout(this.interval);
this.fileRecords(); this.fileRecords();
this.downloadType = 1; this.downloadType = 1;
@ -233,10 +242,12 @@ export class IndexComponent {
public getDownLoad(id: number) { public getDownLoad(id: number) {
this.fileService.getDownLoad(id, (data: any) => { this.fileService.getDownLoad(id, (data: any) => {
if (data['return_code'] == '000000') { if (data['return_code'] == '000000') {
window.location.href = data['return_data']; this.fileRecords();
window.open(data['return_data']);
}else { }else {
this.message.error(data['return_msg']); this.message.error(data['return_msg']);
} }
}) })
} }
} }

@ -202,7 +202,7 @@
</a> </a>
<nz-dropdown-menu #menu="nzDropdownMenu"> <nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable> <ul nz-menu nzSelectable>
<li nz-menu-item *ngIf="data.logisticsNo != null" (click)="showLogisticsNo(data.logisticsNo)"><a>查看物流</a></li> <li nz-menu-item *ngIf="data.logisticsNo != null" (click)="showLogisticsNo(data.id)"><a>查看物流</a></li>
</ul> </ul>
</nz-dropdown-menu> </nz-dropdown-menu>
</td> </td>

@ -260,39 +260,16 @@ export class GoodsListComponent {
}); });
} }
getLogisticsNo(id: number): void {
this.getRequest(false);
this.goodsOrderId = id;
this.isVisible = true;
}
showDetail(data: OrderGoodsData): void { showDetail(data: OrderGoodsData): void {
this.orderGoodsData = data; this.orderGoodsData = data;
this.findDeliveryAddressById(data.deliveryAddressId); this.findDeliveryAddressById(data.deliveryAddressId);
this.orderDetailModal = true; this.orderDetailModal = true;
} }
handleOk(): void {
let params = {
id: this.goodsOrderId,
logisticsNo: this.logisticsNo,
time: new Date().getTime()
}
this.orderGoodsService.updateLogisticsNo(params , (data: any) => {
if (data['return_code'] == '000000') {
this.isVisible = false;
this.msg.success("成功")
} else {
this.msg.error(data['return_msg']);
}
});
}
showLogisticsNo(logisticsNo: string): void { showLogisticsNo(id: number): void {
let params = { let params = {
logisticsNo:logisticsNo, id:id,
time: new Date().getTime() time: new Date().getTime()
} }

@ -188,7 +188,7 @@
<nz-dropdown-menu #menu="nzDropdownMenu"> <nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable> <ul nz-menu nzSelectable>
<li nz-menu-item (click)="getLogisticsNo(data.id)"><a>录入物流编码</a></li> <li nz-menu-item (click)="getLogisticsNo(data.id)"><a>录入物流编码</a></li>
<li nz-menu-item *ngIf="data.logisticsNo != null" (click)="showLogisticsNo(data.logisticsNo)"><a>查看物流</a></li> <li nz-menu-item *ngIf="data.logisticsNo != null" (click)="showLogisticsNo(data.id)"><a>查看物流</a></li>
</ul> </ul>
</nz-dropdown-menu> </nz-dropdown-menu>
</td> </td>

@ -278,9 +278,9 @@ export class GoodsLogisticsListComponent {
}); });
} }
showLogisticsNo(logisticsNo: string): void { showLogisticsNo(id: number): void {
let params = { let params = {
logisticsNo:logisticsNo, id:id,
time: new Date().getTime() time: new Date().getTime()
} }

Loading…
Cancel
Save