diff --git a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.html b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.html
index 3790504f..fe0a8b6f 100644
--- a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.html
+++ b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.html
@@ -34,27 +34,30 @@
-
+
+
-
+
-
-
+
+
+
+ [page]="{}" [res]="{ process: afterRes }" [loading]="false" [scroll]="{ x: '1200px' }" (change)="stChange($event)">
{{ item.vatappcode }}
@@ -66,8 +69,9 @@
-
\ No newline at end of file
+
diff --git a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts
index 4cf2df39..f1c5e073 100644
--- a/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts
+++ b/src/app/routes/ticket-management/components/invoice-requested/invoice-requested.component.ts
@@ -12,6 +12,7 @@ import { NzModalService } from 'ng-zorro-antd/modal';
import { TicketService } from '../../services/ticket.service';
import { PrintOrderModalComponent } from './print-order-modal/print-order-modal.component';
import { RequestedInvoiceModalComponent } from './requested-invoice-modal/requested-invoice-modal.component';
+import { UpdateAddressModalComponent } from './update-address-modal/update-address-modal.component';
@Component({
selector: 'app-invoice-requested',
@@ -33,12 +34,9 @@ export class InvoiceRequestedComponent {
totalCallNo = 0;
selectedRows: any[] = [];
- constructor(
- public service: TicketService,
- private nzModalService: NzModalService,
- private router: Router,
- public shipperservice: ShipperBaseService
- ) {}
+
+ rejectReason = '';
+ constructor(public service: TicketService, private nzModalService: NzModalService, private router: Router) {}
beforeReq = (requestOptions: STRequestOptions) => {
if (this.resourceStatus) {
@@ -73,54 +71,84 @@ export class InvoiceRequestedComponent {
}
rejectAction(item: any[]) {
+ this.rejectReason = '';
+ if (item.length <= 0) {
+ this.service.msgSrv.warning('请选择开票申请');
+ return;
+ }
+ if (item.find(item => item.sts !== '1')) {
+ this.service.msgSrv.warning('请勿选择非待处理订单');
+ return;
+ }
const modal = this.nzModalService.create({
nzTitle: '驳回',
nzContent: this.rejectModal,
- nzFooter: [
- {
- label: '拒绝',
- type: 'default',
- onClick: () => {
- modal.destroy();
- }
- },
- {
- label: '通过',
- type: 'primary',
- onClick: () => {
- modal.destroy();
- }
+ nzOkLoading: this.service.http.loading,
+ nzOnOk: () => {
+ if (!this.rejectReason) {
+ this.service.msgSrv.warning('请填写驳回原因');
+ return false;
}
- ]
+ let ids = item.map(row => row.id);
+ this.service.request(this.service.$api_reject_invoice, ids).subscribe(res => {
+ if (res) {
+ this.service.msgSrv.success('驳回成功');
+ modal.destroy(true);
+ }
+ });
+
+ return false;
+ }
});
modal.afterClose.subscribe(res => {
- this.st.load();
+ if (res) {
+ this.st.load();
+ }
});
}
- changePice(item: any[]) {
+ /**
+ * 修改地址
+ * @param item
+ */
+ changeAddress(item: any[]) {
+ this.rejectReason = '';
+ if (item.length <= 0) {
+ this.service.msgSrv.warning('请选择开票申请');
+ return;
+ }
+ if (item.find(item => item.sts !== '1')) {
+ this.service.msgSrv.warning('请勿选择非待处理订单');
+ return;
+ }
const modal = this.nzModalService.create({
- nzTitle: '驳回',
- nzContent: this.rejectModal,
- nzFooter: [
- {
- label: '拒绝',
- type: 'default',
- onClick: () => {
- modal.destroy();
- }
- },
- {
- label: '通过',
- type: 'primary',
- onClick: () => {
- modal.destroy();
- }
+ nzTitle: '修改地址',
+ nzContent: UpdateAddressModalComponent,
+ nzOkLoading: this.service.http.loading,
+ nzOnOk: component => {
+ if (!component.sf.valid) {
+ this.service.msgSrv.warning('表单校验错误');
+ return false;
}
- ]
+ this.service
+ .request(this.service.$api_update_invoice_address, {
+ ...component.sf.value,
+
+ })
+ .subscribe(res => {
+ if (res) {
+ this.service.msgSrv.success('修改成功');
+ modal.destroy(true);
+ }
+ });
+
+ return false;
+ }
});
modal.afterClose.subscribe(res => {
- this.st.load();
+ if (res) {
+ this.st.load();
+ }
});
}
@@ -362,7 +390,7 @@ export class InvoiceRequestedComponent {
visibleIf: {
expand: (value: boolean) => value
},
- asyncData: () => this.shipperservice.getCRM()
+ asyncData: () => this.service.getCRM()
}
}
}
@@ -440,14 +468,15 @@ export class InvoiceRequestedComponent {
buttons: [
{ type: 'divider' },
{
- text: '开票
',
+ text: '开票受理
',
click: item => this.requestedInvoiceAction(item),
iif: item => item.sts === '1'
},
- // {
- // text: '驳回
',
- // click: item => this.rejectAction([item])
- // },
+ {
+ text: '驳回申请
',
+ click: item => this.rejectAction([item]),
+ iif: item => item.sts === '1'
+ },
{
text: '订单明细
',
click: item => this.router.navigate([`/ticket/invoice-requested/detail/${item?.id}`], { queryParams: { sts: item.sts } })
diff --git a/src/app/routes/ticket-management/components/invoice-requested/update-address-modal/update-address-modal.component.html b/src/app/routes/ticket-management/components/invoice-requested/update-address-modal/update-address-modal.component.html
new file mode 100644
index 00000000..c31df344
--- /dev/null
+++ b/src/app/routes/ticket-management/components/invoice-requested/update-address-modal/update-address-modal.component.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/app/routes/ticket-management/components/invoice-requested/update-address-modal/update-address-modal.component.less b/src/app/routes/ticket-management/components/invoice-requested/update-address-modal/update-address-modal.component.less
new file mode 100644
index 00000000..e69de29b
diff --git a/src/app/routes/ticket-management/components/invoice-requested/update-address-modal/update-address-modal.component.ts b/src/app/routes/ticket-management/components/invoice-requested/update-address-modal/update-address-modal.component.ts
new file mode 100644
index 00000000..ce376d0b
--- /dev/null
+++ b/src/app/routes/ticket-management/components/invoice-requested/update-address-modal/update-address-modal.component.ts
@@ -0,0 +1,102 @@
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { SFCascaderWidgetSchema, SFComponent, SFSchema } from '@delon/form';
+import { TicketService } from '../../../services/ticket.service';
+
+@Component({
+ selector: 'app-update-address-modal',
+ templateUrl: './update-address-modal.component.html',
+ styleUrls: ['./update-address-modal.component.less']
+})
+export class UpdateAddressModalComponent implements OnInit {
+ @ViewChild('sf', { static: false })
+ sf!: SFComponent;
+ schema: SFSchema = this.initSF();
+
+ constructor(public service: TicketService) {}
+
+ ngOnInit(): void {}
+
+ private initSF(): SFSchema {
+ return {
+ properties: {
+ reciname: {
+ type: 'string',
+ title: '收件人姓名',
+ ui: {
+ placeholder: '请输入'
+ }
+ },
+ recitel: {
+ type: 'string',
+ title: '联系电话',
+ format: 'mobile',
+ minLength: 1,
+ maxLength: 11,
+ ui: {
+ placeholder: '请输入',
+ errors: { required: '请输入注册电话', format: '手机号格式错误' }
+ }
+ },
+ provinceCode: { type: 'string', ui: { hidden: true } },
+ provinceName: { type: 'string', ui: { hidden: true } },
+ cityCode: { type: 'string', ui: { hidden: true } },
+ cityName: { type: 'string', ui: { hidden: true } },
+ areaCode: { type: 'string', ui: { hidden: true } },
+ areaName: { type: 'string', ui: { hidden: true } },
+ enterpriseAddressCode: {
+ type: 'number',
+ title: '收件人地区',
+ ui: {
+ grid: { xxl: 13, xl: 18, lg: 24, md: 24 },
+ widget: 'cascader',
+ valueProperty: 'regionCode',
+ placeholder: '请选择',
+ labelProperty: 'name',
+ asyncData: (node: any, index: any) => {
+ return new Promise(resolve => {
+ this.getRegionDetailByCode(node?.regionCode || '').subscribe(
+ res => {
+ node.children = res.map((item: any) => ({ ...item, isLeaf: index === 1 }));
+ },
+ _ => {},
+ () => {
+ resolve();
+ }
+ );
+ });
+ },
+ selectionChange: (node: any[]) => {
+ console.log(node);
+
+ if (node?.length > 0) {
+ this.sf.setValue('/provinceCode', node[0]?.regionCode);
+ this.sf.setValue('/provinceName', node[0]?.name);
+ this.sf.setValue('/cityCode', node[1]?.regionCode);
+ this.sf.setValue('/cityName', node[1]?.name);
+ this.sf.setValue('/areaCode', node[2]?.regionCode);
+ this.sf.setValue('/areaName', node[2]?.name);
+ }
+ }
+ } as SFCascaderWidgetSchema
+ },
+ reciaddr: {
+ type: 'string',
+ title: '详细地址',
+ ui: {
+ visibleIf: {
+ expand: (value: boolean) => value
+ }
+ }
+ }
+ },
+ required: ['reciname', 'recitel', 'reciaddr', 'enterpriseAddressCode']
+ };
+ }
+
+ /*
+ * 根据地区code查询地区列表
+ */
+ getRegionDetailByCode(regionCode: any) {
+ return this.service.request(this.service.$api_get_region_by_code, { regionCode });
+ }
+}
diff --git a/src/app/routes/ticket-management/services/ticket.service.ts b/src/app/routes/ticket-management/services/ticket.service.ts
index a235412f..a3629120 100644
--- a/src/app/routes/ticket-management/services/ticket.service.ts
+++ b/src/app/routes/ticket-management/services/ticket.service.ts
@@ -23,6 +23,10 @@ export class TicketService extends ShipperBaseService {
$api_get_invoice_requested_order_detail = '/api/fcc/ficoVatappBill/getDetailByVatapp';
// 删除开票申请订单明细
$api_remove_bill = '/api/fcc/ficoVatappBill/deletebatch';
+ // 运营端单个/批量驳回
+ $api_reject_invoice = '/api/fcc/ficoVatappH/rejectInvoiceApple';
+ // 运营端修改开票地址
+ $api_update_invoice_address = '/api/fcc/ficoVatappH/updateInvoiceAddr';
// 运营端销票处理-订单明细页面
$api_ficoVatinvHList = '/api/fcc/ficoVatinvH/ficoVatinvHList';
@@ -114,6 +118,9 @@ export class TicketService extends ShipperBaseService {
$api_get_express_routes = '/api/fcc/ficoExpressH/searchRoutes';
// 下载对账单文件
$api_downloadPdf = '/api/fcc/ficoVatappBill/downloadPdf';
+
+ // 根据地区code查询列表
+ $api_get_region_by_code = '/api/mdc/pbc/region/getRegionByCode';
constructor(public injector: Injector) {
super(injector);
diff --git a/src/app/routes/ticket-management/ticket-management.module.ts b/src/app/routes/ticket-management/ticket-management.module.ts
index a00ba72a..e0d47e51 100644
--- a/src/app/routes/ticket-management/ticket-management.module.ts
+++ b/src/app/routes/ticket-management/ticket-management.module.ts
@@ -25,6 +25,7 @@ import { AddCostDetailComponent } from './components/input-invoice/add-cost-deta
import { PrintOrderModalComponent } from './components/invoice-requested/print-order-modal/print-order-modal.component';
import { ExpressInfoComponent } from './components/express-info/express-info.component';
import { ExpressDetailModalComponent } from './components/express-info/express-detail-modal/express-detail-modal.component';
+import { UpdateAddressModalComponent } from './components/invoice-requested/update-address-modal/update-address-modal.component';
const COMPONENTS: any = [
ETCInvoicedListComponent,
@@ -51,7 +52,8 @@ const NOTROUTECOMPONENTS: any = [
AddCollectionInvoiceModalComponent,
AddCostDetailComponent,
PrintOrderModalComponent,
- ExpressDetailModalComponent
+ ExpressDetailModalComponent,
+ UpdateAddressModalComponent
];
@NgModule({
declarations: [...COMPONENTS, ...NOTROUTECOMPONENTS],