车辆对接
This commit is contained in:
		@ -0,0 +1,57 @@
 | 
			
		||||
<!--
 | 
			
		||||
 * @Author: your name
 | 
			
		||||
 * @Date: 2022-01-05 11:01:55
 | 
			
		||||
 * @LastEditTime: 2022-01-05 13:47:31
 | 
			
		||||
 * @LastEditors: Please set LastEditors
 | 
			
		||||
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 | 
			
		||||
 * @FilePath: \tms-obc-web\src\app\routes\contract-management\components\contract-template-detail\contract-template-detail.component.html
 | 
			
		||||
-->
 | 
			
		||||
<!-- 页头 -->
 | 
			
		||||
<page-header-wrapper [logo]="logo" [title]="textStatus" [content]="headerContent">
 | 
			
		||||
  <ng-template #logo>
 | 
			
		||||
    <button nz-button nz-tooltip nzTooltipTitle="返回上一页" (click)="goBack()">
 | 
			
		||||
      <i nz-icon nzType="left" nzTheme="outline"></i>
 | 
			
		||||
    </button>
 | 
			
		||||
  </ng-template>
 | 
			
		||||
  <ng-template #headerContent>
 | 
			
		||||
    <div nz-row style="display: flex; justify-content: end;">
 | 
			
		||||
      <div nz-col >
 | 
			
		||||
        <button nz-button nzSize="large" nzType="default" (click)="cancel()">取消</button>
 | 
			
		||||
        <button class="ml-lg" nz-button nzSize="large" nzType="primary" (click)="save()">保存</button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </ng-template>
 | 
			
		||||
</page-header-wrapper>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<nz-card >
 | 
			
		||||
  <sf #sf [schema]="schema"  [formData]="sfdata" [button]="'none'" [ui]="ui"></sf>
 | 
			
		||||
</nz-card>
 | 
			
		||||
 | 
			
		||||
<nz-card>
 | 
			
		||||
  <div nz-col nzSpan="20" style="overflow: scroll">
 | 
			
		||||
    <nz-card class="card-height" *ngIf="isUpdate">
 | 
			
		||||
      <div class="mb-md">
 | 
			
		||||
        <div></div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div [innerHTML]="templateHTML | safehtml"></div>
 | 
			
		||||
    </nz-card>
 | 
			
		||||
 | 
			
		||||
    <nz-card class="card-height" *ngIf="!isUpdate">
 | 
			
		||||
      <div nz-row nzGutter="8">
 | 
			
		||||
        <div nz-col nzSpan="24">
 | 
			
		||||
          <input nz-input placeholder="请输入合同标题" [(ngModel)]="title" />
 | 
			
		||||
        </div>
 | 
			
		||||
        <div nz-col nzSpan="24" style="margin-top: 15px;">
 | 
			
		||||
          <sf #sf2 mode="edit" [schema]="schema2" [ui]="{ '*': { spanLabelFixed: 10, grid: { span: 24 }} }"
 | 
			
		||||
            button="none"> </sf>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
  
 | 
			
		||||
    </nz-card>
 | 
			
		||||
  </div>
 | 
			
		||||
</nz-card>
 | 
			
		||||
<!-- <div class="mb-md save-btn">
 | 
			
		||||
  <button nz-button nzSize="large" nzType="default" (click)="cancel()">取消</button>
 | 
			
		||||
  <button class="ml-lg" nz-button nzSize="large" nzType="primary" (click)="save()">保存</button>
 | 
			
		||||
</div> -->
 | 
			
		||||
@ -0,0 +1,31 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: your name
 | 
			
		||||
 * @Date: 2021-11-29 20:19:08
 | 
			
		||||
 * @LastEditTime: 2021-11-29 20:31:00
 | 
			
		||||
 * @LastEditors: your name
 | 
			
		||||
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 | 
			
		||||
 * @FilePath: \tms-obc-web\src\app\routes\usercenter\components\freight\list\detail\detail.component.spec.ts
 | 
			
		||||
 */
 | 
			
		||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
 | 
			
		||||
import { UserCenterComponentsDriverDetailComponent } from './contract-template-detail.component';
 | 
			
		||||
 | 
			
		||||
