<template>
    <div class="dailyDetails">
        <headNav title="任务详情"></headNav>

        <!-- 任务信息 -->
        <div class="missionInfo" v-if="dataList.length != 0">
            <div class="headTip FontColorInfo">任务信息</div>
            <div class="missionInfo_cardInfo">
                <div class="missionInfo_location FontColorNormal" @click="turnToCompany(dataList.enforce_obj)"></div>
                <div class="missionInfo_status">
                    <span v-if="dataList.executeStatus == 1" class="fb FontColorError">待执行</span>
                    <span v-if="dataList.executeStatus == 3" class="fb FontColorOther">执行中</span>
                    <span v-if="dataList.executeStatus == 4" class="fb FontColorWarn">待复查</span>
                    <span v-if="dataList.executeStatus == 2" class="fb FontColorSuccess">任务完成</span>
                </div>
                <div class="missionInfo_cardInfo_contentCard">
                    <van-cell
                        title="被检查单位"
                        :value="dataList.enforce_obj_name || (dataList.enforce_obj && dataList.enforce_obj.enforce_obj_name)"
                        is-link
                        @click="turnToCompany"
                    />
                    <van-cell title="单位地址" :value="dataList.enforce_obj && dataList.enforce_obj.enforce_obj_address">
                        <template #right-icon>
                            <van-icon
                                name="location"
                                class="search-icon"
                                color="#0066cc"
                                @click="getCenter(dataList.enforce_obj)"/>
                        </template>
                    </van-cell>
                    <van-cell title="执法机构" :value="dataList.enforce_org_name || (dataList.enforce_org && dataList.enforce_org.enforce_org_name)"/>
                    <van-cell
                        :value="dataList.executor_names"
                        is-link
                        @click="turnToCheckPerson">
                        <template #title>
                            <span class="custom-title">检查成员</span>
                        </template>
                    </van-cell>
                    <van-cell title="检查类型" :value="dataList.jobType" />
                    <van-cell title="任务状态" :value-class="dataList.cls" :value="dataList.status" />
                </div>
            </div>
            <div class="more">
                <div @click="moreMissionDetail">查看更多内容</div>
                <van-icon name="arrow" />
            </div>
            <!-- 步骤条 -->
            <div class="steps">
                <van-steps :active="stepIndex" finish-icon="checked" :active-icon="stepIndex==2?'checked':'clock'" active-color="#02A7F0">
                    <van-step @click.native="showAppointMessage">预约通知</van-step>
                    <van-step @click.native="showExecuteTask">监督检查</van-step>
                    <van-step>完成任务</van-step>
                </van-steps>
            </div>
            <div class="txtInfo" v-if="stepIndex == 2">
              <van-cell title="检查记录" is-link value="查看详情" @click="showCheckRecord" />
              <van-cell title="检查文书" is-link value="查看详情" @click="showCheckPDF" />
              <van-cell title="检查结果" v-if="dataList.immediately_file_id || dataList.deadline_file_id">
                <div class="file-item" v-if="dataList.immediately_file_id" @click="showImmediatePdf">责令立即改正通知书<van-icon size="16" color="#888" name="arrow" /></div>
                <div class="file-item" v-if="dataList.deadline_file_id" @click="showDeadlinePdf">责令限期改正通知书<van-icon size="16" color="#888" name="arrow" /></div>
              </van-cell>
              <van-cell v-else title="检查结果" value="合格"></van-cell>
              <div v-if="showCheckResult" class="check-result" :class="taskIsPass?'check-result-pass':'check-result-error'">
                <span :class="taskIsPass?'check-pass':'check-error'">{{ taskIsPass ? '合格' : '不合格'}}</span>
              </div>
            </div>
            <div class="txtInfo" v-if="stepIndex != 2">
                <div class="txtInfo-box">
                    <template v-if="txtInfo">
                      <van-field
                          v-model="message"
                          rows="2"
                          autosize
                          label="信息内容"
                          input-align="right"
                          type="textarea"
                          readonly
                      />
                      <van-cell title="发送时间" :value="formatDate(txtInfo.send_time)"/>
                      <div class="resend">
                          <span @click="resendTxt">编辑重新发送短信</span>
                      </div>
                    </template>
                    <van-cell-group v-show="stepIndex === 1">
                        <van-cell title="近期隐患" is-link :value="`${problem_num}项`" @click="showRecent" />
                        <template>
                             <!-- v-if="dataList.job_type == 'SPECIAL'" -->
                            <van-cell v-if="canChangeCheckType" title="检查方式" is-link :value="dataList.checkType" @click="showCheckType = true" />
                            <van-cell v-else title="检查方式" :value="dataList.checkType" />
                        </template>
                        <van-cell v-if="showExamineFlow" title="检查流程" is-link :value="`${nodes_num}项`" @click="showCheckRecord" />
                    </van-cell-group>
                </div>
                <div class="btns" v-show="stepIndex === 1">
                    <van-button type="warning" plain @click="noCheck">不检查</van-button>
                    <van-button class="perform-tasks" type="info" @click="startTask">{{ dataList.job_status === 'DOING' ? '继续执行' : '执行任务' }}</van-button>
                    <!-- <van-button type="info" block @click="resignPdf">PDF重签</van-button> -->
                </div>
            </div>
            <div class="missionInfo_cardInfo" v-if="stepIndex === 0 && !txtInfo">
                <van-form @submit="onSubmit">
                <van-field
                    v-model="message"
                    rows="2"
                    autosize
                    label="信息内容"
                    input-align="right"
                    type="textarea"
                    readonly
                    placeholder="请输入信息内容"
                />
                <van-field
                    readonly
                    input-align="right"
                    clickable
                    name="picker"
                    :value="checkTime"
                    label="检查时间"
                    placeholder="请选择"
                    @click="showCheckTime = true"
                />
                <van-field
                    readonly
                    input-align="right"
                    clickable
                    name="picker"
                    :value="styleTxt"
                    label="发送方式"
                    placeholder="请选择"
                    @click="showStyle = true"
                />
                <van-field
                    readonly
                    v-if="styleTxt==='定时发送'"
                    input-align="right"
                    clickable
                    name="picker"
                    :value="sendTime"
                    label="发送时间"
                    placeholder="请选择"
                    @click="showSendTime = true"
                />
                <van-button block type="info" native-type="submit">{{btnTxt}}</van-button>
                </van-form>
            </div>
        </div>

        <van-popup v-model="showStyle" position="bottom">
            <van-picker
                show-toolbar
                :columns="columsSytle"
                @confirm="onConfirm"
                @cancel="showStyle = false"
            />
        </van-popup>

        <van-popup v-model="showCheckType" position="bottom">
            <van-picker
                show-toolbar
                :columns="checkTypes"
                @confirm="onConfirmCheckType"
                @cancel="showCheckType = false"
            />
        </van-popup>

        <van-popup v-model="showCheckTime" position="bottom">
            <van-datetime-picker
                v-model="currentCheckDate"
                type="date"
                title="请选择"
                :min-date="minDate"
                :max-date="maxDate"
                @confirm="onCheckConfirm"
                @cancel="showCheckTime = false"
            />
        </van-popup>

        <van-popup v-model="showSendTime" position="bottom">
            <van-datetime-picker
                v-model="currentSendDate"
                type="datetime"
                title="请选择"
                :min-date="minDate"
                :max-date="maxDate"
                @confirm="onSendConfirm"
                @cancel="showSendTime = false"
            />
        </van-popup>

        <!-- 弹出地图展示 -->
        <van-popup v-model="showMap" position="bottom" :style="{ height: '450px' }">
            <div>
                <baiduMap :center="center" :zoom="zoom"></baiduMap>
            </div>
        </van-popup>

        <!-- 遮罩层 -->
        <v-mask :showOverLay="showOverLay"></v-mask>
    </div>
