This commit is contained in:
wangshiming
2021-12-14 20:24:42 +08:00
parent 553d22a01e
commit 7bbd8a8bc9
13 changed files with 452 additions and 272 deletions

View File

@ -0,0 +1,23 @@
<!--
* @Author: your name
* @Date: 2021-12-14 20:08:17
* @LastEditTime: 2021-12-14 20:09:50
* @LastEditors: your name
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\supply-management\components\onecar-publish\address-list\address-list.component.html
-->
<st
#st
[bordered]="true"
[data]="service.$api_getList"
[columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams, process: reqProcess }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loadingDelay]="500"
[loading]="service.http.loading"
[widthMode]="{ type: 'strict' }"
(change)="change($event)"
>
<ng-template st-row="region" let-item let-index="index"> {{ item.province }}-{{ item.city }}-{{ item.area }} </ng-template>
</st>

View File

@ -0,0 +1,86 @@
/*
* @Author: your name
* @Date: 2021-12-14 20:08:17
* @LastEditTime: 2021-12-14 20:08:55
* @LastEditors: your name
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\supply-management\components\onecar-publish\address-list\address-list.component.ts
*/
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { STChange, STColumn, STComponent, STRequestOptions } from '@delon/abc/st';
import { processSingleSort } from '@shared';
import { NzDrawerService } from 'ng-zorro-antd/drawer';
import { NzModalService } from 'ng-zorro-antd/modal';
import { SupplyManagementService } from 'src/app/routes/order-management/services/order-management.service';
@Component({
selector: 'app-publish-address-list',
templateUrl: './address-list.component.html'
})
export class PublishAddressListComponent implements OnInit {
columns!: STColumn[];
@ViewChild('st', { static: false })
st!: STComponent;
seleteData: any;
spuStatus = '1'; // '1'客户地址,'2'收回单地址
constructor(
public router: Router,
public ar: ActivatedRoute,
private drawerService: NzDrawerService,
public service: SupplyManagementService,
private modalService: NzModalService
) {}
/**
* 查询参数
*/
get reqParams() {
return {
type: this.spuStatus
};
}
ngOnInit() {
this.initST();
}
initST() {
this.columns = [
{ title: '', index: 'id', type: 'radio', width: 70 },
{
title: '省市区',
render: 'region'
},
{
title: '详细地址',
index: 'detailedAddress'
},
{
title: '联系人',
index: 'contactName'
},
{
title: '联系电话',
index: 'contactTelephone'
},
{
title: '更新时间',
index: 'modifyTime'
}
];
}
// 排序
reqProcess(requestOptions: STRequestOptions): STRequestOptions {
return processSingleSort(requestOptions);
}
change(ret: STChange): void {
console.log('change', ret);
this.seleteData = { ...ret.radio };
}
}

View File

@ -206,7 +206,17 @@
<div class="card-title">补充信息</div>
<div nz-row>
<div nz-col nzSpan="12">
<sf #sf6 [schema]="schema6" [formData]="sf6data" [button]="'none'" [ui]="ui6"></sf>
<sf #sf6 [schema]="schema6" [formData]="sf6data" [button]="'none'" [ui]="ui6">
<ng-template sf-template="receiptUserId" let-i let-ui="ui">
<input
nz-input
[ngModel]="i.value"
(ngModelChange)="i.setValue($event)"
placeholder="请点击选择收回单地址"
(click)="backBillChange()"
/>
</ng-template>
</sf>
</div>
</div>
</nz-card>

View File

@ -15,6 +15,7 @@ import { NzModalService } from 'ng-zorro-antd/modal';
import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-famifiar.component';
import { SupplyManagementService } from '../../services/supply-management.service';
import { debug } from 'console';
import { PublishAddressListComponent } from './address-list/address-list.component';
@Component({
selector: 'app-publish-goods-onecar-publish',
templateUrl: './onecar-publish.component.html',
@ -396,7 +397,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
placeholder: '请点击选择收回单地址',
validator: val => (this.sf6?.value?.receiptType === '2' ? [{ keyword: 'required', message: '请点击选择收回单地址' }] : []),
visibleIf: {
receiptType: value => value === '2'
receiptType: value => value === 2
}
},
default: '1212'
@ -406,7 +407,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
title: '联系人',
ui: {
visibleIf: {
receiptType: value => value === '2'
receiptType: value => value === 2
}
},
readOnly: true
@ -416,7 +417,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
title: '联系电话',
ui: {
visibleIf: {
receiptType: value => value === '2'
receiptType: value => value === 2
}
},
readOnly: true
@ -426,7 +427,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
title: '所在地区',
ui: {
visibleIf: {
receiptType: value => value === '2'
receiptType: value => value === 2
}
},
readOnly: true
@ -437,7 +438,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
maxLength: 20,
ui: {
visibleIf: {
receiptType: value => value === '2'
receiptType: value => value === 2
}
},
readOnly: true
@ -628,6 +629,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
...this.sf1.value,
...this.sf5.value,
...this.sf6.value,
paymentDays: this.sf7.value.paymentDays,
loadingTime: this.validateForm1?.value?.loadingTime,
unloadingTime: this.validateForm1?.value?.unloadingTime,
unLoadingPlaceDTOList: [...this.startInfo, ...this.endInfo,],
@ -831,7 +833,23 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
receiptPay: res?.shippingInformationVO?.receiptPay ,
// subtotal: res?.shippingInformationVO?.oilCardPay ,
appendFee: res?.shippingInformationVO?.appendFee ,
paymentDays: res?.shippingInformationVO?.paymentDays ,
paymentDays: res?.paymentDays ,
}
}
backBillChange() {
const modalRef = this.modalService.create({
nzTitle: '选择收回单地址',
nzContent: PublishAddressListComponent,
nzWidth: 900,
nzComponentParams: { spuStatus: '2' },
nzOnOk: item => {
const data = item.seleteData;
if (JSON.stringify(data) === '{}') return;
this.sf6.setValue('/name4', data.contactName);
this.sf6.setValue('/name5', data.contactTelephone);
this.sf6.setValue('/name6', `${data.province}-${data.city}-${data.area}`);
this.sf6.setValue('/receiptAddress', data.detailedAddress);
}
});
}
}