<!--添加资源-->
<nz-modal [nzMaskClosable]="false" [nzWidth]="1080" [(nzVisible)]="modal.isVisible" [nzTitle]="modal.title"
          [nzFooter]="null" (nzOnCancel)="handleCancle()">
    <div class="changeStatus">
        <span>
            <span>变更编号：</span>
            {{id}}
        </span>
        <span>
            <span>变更处理：</span>
            <button (click)="dealChange(6)" *ngIf="changeObj?.status == 6" nz-button nzType="primary">保存</button>
            <button (click)="showTransforModal()" *ngIf="changeObj?.status == 6" nz-button nzType="primary">转派</button>
            <button (click)="dealChange(7)" *ngIf="changeObj?.status == 6" nz-button nzType="primary">完成</button>
            <button *ngIf="changeObj?.status == 2" (click)="openCheckModal(3)" nz-button nzType="primary">审核通过</button>
            <button *ngIf="changeObj?.status == 2" (click)="openCheckModal(4)" nz-button nzType="primary">审核不通过</button>
            <button *ngIf="changeObj?.status == 2" (click)="openCheckModal(5)" nz-button nzType="primary">终止退回</button>
        </span>
    </div>

    <div nz-row [nzGutter]="8">
        <div nz-col [nzSpan]="12">
            <nz-card>
                <nz-tabset>
                    <nz-tab nzTitle="变更内容">
                        <div class="margin-bottom-15" nz-row [nzGutter]="8">
                            <div nz-col [nzSpan]="4">负责人</div>
                            <div nz-col [nzSpan]="8">{{changeObj?.manageUserName}}</div>
                            <div nz-col [nzSpan]="4">所在部门</div>
                            <div nz-col [nzSpan]="8">{{changeObj?.organizationName}}</div>
                        </div>
                        <div class="margin-bottom-15" nz-row [nzGutter]="8">
                            <div nz-col [nzSpan]="4">变更级别</div>
                            <div nz-col [nzSpan]="8">
                                <span *ngIf="changeObj?.type == 1">普通变更</span>
                                <span *ngIf="changeObj?.type == 2">重大变更</span>
                                <span *ngIf="changeObj?.type == 3">紧急变更</span>
                            </div>
                            <div nz-col [nzSpan]="4">变更类型</div>
                            <div nz-col [nzSpan]="8">{{changeObj?.classifyName}}</div>
                        </div>
                        <div class="margin-bottom-15" nz-row [nzGutter]="8">
                            <div nz-col [nzSpan]="4">关联项目</div>
                            <div nz-col [nzSpan]="12">{{changeObj?.projectName}}</div>
                        </div>
                        <div class="margin-bottom-15" nz-row [nzGutter]="8">
                            <div nz-col [nzSpan]="4">变更描述</div>
                            <div nz-col [nzSpan]="12">{{changeObj?.description}}</div>
                        </div>
                        <div class="margin-bottom-15" nz-row [nzGutter]="8">
                            <div nz-col [nzSpan]="4">提交时间</div>
                            <div nz-col [nzSpan]="12">
                                {{changeObj?.createTime | date:'yyyy-MM-dd HH:mm:ss'}}
                            </div>
                        </div>
                        <div class="margin-bottom-15" nz-row [nzGutter]="8">
                            <div nz-col [nzSpan]="4">变更时间</div>
                            <div nz-col [nzSpan]="12">
                                {{changeObj?.changeTime | date:'yyyy-MM-dd HH:mm:ss'}}
                            </div>
                        </div>
                        <div class="margin-bottom-15" nz-row [nzGutter]="8">
                            <div nz-col [nzSpan]="4">变更附件</div>
                            <div nz-col [nzSpan]="12">
                                <ng-container *ngFor="let file of changeObj?.files">
                                    <p>
                                        <a class="main-color cursor">{{file?.name}}</a>
                                        <a (click)="downLoad(file)">下载</a>
                                    </p>
                                </ng-container>
                            </div>
                        </div>
                    </nz-tab>
                    <nz-tab nzTitle="跟踪信息">
                        <smart-track-info #smartTrackInfo [title]="'变更跟踪信息'" [sysChangeId]="id"></smart-track-info>
                    </nz-tab>
                </nz-tabset>
            </nz-card>
        </div>
        <div nz-col [nzSpan]="12">
            <nz-card>
                <nz-tabset>
                    <nz-tab nzTitle="变更处理">
                        <div>
                            <div class="margin-bottom-15" nz-row [nzGutter]="8">
                                <div nz-col [nzSpan]="4">审核人：</div>
                                <div nz-col [nzSpan]="8">{{changeObj?.verifyUserName}}</div>
                                <div nz-col [nzSpan]="4">审核结果：</div>
                                <div nz-col [nzSpan]="8">{{changeObj?.organizationName}}</div>
                            </div>
                            <div class="margin-bottom-15" nz-row [nzGutter]="8">
                                <div nz-col [nzSpan]="4">审核意见：</div>
                                <div nz-col [nzSpan]="20">{{changeObj?.checkOpinion}}</div>
                            </div>

                            <div class="margin-bottom-15" nz-row [nzGutter]="8">
                                <div nz-col [nzSpan]="4">变更状态：</div>
                                <div nz-col [nzSpan]="20">
                                    <span *ngIf="changeObj?.status == 1">待提交</span>
                                    <span *ngIf="changeObj?.status == 2">待审核</span>
                                    <span *ngIf="changeObj?.status == 3">审核通过</span>
                                    <span *ngIf="changeObj?.status == 4">审核未通过</span>
                                    <span *ngIf="changeObj?.status == 5">退回关闭</span>
                                    <span *ngIf="changeObj?.status == 6">处理中</span>
                                    <span *ngIf="changeObj?.status == 7">变更完成</span>
                                </div>
                            </div>
                            <div *ngIf="changeObj?.status == 7" class="margin-bottom-15" nz-row [nzGutter]="8">
                                <div nz-col [nzSpan]="4">完成时间：</div>
                                <div nz-col [nzSpan]="20">{{changeObj?.finishTime || '-'}}</div>
                            </div>

                            <ng-container *ngIf="changeObj?.status == 6">
                                <nz-form-item>
                                    <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="description">处理情况</nz-form-label>
                                    <nz-form-control [nzSm]="14" [nzXs]="24">
                                        <textarea nz-input rows="2" [(ngModel)]="dealObj.changeResult"
                                                  placeholder="职责描述"></textarea>
                                    </nz-form-control>
                                </nz-form-item>
                                <nz-form-item>
                                    <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="companyName">完成时间:</nz-form-label>
                                    <nz-form-control [nzSm]="14" [nzXs]="24">
                                        <nz-date-picker nzFormat="yyyy-MM-dd" [(ngModel)]="dealObj.finishTime"
                                                        nzPlaceHolder="完成时间"></nz-date-picker>
                                    </nz-form-control>
                                </nz-form-item>
                            </ng-container>
                        </div>
                    </nz-tab>
                </nz-tabset>
            </nz-card>
        </div>
    </div>
</nz-modal>

<nz-modal [nzMaskClosable]="false" [(nzVisible)]="checkModal.isVisible" [nzTitle]="checkModal.title"
          (nzOnCancel)="checkModal.isVisible = false;checkModal.checkOpinion = ''"
          (nzOnOk)="handleOk()" [nzOkLoading]="checkModal.isOkLoading">
    <div>
        <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="checkOpinion">
            <ng-container *ngIf="checkModal.status == 3">通过意见</ng-container>
            <ng-container *ngIf="checkModal.status == 4">不通过意见</ng-container>
            <ng-container *ngIf="checkModal.status == 5">终止退回意见</ng-container>
        </nz-form-label>
        <nz-form-control [nzSm]="14" [nzXs]="24">
            <textarea nz-input name="checkOpinion" [(ngModel)]="checkModal.checkOpinion" placeholder="描述"
                      [nzAutosize]="{ minRows: 4, maxRows: 10 }"></textarea>
        </nz-form-control>
    </div>
</nz-modal>

<!--转派or派单-->
<smart-transfor #smartTransfor (done)="handleCancle()"></smart-transfor>