</template>

<script>
import headNav from "@/components/headNav.vue";
import { get, post, put } from "@/utils/http.js";
import baiduMap from "@/components/baiduMap.vue";
import mask_overLay from "@/components/overLay_xy.vue";
import {formatYYYYMMDD, isEmpty, formatDate, isSpecialSimple, dateFormat} from '@/utils/tool';
import { handleProblemImgs } from '@/utils/index';
import { Dialog } from 'vant';
// import recordSign from '@/mixins/recordSign';
// import { dataURLtoFile } from '@/utils/htmlToPDF';
import moment from 'moment';

export default {
    name: "dailyDetails",
    inject: ["reload"],
    components: {
        headNav,
        baiduMap,
        "v-mask": mask_overLay,
    },
    // mixins: [recordSign],
    data() {
        return {
            docIist: [],
            fileList: "",
            dataList: {},
            companyInfo: "",
            showMap: false,
            showOverLay: false,
            zoom: 10,
            center: "重庆市",
            contNum: "",
            isShowCheckResult: false,
            startCheckBtn: false,
            hasJudge: false,
            isCorrection: false,
            recheckTime: "",
            noNeedRecheck: false,
            stepIndex: 0,
            showStyle: false,
            columsSytle: ["立即发送","定时发送"],
            styleTxt: "",
            sendTime: "",
            checkTime: "",
            showCheckTime: false,
            showSendTime: false,
            minDate: new Date(),
            maxDate: new Date(2025, 10, 1),
            currentCheckDate: new Date(),
            currentSendDate: new Date(),
            message:'',
            btnTxt:'发送通知',
            txtInfo: null,
            problem_num: 0,
            nodes_num: 0,
            showCheckResult: false,
            taskIsPass: false,
            haveCheckType: false,
            showCheckType: false,
            checkTypes: [
                { key: 'EASY', text: '简表' },
                { key: 'COMPLEX', text: '繁表' },
            ],
            lastCheckType: null,
        };
    },
    mounted() {
        this.init();
        this.checkTime = formatYYYYMMDD(this.currentCheckDate || new Date())
    },
    computed: {
        queryParams() {
            return this.$route.params
        },
        showExamineFlow() {
            if (this.dataList) {
                //  && this.dataList.job_type == 'SPECIAL'
                return this.dataList.check_type == 'COMPLEX';
            }
            return true;
        },
        canChangeCheckType() {
            if (this.dataList) {
                if (this.dataList.result_file_id > 0) {
                    return false;
                }
                if (this.dataList.execute_step == 'RECORD') {
                    return false;
                }
                if (this.haveCheckType && this.dataList.job_type == 'SPECIAL') {
                    return false;
                }
            }
            return true;
        },
    },
    methods: {
        formatDate,
        // 初始化
        init() {
            if (this.queryParams && this.queryParams.ID) {
                this.getDetailInfoApi();
            }
        },
        updateMessage() {
            if (this.dataList) {
                const name = this.dataList.enforce_obj_name || (this.dataList.enforce_obj && this.dataList.enforce_obj.enforce_obj_name);
                const date = dateFormat('YYYY年mm月dd日', this.currentCheckDate || new Date());
                this.message = `【${name}监督抽查提示函】:根据《消防法》及《消防监督检查规定》，我支队拟于${date},对您的单位履行法定消防安全职责情况实施监督检查，请做好检查前的消防安全自检程序`
            }
        },
        showAppointMessage() {
            if (this.showCheckResult) {
                return;
            }
            this.stepIndex = 0;
        },
        showExecuteTask() {
            if (this.showCheckResult) {
                return;
            }
            this.stepIndex = 1;
        },
        // 获取任务详情信息
        async getDetailInfoApi() {
            this.showOverLay = true;
            const res = await get(`/v2/api/enforce-job/${this.queryParams.ID}`);
            if (res) {
                const obj = Object.assign({}, res);
                if (obj.check_type) {
                    this.haveCheckType = true;
                    this.lastCheckType = obj.check_type;
                }
                else {
                    obj.check_type = 'EASY';
                }
                obj.checkType = obj.check_type == 'COMPLEX' ? '繁表' : '简表';
                switch (obj.job_status) {
                    case "TODO":
                        obj.status = "待执行";
                        obj.cls = 'FontColorWarn';
                        break;
                    case "DOING":
                        obj.status = "执行中";
                        obj.cls = 'FontColorOther';
                        break;
                    case "ARCHIVED":
                        obj.status = "已归档";
                        obj.cls = 'FontColorSuccess';
                        break;
                    default:
                        break;
                }
                // NORMAL-日常检查,SPECIAL-专项，REPORT-举报,TOWNS-乡镇检查，OTHER-其他
                switch (obj.job_type) {
                    case 'OTHER':
                        obj.jobType = '其他检查';
                        break;
                    case 'SPECIAL':
                        obj.jobType = '专项检查';
                        break;
                    case 'REPORT':
                        obj.jobType = '举报检查';
                        break;
                    case 'TOWNS':
                        obj.jobType = '乡镇检查';
                        break;
                    default:
                        obj.jobType = '日常检查';
                        break;
                }
                this.dataList = obj;
                if (res.check_nodes) {
                    let items = 0;
                    res.check_nodes.map(node => {
                    if (node.items) {
                        items += node.items.length;
                    }
                    });
                    this.nodes_num = items;
                }
                if (obj.job_status == 'ARCHIVED') {
                    this.stepIndex = 2;
                    this.checkTaskStatus();
                }
                else {
                    this.updateMessage();
                    const result = await get(`/v2/api/enforce-job/${obj.id}/enforce-message?page=1&size=1`);
                    if (result && result.data.length > 0) {
                        this.txtInfo = result.data[0];
                        if (this.txtInfo.send_time) {
                            this.currentCheckDate = new Date(this.txtInfo.send_time);
                            this.updateMessage();
                        }
                        this.stepIndex = 1;
                    }
                }
                const enforceId = this.objId || res.enforce_obj_id || (res.enforce_obj && res.enforce_obj.enforce_obj_id);
                if (enforceId) {
                    this.getRecentItems(enforceId);
                }
            }
            this.showOverLay = false;
        },
        checkTaskStatus() {
            let haveImmediate = this.dataList.immediately_file_id > 0;
            let haveDeadline = this.dataList.deadline_file_id > 0;
            if (!haveImmediate && !haveDeadline && this.dataList.check_nodes) {
                this.dataList.check_nodes.forEach(node => {
                    if (node.items && node.items.length > 0) {
                        node.items.forEach(item => {
                            if (item.correct_type) {
                                if (!haveImmediate) {
                                    haveImmediate = item.correct_type == 'IMMEDIATELY';
                                }
                                if (!haveDeadline) {
                                    haveDeadline = item.correct_type == 'DEADLINE';
                                }
                            }
                        });
                    }
                });
            }
            this.taskIsPass = !(haveImmediate || haveDeadline);
            this.showCheckResult = true;
        },
        showRecent() {
            this.$router.push(`/history/${this.queryParams.objId}`);
        },
        showFlow() {
            this.$router.push(`/dailyDetailsView/${this.queryParams.ID}`);
        },
        // resignPdf() {
            // if (this.dataList.result_file_id) {
            //     const vm = this;
            //     get(`/v2/api/file/${this.dataList.result_file_id}/open`).then(res => {
            //         const file = new File([res], '消防监督检查记录', {type: 'application/pdf'});
            //         const reader = new FileReader();
            //         reader.onload = function(e) {
            //             const myFile = dataURLtoFile(e.target.result, '消防监督检查记录');
            //             vm.startToSign(myFile);
            //         };
            //         reader.readAsDataURL(file);
            //         // this.startToSign(file);
            //     })
            // }
        // },
        startTask() {
            if (this.haveCheckType && this.canChangeCheckType && this.lastCheckType != this.dataList.check_type) {
                const vm = this;
                Dialog.confirm({
                    title: '温馨提示',
                    message: '当前检查方式有变，继续执行会清空数据，是否继续操作?'
                }).then(() => {
                    vm.changeTaskCheckType();
                }).catch(() => {});
            }
            else {
                this.continueRunTask();
            }
        },
        changeTaskCheckType() {
            put(`/v2/api/enforce-job/${this.queryParams.ID}/exchange?check_type=${this.dataList.check_type}`).then(res => {
                this.continueRunTask();
            });
        },
        continueRunTask() {
            if (isSpecialSimple(this.dataList)) {
                const haveImmediate = this.dataList.immediately_file_id > 0;
                let haveDeadline = this.dataList.deadline_file_id > 0;
                if (haveDeadline) {
                    const status = this.dataList.notification_audit_status;
                    haveDeadline = status == 'SENDED' || status == 'AUDIT';
                }
                if (haveImmediate || haveDeadline) {
                    const type = haveImmediate ? '1' : '2';
                    this.$router.push(`/simpleCheckNotice/${this.queryParams.ID}/${type}`);
                    return;
                }
            }
            else {
                let haveImmediate = false, haveDeadline = false;
                if (this.dataList.check_nodes) {
                    this.dataList.check_nodes.forEach(node => {
                        if (node.items && node.items.length > 0) {
                            node.items.forEach(item => {
                                if (item.correct_type) {
                                    if (!haveImmediate) {
                                        haveImmediate = item.correct_type == 'IMMEDIATELY';
                                    }
                                    if (!haveDeadline) {
                                        haveDeadline = item.correct_type == 'DEADLINE';
                                    }
                                }
                            });
                        }
                    });
                }
                let flag = false;
                if (haveImmediate && this.dataList.immediately_file_id) {
                    flag = true;
                }
                if (haveDeadline && this.dataList.deadline_file_id) {
                    const status = this.dataList.notification_audit_status;
                    flag = flag && (status == 'SENDED' || status == 'REJECT' || status == 'AUDIT');
                }
                if (flag) {
                    this.$router.push(`/correctionNotice/${this.queryParams.ID}`);
                    return;
                }
            }

            if (this.dataList.result_file_id) {
                if (isSpecialSimple(this.dataList)) {
                    this.$router.push(`/simpleCheckResult/${this.queryParams.ID}`);
                }
                else {
                    this.$router.push(`/checkResult/${this.queryParams.ID}/normal`);
                }
                return;
            }
            
            if (this.dataList.execute_step == 'RECORD') {
                this.$router.push(`/checkRecord/${this.queryParams.ID}`);
                return;
            }

            // const nodes = this.dataList.check_nodes || [];
            // if (nodes.length <= 0) {
                // this.$toast.fail('请到管理平台绑定流程后操作');
				// Notify({ type: 'danger', message: '请到管理平台绑定流程后操作' });
				// return;
			// }

            const vm = this
            Dialog.confirm({
                title: '温馨提示',
                message: '开始检查前请确保执法记录仪已处于开启状态',
            }).then(() => {
                if (vm.dataList.job_status == 'DOING') {
                    if (!this.haveCheckType) {
                        const params = {
                            check_type: vm.dataList.check_type,
                        };
                        vm.$http.put(`/v2/api/enforce-job/${vm.queryParams.ID}`, params).then(res => {
                            console.log(res);
                        });
                    }
                    if (isSpecialSimple(vm.dataList)) {
                        vm.$router.push(`/simpleTask/${vm.queryParams.ID}`);
                    }
                    else {
                        vm.$router.push(`/special/exec/${vm.queryParams.ID}`);
                    }
                }
                else {
                    const params = {
                        job_status: 'DOING',
                        check_type: vm.dataList.check_type,
                        start_time: moment().add(30, 'seconds'),
                    };
                    // if (vm.dataList.job_type == 'SPECIAL') {
                        // params['check_type'] = vm.dataList.check_type
                    // }
                    vm.$http.put(`/v2/api/enforce-job/${vm.queryParams.ID}`, params).then(res => {
                        if (isSpecialSimple(vm.dataList)) {
                            vm.$router.push(`/simpleTask/${vm.queryParams.ID}`);
                        }
                        else {
                            vm.$router.push(`/special/exec/${vm.queryParams.ID}`);
                        }
                    })
                }
            }).catch(e => {

            })
        },
        getRecentItems(enforceId) {
            this.$http.get(`/v2/api/enforce-job/item?page=1&size=100000&query=check_result==2;enforce_obj_id==${enforceId}`).then(res => {
                if (res.data) {
                    this.problem_num = res.data.total
                }
            })
        },

        // 获取本月开始 结束
        getThisMonthStart(now) {
            // var now = new Date(now);
            var nowMonth = now.getMonth(); //当前月
            var nowYear = now.getYear(); //当前年
            var nowDay = now.getDate();
            var h = now.getHours() >= 10 ? now.getHours() : "0" + now.getHours();
            var m =
                now.getMinutes() >= 10 ? now.getMinutes() : "0" + now.getMinutes();
            nowYear += nowYear < 2000 ? 1900 : 0;
            var monthStartDate = new Date(nowYear, nowMonth, 1);
            var monthEndDate = new Date(nowYear, nowMonth);
            return nowYear + "/" + (nowMonth + 1) + "/" + nowDay + " " + h + ":" + m;
        },
        // 选择发送方式
        onConfirm(value) {
            this.styleTxt = value;
            this.showStyle = false;
            if (value === '立即发送') {
                this.currentSendDate = new Date();
                this.sendTime = this.getThisMonthStart(this.currentSendDate);
            }
        },
        onConfirmCheckType(v) {
            this.dataList.check_type = v.key;
            this.dataList.checkType = v.text;
            this.showCheckType = false;
        },
        onCheckConfirm(value) {
            this.checkTime = formatYYYYMMDD(value);
            this.showCheckTime = false;
            this.updateMessage();
        },
        onSendConfirm(value) {
            this.sendTime = this.getThisMonthStart(value);
            this.showSendTime = false;
        },
        onSubmit() {
            if (!this.queryParams || isEmpty(this.queryParams.ID)) {
                return;
            }
            if (isEmpty(this.styleTxt)) {
                this.$toast.fail('请选择发送方式');
                return;
            }
            if (!this.sendTime) {
                this.$toast.fail('请选择发送时间');
                return;
            }
            this.showOverLay = true;
            const obj = {
                id:Number(this.queryParams.ID),
                obj_id: this.queryParams.objId,
                message_type:'APPOINTMENT',
                receiver_type: 'SMS',
                message_content:this.message,
                send_time:this.currentSendDate
            };
            post(`/v2/api/enforce-job/${this.queryParams.ID}/enforce-message`, obj).then(res=>{
                if (res) {
                    this.txtInfo = res;
                    if (this.txtInfo.send_time) {
                        this.currentCheckDate = this.currentSendDate;
                        this.updateMessage();
                    }
                    this.stepIndex = 1;
                }
                this.showOverLay = false;
            })
        },
        resendTxt() {
            const name = this.dataList.enforce_obj && this.dataList.enforce_obj.enforce_obj_name;
            const params = Object.assign(this.txtInfo, {
                taskId: this.queryParams.ID,
                objId: this.queryParams.objId,
                enforceName: name
            });
            this.$router.push({
                name: 'sendTxt',
                params
            })
        },

        // 跳转单位信息
        turnToCompany() {
            if (this.dataList && this.dataList.enforce_obj_id) {
                this.$router.push(`/companyInfo/${this.dataList.enforce_obj_id}`);
            }
        },
        // 跳转不检查页面
      noCheck() {
        const {ID, objId} = this.$route.params
        this.$router.push(`/task/nocheck/${ID}/${objId}`);
      },

        // 跳转检查人员信息
        turnToCheckPerson() {
            this.$router.push(`/checkPersonnelInfo/${this.queryParams.ID}`);
        },

        // 跳转更多任务信息
        moreMissionDetail() {
            this.$router.push(`/missionInfoDetail/${this.queryParams.ID}`);
        },

        // 文件详情
        docContent(item) {
            this.$router.push(`/msgDetail/${item.taskId}/${item.id}`);
        },

        // 获取地图中心位置
        getCenter(location) {
            this.showMap = true;
            var lo = {
                lng: location.longitude,
                lat: location.latitude,
            };
            this.center = lo;
        },

        // 设置主协标识
        getPerson(per) {
            if (per) {
                let str = "";
                for (let i in per) {
                    if (i == 0) {
                        str = str + per[i].user_name + "(主)，";
                    } else {
                        str = str + per[i].user_name + "(协)";
                    }
                }

                return str;
            }
        },
        // 跳转检查结果
        turnToResult() {
            if (!this.hasJudge) {
                this.$router.push(
                    `/checkResult/${this.dataList.taskId}/${this.queryParams.ID}/normal`
                );
            } else {
                this.$router.push(
                    `/checkResultDetail/${this.dataList.taskId}/${this.queryParams.ID}`
                );
            }
        },

        // 检查记录
        showCheckRecord() {
            if (isSpecialSimple(this.dataList)) {
                this.$router.push(`/simpleTaskPreview/${this.queryParams.ID}`);
            }
            else {
                this.$router.push(`/taskPreview/${this.queryParams.ID}/${this.queryParams.objId}`);
            }
        },

        // 检查记录
        showCheckPDF() {
            if (this.dataList.result_file_id) {
                let url = handleProblemImgs(this.dataList.result_file_id);
                this.$router.push({
                    name: 'pdf',
                    params: {
                        url,
                        title: '检查文书'
                    }
                })
            }
        },

        // 责令立即改正通知书
        showImmediatePdf() {
            this.showPdfPreview(this.dataList.immediately_file_id, '责令立即改正通知书');
        },

        // 责令限期改正通知书
        showDeadlinePdf() {
            this.showPdfPreview(this.dataList.deadline_file_id, '责令限期改正通知书');
        },
        showPdfPreview(fileId, title) {
            const url = handleProblemImgs(fileId);
            this.$router.push({
                name: 'pdf',
                params: {
                url,
                title: title
                }
            })
        }
    },
};
</script>

