<wxs module="format" src="/utils/format.wxs"></wxs>
<view class="header_title">
    <view class="header_title_row">
        <van-row>
            <van-col span="4">
                <view class="header_img" bindtap="returnToPage">
                    <image src="/images/left.png"></image>
                </view>
            </van-col>
            <van-col span="16">
                <view class="header_name">流程申请详情</view>
            </van-col>
        </van-row>
    </view>
</view>
<view class="max_content">
    <van-steps steps="{{ stepList }}" active="{{ active }}" />
    <view class="inspect_overview inspect_overview_max">
        <view class="gk_open" style="margin-top: 20rpx;border: 1px solid transparent;">
            <van-collapse value="{{activeName}}" bind:change="onChange">
                <van-collapse-item title="审批日志" name="2">
                    <view class="inspect_list">
                        <view class="inspect_for" wx:for="{{flowRecordList}}" wx:key="index">
                            <view class="inspect_for_bgd">
                                <view class="inspect_list_title">
                                    <view class="inspect_list_title_label inspect_list_title_width">
                                        <view class="inspect_list_title_number">{{(flowRecordList.length-index) < 9 ?'0'+(flowRecordList.length-index):(flowRecordList.length-index)}}</view>
                                                <view class="module_title module_title_flex inspect_list_title_text">{{item.taskName}}{{item.commentResult}}
                                                    <text wx:if="{{item.commentResult=='通过'}}" class="timeline_for_state_1 color_green">{{item.commentResult}}</text>
                                                    <text wx:if="{{item.commentResult=='驳回'}}" class="timeline_for_state_2 color_purple">{{item.commentResult}}</text>
                                                </view>
                                        </view>
                                    </view>
                                    <view class="inspect_list_info gk_open_con">
                                        <view wx:if="{{item.assigneeName}}">
                                            <image src="/images/lw_3.png"></image>办理用户：<text>{{item.assigneeName}}</text>
                                        </view>
                                        <view wx:if="{{item.assigneeName}}">
                                            <image src="/images/s_1.png"></image>办理单位：<text class="color_blue">{{item.deptName}}</text>
                                        </view>
                                        <view wx:if="{{item.candidate}}">
                                            <image src="/images/s_2.png"></image>候选办理：<text>{{item.candidate}}</text>
                                        </view>
                                        <view wx:if="{{item.deleteReason}}">
                                            <image src="/images/s_18.png"></image>驳回节点：<text>{{item.deleteReason}}</text>
                                        </view>
                                        <view>
                                            <image src="/images/s_6.png"></image>接收时间：<text>{{item.startTime}}</text>
                                        </view>
                                        <view wx:if="{{item.endTime}}">
                                            <image src="/images/lw_8.png"></image>处理时间：<text>{{item.endTime}}</text>
                                        </view>
                                        <view wx:if="{{item.duration}}">
                                            <image src="/images/img_11.png"></image>处理耗时：<text>{{item.duration}}</text>
                                        </view>
                                        <view wx:if="{{item.message}}">
                                            <image src="/images/s_7.png"></image>处理意见：<text>{{item.message}}</text>
                                        </view>
                                    </view>
                                </view>
                            </view>
                        </view>
                </van-collapse-item>
            </van-collapse>
        </view>
    </view>
    <view class="inspect_info">
        <view class="inspect_overview_list">
            <van-row>
                <van-col span="6"><text class="color_purple">临建项目</text></van-col>
                <van-col span="18" class="color_orange">{{ options.projectName||options.businessKeyName }}</van-col>
            </van-row>
        </view>
        <view class="inspect_overview_list">
            <van-row>
                <van-col span="6"><text class="color_purple">使用单位</text></van-col>
                <van-col span="18" class="color_blue">{{infoData.createByDeptName}}</van-col>
            </van-row>
        </view>
        <view class="inspect_overview_list">
            <van-row>
                <van-col span="6"><text class="color_purple">使用时间</text></van-col>
                <van-col span="18">{{infoData.useTime}}</van-col>
            </van-row>
        </view>
        <view class="inspect_overview_list">
            <van-row>
                <van-col span="6"><text class="color_purple">申请原因</text></van-col>
                <van-col span="18">{{infoData.applyReason}}</van-col>
            </van-row>
        </view>
        <view class="inspect_overview_list" wx:if="{{minImageList.length>0 || fileNames.length>0}}">
            <van-row>
                <van-col span="6"><text class="color_purple">申请附件</text></van-col>
                <view class="problem_list_info_con in-img-max" wx:if="{{minImageList.length>0}}">
                    <view class="in-img-div" wx:for="{{minImageList}}" wx:key="index">
                        <image bindtap='showImg' data-set="{{item.path}}" src='{{item.murl}}'></image>
                    </view>
                </view>
                <van-col span="18" class="color_blue" wx:if="{{fileNames.length>0}}">
                    <view class="files" wx:for="{{fileNames}}" wx:key="index">
                        <text data-set="{{item}}" style="word-wrap: break-word;" bindtap='downFile'>{{item.name}}</text>
                    </view>
                </van-col>
            </van-row>
        </view>
        <view class="inspect_overview_list">
            <van-row>
                <van-col span="6"><text class="color_purple"> 申 请 人 </text></van-col>
                <van-col span="18">{{infoData.createBy}}</van-col>
            </van-row>
        </view>
        <view class="inspect_overview_list">
            <van-row>
                <van-col span="6"><text class="color_purple">申请时间</text></van-col>
                <van-col span="18">{{infoData.createTime}}</van-col>
            </van-row>
        </view>
    </view>

    <view>
        <view class="inspect_info" wx:for="{{infoData.proProjectApplyDetailList}}" wx:key="index">
            <view class="module_title module_title_flex">
                <view class="text_active">申请明细 {{ format.indexNumFormat(index) }}</view>
            </view>
            <view class="inspect_overview_list">
                <van-row>
                    <van-col span="6"><text class="color_purple">申请明细</text></van-col>
                    <van-col span="18">{{item.typeName + ' > '+ item.assetsName }}</van-col>
                </van-row>
            </view>
            <view class="inspect_overview_list">
                <van-row>
                    <van-col span="6"><text class="color_purple">申请数量</text></van-col>
                    <van-col span="18">{{item.number + ' '+ item.assetsUnit }}</van-col>
                </van-row>
            </view>
            <view class="inspect_overview_list" wx:if="{{item.assetsVersion}}">
                <van-row>
                    <van-col span="6"><text class="color_purple">规格型号</text></van-col>
                    <van-col span="18">{{item.assetsVersion }}</van-col>
                </van-row>
            </view>
            <view class="inspect_overview_list" wx:if="{{item.assetsVersion}}">
                <van-row>
                    <van-col span="6"><text class="color_purple">使用说明</text></van-col>
                    <van-col span="18">{{ item.useReason }}</van-col>
                </van-row>
            </view>
        </view>
    </view>

    <view wx:if="{{stopBtnShow}}">
        <view class="inspect_info">
            <view class="inspect_overview_list">
                <view class="inspect_overview_title" style="padding: 20rpx 0 10rpx;">终止原因</view>
                <view class="inspect_overview_content">
                    <textarea class="add_textarea" placeholder="请填写终止原因（500字内）" placeholder-style="color:#6777aa;" maxlength="500" bindinput="commentblur" />
                </view>
            </view>
        </view>
    </view>

    <view class="problem_submit_to">
        <view wx:if="{{stopShow}}" class="problem_submit_to_btn problem_submit_to_warning" bindtap="onStop">终止</view>
        <view wx:if="{{false}}" class="problem_submit_to_btn problem_submit_to_delete" bindtap="onDelete">删除</view>
        <view wx:if="{{revocationShow}}" class="problem_submit_to_btn problem_submit_to_save" bindtap="onRevocation">撤回</view>
    </view>
</view>