短信模板
This commit is contained in:
		| @ -0,0 +1,31 @@ | ||||
| <page-header-wrapper [title]="'短信模板'"></page-header-wrapper> | ||||
|  | ||||
| <nz-card> | ||||
|     <div class="filter-wrap"> | ||||
|         <button nz-button nzType="primary" (click)="open()"><i nz-icon nzType="plus" nzTheme="outline"></i>筛选</button> | ||||
|     </div> | ||||
|     <st #st [data]="this.service.$api_smsTemplate_page " [columns]="columns" [req]="{ process: beforeReq }" | ||||
|         [loading]="false" [page]="{}"></st> | ||||
| </nz-card> | ||||
|  | ||||
| <nz-drawer [nzBodyStyle]="{ overflow: 'auto' }" [nzMaskClosable]="false" [nzWidth]="720" [nzVisible]="visible" | ||||
|     nzTitle="筛选" [nzFooter]="footerTpl" (nzOnClose)="close()"> | ||||
|     <div *nzDrawerContent> | ||||
|         <sf #sf [schema]="searchSchema" [ui]="{ '*': { spanLabelFixed: 90,grid: { span: 24 } }}" [compact]="true" | ||||
|             [button]="'none'"></sf> | ||||
|     </div> | ||||
|  | ||||
|     <ng-template #footerTpl> | ||||
|         <div style="float: right"> | ||||
|             <button nz-button style="margin-right: 8px;" (click)="close()">取消</button> | ||||
|             <button nz-button nzType="primary" (click)="search()">确认</button> | ||||
|         </div> | ||||
|     </ng-template> | ||||
| </nz-drawer> | ||||
|  | ||||
| <nz-modal [(nzVisible)]="isVisible" nzTitle="编辑" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"> | ||||
|     <ng-container *nzModalContent> | ||||
|         <sf #sfEdit [formData]="tempData" [schema]="editSchema" [ui]="{ '*': { spanLabelFixed: 90,grid: { span: 24 } }}" [compact]="true" | ||||
|             [button]="'none'"></sf> | ||||
|     </ng-container> | ||||
| </nz-modal> | ||||
| @ -0,0 +1,6 @@ | ||||
| :host::ng-deep { | ||||
|     .filter-wrap { | ||||
|         margin-bottom: 20px; | ||||
|         text-align: right; | ||||
|     } | ||||
| } | ||||
| @ -0,0 +1,144 @@ | ||||
|  | ||||
| import { Component, OnInit, ViewChild } from '@angular/core'; | ||||
| import { ActivatedRoute } from '@angular/router'; | ||||
| import { STComponent, STColumn, STChange, STRequestOptions } from '@delon/abc/st'; | ||||
| import { SFComponent, SFSchema } from '@delon/form'; | ||||
| import { NzModalService } from 'ng-zorro-antd/modal'; | ||||
| import { SystemService } from '../../services/system.service'; | ||||
|  | ||||
| @Component({ | ||||
|   selector: 'app-sms-template', | ||||
|   templateUrl: './sms-template.component.html', | ||||
|   styleUrls: ['./sms-template.component.less'] | ||||
| }) | ||||
| export class SmsTemplateComponent implements OnInit { | ||||
|   @ViewChild('st', { static: true }) | ||||
|   st!: STComponent; | ||||
|   @ViewChild('sf', { static: false }) | ||||
|   sf!: SFComponent; | ||||
|   @ViewChild('sfEdit', { static: false }) | ||||
|   sfEdit!: SFComponent; | ||||
|   visible = false; | ||||
|   isVisible = false; | ||||
|   tempData = {}; | ||||
|  | ||||
|   searchSchema: SFSchema = { | ||||
|     properties: { | ||||
|       templateCode: { | ||||
|         type: 'string', | ||||
|         title: '模板编码', | ||||
|         ui: { placeholder: '请输入模板编码' } | ||||
|       }, | ||||
|       templateContent: { | ||||
|         type: 'string', | ||||
|         title: '模板内容', | ||||
|         ui: { placeholder: '请输入模板内容' } | ||||
|       } | ||||
|     } | ||||
|   }; | ||||
|  | ||||
|   editSchema: SFSchema = { | ||||
|     properties: { | ||||
|       templateCode: { | ||||
|         type: 'string', | ||||
|         title: '模板编码', | ||||
|         ui: { placeholder: '请输入模板编码' } | ||||
|       }, | ||||
|       templateContent: { | ||||
|         type: 'string', | ||||
|         title: '模板内容', | ||||
|         ui: { placeholder: '请输入模板内容' } | ||||
|       }, | ||||
|       templateName: { | ||||
|         type: 'string', | ||||
|         title: '模板名称', | ||||
|         ui: { placeholder: '请输入模板名称' } | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   columns: STColumn[] = [ | ||||
|     { title: '模板编码', className: 'text-center', index: 'templateCode' }, | ||||
|     { title: '模板内容', className: 'text-center', index: 'templateContent' }, | ||||
|     // { | ||||
|     //   title: '创建人', className: 'text-center', index: 'content', | ||||
|     // }, | ||||
|     { | ||||
|       title: '更新时间', | ||||
|       index: 'modifyTime', | ||||
|       type: 'date', | ||||
|       className: 'text-center' | ||||
|     }, | ||||
|     { | ||||
|       title: '操作', | ||||
|       buttons: [ | ||||
|         { | ||||
|           text: '编辑', | ||||
|           click: i => this.edit(i), | ||||
|         } | ||||
|       ] | ||||
|     } | ||||
|   ]; | ||||
|  | ||||
|   constructor(public service: SystemService, private nzModalService: NzModalService, private route: ActivatedRoute) { | ||||
|   } | ||||
|  | ||||
|   ngOnInit(): void { } | ||||
|  | ||||
|   beforeReq = (requestOptions: STRequestOptions) => { | ||||
|     if (this.sf) { | ||||
|       Object.assign(requestOptions.body, { ...this.sf.value }); | ||||
|     } | ||||
|     return requestOptions; | ||||
|   }; | ||||
|  | ||||
|   edit(item: any) { | ||||
|     // console.log(item); | ||||
|     this.tempData = item; | ||||
|     this.isVisible = true; | ||||
|   } | ||||
|  | ||||
|   search() { | ||||
|     this.st.reload(1); | ||||
|     this.visible = false; | ||||
|   } | ||||
|  | ||||
|   open(): void { | ||||
|     this.visible = true; | ||||
|   } | ||||
|  | ||||
|   close(): void { | ||||
|     this.visible = false; | ||||
|   } | ||||
|  | ||||
|   handleOk(): void { | ||||
|     const value = this.sfEdit.value; | ||||
|     const { id, templateCode, templateName, templateContent } = value | ||||
|     const params = { | ||||
|       id, | ||||
|       templateCode, | ||||
|       templateName, | ||||
|       templateContent | ||||
|     } | ||||
|  | ||||
|     this.service.request(this.service.$api_smsTemplate_edit, params).subscribe(res => { | ||||
|       // console.log(res); | ||||
|       if (res) { | ||||
|         this.isVisible = false; | ||||
|         this.st.reload(); | ||||
|       } | ||||
|     }) | ||||
|  | ||||
|   } | ||||
|  | ||||
|   handleCancel(): void { | ||||
|     this.isVisible = false; | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * 重置表单 | ||||
|    */ | ||||
|   resetSF() { | ||||
|     this.sf.reset(); | ||||
|   } | ||||
| } | ||||
| @ -185,6 +185,12 @@ export class SystemService extends BaseService { | ||||
|   $api_getAppList: string = ''; | ||||
|   $api_getRoleTemplateListByAppId: string = ''; | ||||
|   $api_updateRoleInfo: string = ''; | ||||
|  | ||||
|   // 短信模板list | ||||
|   $api_smsTemplate_page = '/api/mdc/pbc/smsTemplate/list/page'; | ||||
|   // 短信模板编辑 | ||||
|   $api_smsTemplate_edit = '/api/mdc/pbc/smsTemplate/save'; | ||||
|  | ||||
|   constructor(public injector: Injector) { | ||||
|     super(injector); | ||||
|   } | ||||
|  | ||||
| @ -25,6 +25,7 @@ import { AnnouncementMessageComponent } from './components/announcement-message/ | ||||
| import { InsuranceSetComponent } from './components/insurance-set/insurance-set.component'; | ||||
| import { NetworkFreightNewComponent } from './components/network-freight/new/new.component'; | ||||
| import { NoTeManagementComponent } from './components/note-management/note-management.component'; | ||||
| import { SmsTemplateComponent } from './components/sms-template/sms-template.component'; | ||||
|  | ||||
| const routes: Routes = [ | ||||
|   { path: 'staff-management', component: StaffManagementComponent }, | ||||
| @ -44,7 +45,8 @@ const routes: Routes = [ | ||||
|   { path: 'close-account', component: CloseAccountComponent }, | ||||
|   // { path: 'btn-management', component: BtnManagementComponent }, | ||||
|   { path: 'announcement-message', component: AnnouncementMessageComponent }, | ||||
|   { path: 'insurance-set', component: InsuranceSetComponent } | ||||
|   { path: 'insurance-set', component: InsuranceSetComponent }, | ||||
|   { path: 'sms-template', component: SmsTemplateComponent} | ||||
| ]; | ||||
|  | ||||
| @NgModule({ | ||||
|  | ||||
| @ -33,6 +33,7 @@ import { AnnouncementMessageComponent } from './components/announcement-message/ | ||||
| import { InsuranceSetComponent } from './components/insurance-set/insurance-set.component'; | ||||
| import { NetworkFreightNewComponent } from './components/network-freight/new/new.component'; | ||||
| import { NoTeManagementComponent } from './components/note-management/note-management.component'; | ||||
| import { SmsTemplateComponent } from './components/sms-template/sms-template.component'; | ||||
|  | ||||
| const COMPONENTS = [ | ||||
|   StaffManagementComponent, | ||||
| @ -50,7 +51,8 @@ const COMPONENTS = [ | ||||
|   NetworkFreightNewComponent, | ||||
|   AnnouncementMessageComponent, | ||||
|   InsuranceSetComponent, | ||||
|   NoTeManagementComponent | ||||
|   NoTeManagementComponent, | ||||
|   SmsTemplateComponent | ||||
| ]; | ||||
| const NOTROUTECOMPONENTS = [ | ||||
|   BuyerTranspowerComponent, | ||||
|  | ||||
| @ -34,7 +34,9 @@ | ||||
|       <span *ngIf="item?.putStatus == '1'">已上传</span> | ||||
|       <span *ngIf="item?.putStatus == '3'">上传中</span> | ||||
|       <span  *ngIf="item?.putStatus == '2'" style="color: red;" (click)="unnormal(item)">上传异常</span> | ||||
|  | ||||
|     </ng-template> | ||||
|     <ng-template st-row="invoiceNO" let-item let-index="index"> | ||||
|       <a href="/">{{item.billCode}}</a> | ||||
|     </ng-template> | ||||
|     <ng-template st-row="checkStatus" let-item let-index="index"> | ||||
|       <!-- <a (click)="viewAuditResult(item)" *ngIf="item?.billStatus === '2'">{{item?.billStatusLabel}}</a> --> | ||||
|  | ||||
| @ -222,6 +222,7 @@ export class TaxManagementInvoiceReportingComponent implements OnInit { | ||||
|       { | ||||
|         title: '发票号码', | ||||
|         index: 'billCode', | ||||
|         render: 'invoiceNO', | ||||
|         className: 'text-center', | ||||
|         width: '150px', | ||||
|       }, | ||||
|  | ||||
		Reference in New Issue
	
	Block a user