<style lang="scss" scoped>
.dailyDetails {
  font-size: 14px;
  height: 100vh;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;

  .mt2 {
    margin-top: 3px;
  }

  .headTip {
    margin-bottom: 10px;
    padding: 0 15px;
  }

  .noNoticeFile {
    padding: 25px 0;
    color: #878787;
    font-weight: bold;
    text-align: center;
  }

  .noRecheck {
    padding: 25px 0;
    color: #3fbf83;
    font-weight: bold;
    text-align: center;
  }

  .missionInfo {
    margin-top: 57px;
    padding-bottom: 20px;

    .missionInfo_cardInfo {
      padding: 0 15px;
      background-color: #fff;

      .missionInfo_cardInfo_headCard {
        padding-top: 10px;
        padding-bottom: 5px;
        font-weight: bold;
      }
    }
    .missionInfo_cardInfo:last-child {
      padding: 15px;
    }
  }

  .companyInfo {
    @extend .missionInfo;
    margin-top: 10px;
  }

  .noticeDoc {
    margin-top: 10px;

    .noticeDoc_docItem {
      padding: 10px 0;
      background-color: #fff;
      color: #616161;
      border-bottom: 1px solid #eaeaea;

      &:last-child {
        border-bottom: none;
      }

      .noticeDoc_noticeName {
        padding: 5px 0;
      }

      .noticeDoc_status {
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: #787878;
        font-size: 12px;
        margin-top: 5px;
        // padding: ;
      }
    }
  }

  .inspectContent {
    margin-top: 10px;

    .inspectContent_content {
      padding: 5px 15px;
      background-color: #fff;
    }
  }

  .checkResult {
    margin-top: 10px;

    .unChecked,
    .Checked {
      padding: 5px 15px;
      background-color: #fff;

      .checkedItem {
        color: #616161;
        border-bottom: 1px solid #e8e8e8;

        &:last-child {
          border-bottom: none;
        }
      }
    }
  }

  .reCheckResult {
    margin-top: 10px;

    .unChecked,
    .Checked {
      padding: 5px 15px;
      background-color: #fff;
    }

    .unChecked {
      padding-bottom: 10px;
    }
  }

  .lawRecord {
    margin-top: 10px;

    .unChecked,
    .Checked {
      padding: 8px 15px;
      background-color: #fff;

      .checkedItem {
        padding: 8px 0;
        align-items: center;
      }
    }
  }
}
.dailyDetails::-webkit-scrollbar {
  display: none;
}
.more {
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #888888;
}
.txtInfo {
  position: relative;

  .txtInfo-box {
    padding: 0 15px;
    background-color: #FFFFFF;
  }
  .resend {
    margin: 0 -15px;
    background-color: #F5F5F5;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 0;
    &>span {
      color: #02a7f0;
      margin-right: 10px;
    }
  }
  .btns {
    margin: 20px;
      .perform-tasks {
          width: 74%;
          margin-left: 10px;
      }
  }
}
.file-item {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.check-result {
  position: absolute;
  top: 80px;
  right: 10px;
  width: 80px;
  height: 80px;
  border-radius: 100%;
  transform: rotate(-40deg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.check-result-pass {
  border: 2px solid #3fbf83;
}
.check-pass {
  color: #3fbf83;
  font-size: 24px;
}
.check-result-error {
  border: 2px solid #ff5d5d;
}
.check-error {
  font-size: 24px;
  color: #ff5d5d;
}
</style>

<style lang="scss">
.steps {
    padding: 10px 20px;
    .van-steps {
        background-color: transparent !important;

        .van-step__circle-container {
            background-color: transparent !important;
        }

        .van-step__title {
          font-size: 14px !important;
        }

        .van-step__icon {
          font-size: 20px;
        }
    }

    .van-step--finish {
      color: #02a7f0;
    }
}

.dailyDetails {
  .van-cell {
    padding: 8px 0;
    border-bottom: 1px solid #f9f9f9;
    font-size: 12px;

    &::after {
      border: none;
    }

    &:last-child {
      border-bottom: none;
    }

    .van-cell__title {
      color: #565656;
    }
    .van-cell__value {
		white-space: normal;
		flex: 2;
	}
  }

  .txtInfo {
    .van-cell {
      padding: 8px 10px !important;
    }
  }

  .missionInfo {
    .missionInfo_cardInfo {
      .search-icon.van-icon.van-icon-location {
        display: flex;
        align-items: center;
        color: #00f;
        margin-left: 10px;
      }

      .van-icon.van-icon-arrow.van-cell__right-icon {
        margin-left: 10px;
      }
    }
  }

  .missionInfo_cardInfo_more {
    .van-button.van-button--info.van-button--small {
      padding: 5px 20px;
      height: auto;
      margin-bottom: 5px;
      background-color: transparent;
      border: none;
      color: #448fff;
      font-size: 13px;
      font-weight: bold;
    }
  }

  .inspectContent_content {
    .van-cell__value {
      color: #02a7f0;

      span {
        font-size: 9px;
      }
    }

    .van-icon.van-icon-arrow.van-cell__right-icon {
      color: #02a7f0;
      font-size: 12px;
    }
  }

  .van-empty {
    padding: 0;
    padding-bottom: 10px;
  }

  .van-empty__description {
    color: #878787;
    font-weight: bold;
  }

  .checkResult,
  .reCheckResult {
    .unChecked,
    .Checked {
      .checkedItem {
        .van-cell,
        .van-cell.van-cell--clickable {
          border: none;

          &::after {
            border: none;
          }
        }

        .van-cell__value {
          color: #02a7f0;

          span {
            font-size: 9px;
          }
        }

        .van-icon.van-icon-arrow.van-cell__right-icon {
          color: #02a7f0;
          font-size: 12px;
        }
      }
    }
  }

  .van-empty__image {
    width: 140px;
    height: 130px;
  }

  .van-empty__bottom {
    margin-top: 5px;

    .van-button.van-button--info.van-button--normal {
      width: 120px;
      height: 40px;
      border-radius: 5px;
    }
  }
}
</style>