describe('UserCenterComponentsDriverDetailComponent', () => {
 | 
			
		||||
  let component: UserCenterComponentsDriverDetailComponent;
 | 
			
		||||
  let fixture: ComponentFixture<UserCenterComponentsDriverDetailComponent>;
 | 
			
		||||
 | 
			
		||||
  beforeEach(async(() => {
 | 
			
		||||
    TestBed.configureTestingModule({
 | 
			
		||||
      declarations: [UserCenterComponentsDriverDetailComponent],
 | 
			
		||||
    }).compileComponents();
 | 
			
		||||
  }));
 | 
			
		||||
 | 
			
		||||
  beforeEach(() => {
 | 
			
		||||
    fixture = TestBed.createComponent(UserCenterComponentsDriverDetailComponent);
 | 
			
		||||
    component = fixture.componentInstance;
 | 
			
		||||
    fixture.detectChanges();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  it('should create', () => {
 | 
			
		||||
    expect(component).toBeTruthy();
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
@ -0,0 +1,135 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: your name
 | 
			
		||||
 * @Date: 2022-01-05 11:01:55
 | 
			
		||||
 * @LastEditTime: 2022-01-05 13:51:44
 | 
			
		||||
 * @LastEditors: Please set LastEditors
 | 
			
		||||
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 | 
			
		||||
 * @FilePath: \tms-obc-web\src\app\routes\contract-management\components\contract-template-detail\contract-template-detail.component.ts
 | 
			
		||||
 */
 | 
			
		||||
import { DatePipe } from '@angular/common';
 | 
			
		||||
import { Component, OnInit, ViewChild } from '@angular/core';
 | 
			
		||||
import { ActivatedRoute } from '@angular/router';
 | 
			
		||||
import { apiConf } from '@conf/api.conf';
 | 
			
		||||
import { STColumn, STComponent } from '@delon/abc/st';
 | 
			
		||||
import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFTagWidgetSchema, SFTextWidgetSchema, SFUISchema } from '@delon/form';
 | 
			
		||||
import { ModalHelper, _HttpClient } from '@delon/theme';
 | 
			
		||||
import { NzMessageService } from 'ng-zorro-antd/message';
 | 
			
		||||
import { NzModalService } from 'ng-zorro-antd/modal';
 | 
			
		||||
import { of } from 'rxjs';
 | 
			
		||||
import { map } from 'rxjs/operators';
 | 
			
		||||
import { ImageViewComponent } from 'src/app/shared/components/imagelist';
 | 
			
		||||
import { ContractManagementService } from '../../services/contract-management.service';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'app-contract-management-template-detail-complaint',
 | 
			
		||||
  templateUrl: './contract-template-detail.component.html',
 | 
			
		||||
  styleUrls: ['./contract-template-detail.component.less'],
 | 
			
		||||
  providers: [DatePipe]
 | 
			
		||||
})
 | 
			
		||||
export class UserCenterComponentsDriverDetailComponent implements OnInit {
 | 
			
		||||
 | 
			
		||||
  constructor(
 | 
			
		||||
    private nzModalService: NzModalService,
 | 
			
		||||
    public service: ContractManagementService,
 | 
			
		||||
    public route: ActivatedRoute,
 | 
			
		||||
    private datePipe: DatePipe
 | 
			
		||||
  ) {}
 | 
			
		||||
  textStatus = '新建模板'
 | 
			
		||||
  @ViewChild('sf', { static: false }) sf!: SFComponent;
 | 
			
		||||
  schema: SFSchema = {};
 | 
			
		||||
  @ViewChild('sf2', { static: false }) sf2!: SFComponent;
 | 
			
		||||
  schema2: SFSchema = {};
 | 
			
		||||
  ui!: SFUISchema;
 | 
			
		||||
  sfdata: any;
 | 
			
		||||
  title: any;
 | 
			
		||||
  templateHTML: any;
 | 
			
		||||
  isUpdate = false;
 | 
			
		||||
  ngOnInit() {
 | 
			
		||||
    this.initSF()
 | 
			
		||||
    this.initSF2()
 | 
			
		||||
    if(this.route.snapshot.queryParams.status == 3) {
 | 
			
		||||
      console.log('进来了吗')
 | 
			
		||||
      // 新建
 | 
			
		||||
      this.isUpdate = false;
 | 
			
		||||
    } else {
 | 
			
		||||
      // 编辑
 | 
			
		||||
      this.textStatus = '编辑模板';
 | 
			
		||||
      this.isUpdate =true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    console.log(this.route.snapshot.params.id)
 | 
			
		||||
    console.log(this.route.snapshot.queryParams.status)
 | 
			
		||||
  }
 | 
			
		||||
  goBack() {
 | 
			
		||||
    window.history.go(-1)
 | 
			
		||||
  }
 | 
			
		||||
  initSF() {
 | 
			
		||||
    this.schema = {
 | 
			
		||||
      properties: {
 | 
			
		||||
        phon: {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          title: '模版名称',
 | 
			
		||||
        },
 | 
			
		||||
        stateReceipt: {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          title: '是否回单',
 | 
			
		||||
          enum: [
 | 
			
		||||
            { label: '需要', value: true },
 | 
			
		||||
            { label: '不需要', value: false }
 | 
			
		||||
          ],
 | 
			
		||||
          ui: {
 | 
			
		||||
            widget: 'select',
 | 
			
		||||
            errors: { required: '请选择' },
 | 
			
		||||
            placeholder: '请选择'
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
        enterpriseProjectId: {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          title: '项目',
 | 
			
		||||
          ui: {
 | 
			
		||||
            widget: 'select',
 | 
			
		||||
            placeholder: '请选择',
 | 
			
		||||
            visibleIf: {
 | 
			
		||||
              stateReceipt: value => value === true
 | 
			
		||||
            }
 | 
			
		||||
          } as SFSelectWidgetSchema
 | 
			
		||||
        },
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
    this.ui = {
 | 
			
		||||
      '*': {
 | 
			
		||||
        spanLabelFixed: 120,
 | 
			
		||||
        grid: { span: 8 }
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
  initSF2(data?: any) {
 | 
			
		||||
    this.schema2 = {
 | 
			
		||||
      properties: {
 | 
			
		||||
        content: {
 | 
			
		||||
          type: 'string',
 | 
			
		||||
          title: '',
 | 
			
		||||
          ui: {
 | 
			
		||||
            widget: 'tinymce',
 | 
			
		||||
            loadingTip: 'loading...',
 | 
			
		||||
            config: {
 | 
			
		||||
              height: 650
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
          default: data?.agreementContent || ''
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  cancel() {
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  save () {
 | 
			
		||||
    console.log(this.sf.value);
 | 
			
		||||
    console.log(this.sfdata);
 | 
			
		||||
    console.log(this.sf2.value);
 | 
			
		||||
    console.log(this.title);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user