<template>
    <div class="deedtax-house">
        <div class="search-wrapper">
            <el-form :inline="true" :model="searchForm" class="search_form" style="text-align: left">
                <el-form-item label="姓名">
                    <el-input v-model="searchForm.name" placeholder="请输入姓名" @keyup.enter.native="onSubmit"></el-input>
                </el-form-item>
                <el-form-item label="手机号码">
                    <el-input v-model="searchForm.phone" placeholder="请输入手机号码" @keyup.enter.native="onSubmit">
                    </el-input>
                </el-form-item>
                <el-form-item label="不动产坐落辖市区" v-if="this.realEstateArea == '市区'">
                    <el-select v-model="searchForm.checkArealEstateArea" placeholder="请选择不动产坐落辖市区" @change="onSubmit"
                        size="medium">
                        <el-option v-for="item in areaList" :key="item.id" :label="item.label" :value="item.id">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="onSubmit">查询</el-button>
                </el-form-item>
                <br />
                <el-form-item label="状态" style="margin-top: 10px">
                    <el-radio-group v-model="searchForm.state" @change="onSubmit">
                        <el-radio :label="item.state" v-for="item in stateList" :key="item.state">{{ item.stateName }}
                        </el-radio>
                    </el-radio-group>
                </el-form-item>
            </el-form>
        </div>
        <div class="table-wrapper">
            <table-template :tableData="tableData" :tableColumns="tableColumns" :loading="loading"
                :pagination="pagination" @Jump="jumpPage">
                <el-table-column slot="departmentName" label="实施主体" align="center">
                    <template>
                        {{
                        this.$route.query.departmentCode == "10000031" ? this.realEstateArea + '住建局' :
                        this.realEstateArea + '住建窗口'
                        }}
                    </template>
                </el-table-column>
                <el-table-column label="状态" align="center">
                    <template slot-scope="scope">
                        <el-tag type="warning" v-if="scope.row.state == 0">待审核</el-tag>
                        <el-tag type="warning" v-if="scope.row.state == 1">待复审</el-tag>
                        <el-tag type="warning" v-if="scope.row.state == 2 || scope.row.state == 3">待退税办理</el-tag>
                        <el-tag type="danger" v-if="scope.row.state == 4">已驳回</el-tag>
                        <el-tag type="success" v-if="scope.row.state == 6">已完成</el-tag>
                    </template>
                </el-table-column>
                <el-table-column fixed="right" label="操作" width="380" align="center">
                    <template slot-scope="scope">
                        <el-button type="primary" size="mini" round @click="view(scope.row)">查看</el-button>
                        <el-button type="primary" size="mini" round @click="record(scope.row)">记录</el-button>
                        <!-- 申请的单子有通过拒绝-->
                        <el-button v-if="scope.row.state == 1 && searchForm.departmentCode == '10000027'" type="success"
                            size="mini" round @click="pass(scope.row)">通过
                        </el-button>
                        <el-button v-if="scope.row.state == 1 && searchForm.departmentCode == '10000027'" type="danger"
                            size="mini" round @click="deny(scope.row)">拒绝
                        </el-button>
                        <el-button v-if="scope.row.flag == true && searchForm.departmentCode == '10000027'" type="info"
                            size="mini" round @click="drevokeeny(scope.row)">撤销
                        </el-button>
                        <el-button
                            v-if="(scope.row.state == 3 || scope.row.state == 2) && searchForm.departmentCode == '10000031' && this.$route.query.realEstateArea == '句容市'"
                            type="success" size="mini" round @click="dispatch(scope.row)">退税办理</el-button>
                        <el-button
                            v-if="scope.row.state != 0 && scope.row.state != 4 && scope.row.fileUrl && searchForm.departmentCode == '10000027'"
                            type="success" size="mini" round @click="download(scope.row.fileUrl)">下载申请表</el-button>
                    </template>
                </el-table-column>
            </table-template>
        </div>
        <el-dialog title="申报详情" :visible.sync="viewShow" width="800px" :close-on-press-escape="false">
            <div class="content">
                <!-- 新增功能start -->
                <el-table :data="totalList" style="width: 100%">
                    <el-table-column prop="departmentName" label="审核单位" width="180">
                    </el-table-column>
                    <el-table-column prop="state" label="审核状态" width="180">
                    </el-table-column>
                    <el-table-column prop="reason" label="审核意见"> </el-table-column>
                    <el-table-column prop="createTime" label="审核时间"> </el-table-column>
                </el-table>
                <div class="cell">
                    <p class="label">是否享受过相关政策</p>
                    <p :class="['value', viewDetail.enjoyFlag == true ? 'value1' : 'value2']">{{ viewDetail.enjoyFlag ?
                    '是' : '否'
                    }}</p>
                </div>
                <!-- 新增功能end -->
                <div class="cell">
                    <p class="label">事项名称</p>
                    <p class="value">{{ viewDetail.guideName }}</p>
                </div>
                <div class="cell">
                    <p class="label">实施主体</p>
                    <p class="value">
                        {{
                        this.$route.query.departmentCode == "10000031" ? this.realEstateArea + '住建局' :
                        this.realEstateArea + '住建窗口'
                        }}
                    </p>
                </div>
                <div class="cell">
                    <p class="label">姓名</p>
                    <p class="value">{{ viewDetail.name }}</p>
                </div>
                <div class="cell">
                    <p class="label">身份证</p>
                    <p class="value">{{ viewDetail.idCard }}</p>
                </div>
                <div class="cell">
                    <p class="label">手机号</p>
                    <p class="value">{{ viewDetail.phone }}</p>
                </div>
                <div class="cell">
                    <p class="label">辖市区</p>
                    <p class="value">{{ viewDetail.userArea }}</p>
                </div>
                <div class="cell">
                    <p class="label">联系地址</p>
                    <p class="value">{{ viewDetail.address }}</p>
                </div>
                <div class="cell">
                    <p class="label">身份证照片</p>
                    <p class="value">
                        <el-image v-for="(item, index) in viewDetail.idCardPicture" :key="index"
                            style="width: 100px; height: 100px; margin-right: 10px" :src="item.picture"
                            :z-index="7777777" :preview-src-list="[item.picture]">
                        </el-image>
                    </p>
                </div>
                <div class="cell">
                    <p class="label">所属银行</p>
                    <p class="value">{{ viewDetail.bank }}</p>
                </div>
                <div class="cell">
                    <p class="label">银行卡号</p>
                    <p class="value">{{ viewDetail.bankCard }}</p>
                </div>
                <div class="cell">
                    <p class="label">银行卡照片</p>
                    <p class="value">
                        <el-image v-for="(item, index) in viewDetail.bankCardPicture" :key="index"
                            style="width: 100px; height: 100px; margin-right: 10px" :src="item.picture"
                            :z-index="7777777" :preview-src-list="[item.picture]">
                        </el-image>
                    </p>
                </div>
                <div class="cell">
                    <p class="label">契税发票号码</p>
                    <p class="value" v-if="viewDetail.deedBillCode && !viewDetail.secondDeedBillCode">NO.{{
                    viewDetail.deedBillCode
                    }}</p>
                    <p class="value" v-if="!viewDetail.deedBillCode && viewDetail.secondDeedBillCode">NO.{{
                    viewDetail.secondDeedBillCode
                    }}</p>
                    <p class="value" v-if="viewDetail.deedBillCode && viewDetail.secondDeedBillCode">NO.{{
                    viewDetail.deedBillCode
                    }}、NO.{{ viewDetail.secondDeedBillCode }}</p>
                </div>
                <div class="cell">
                    <p class="label">缴纳契税金额(元)</p>
                    <p class="value">{{ viewDetail.paymentDeedTaxAmount }}</p>
                </div>
                <div class="cell" v-if="viewDetail.taxReimbursementAmount">
                    <p class="label">退税金额(万元)</p>
                    <p class="value">{{ viewDetail.taxReimbursementAmount }}</p>
                </div>
                <div class="cell">
                    <p class="label">房屋面积</p>
                    <p class="value">{{ viewDetail.square }}</p>
                </div>
                <div class="cell">
                    <p class="label">不动产坐落辖市区</p>
                    <p class="value">{{ viewDetail.checkArea }}</p>
                </div>
                <div class="cell">
                    <p class="label">网签时间</p>
                    <p class="value">{{ viewDetail.netSignTime }}</p>
                </div>
                <div class="cell">
                    <p class="label">不动产权证号</p>
                    <p class="value">{{ viewDetail.realEstateCard }}</p>
                </div>
                <div class="cell">
                    <p class="label">不动产权坐落地址</p>
                    <p class="value">{{ viewDetail.realEstateAddress }}</p>
                </div>
                <div class="cell">
                    <p class="label">不动产权证书</p>
                    <p class="value">
                        <el-image v-for="(item, index) in viewDetail.certificate" :key="index"
                            style="width: 100px; height: 100px;  margin-right: 10px" :src="item.picture"
                            :z-index="7777777" :preview-src-list="[item.picture]">
                        </el-image>
                    </p>
                </div>
                <div class="cell">
                    <p class="label">商品房买卖合同3张</p>
                    <p class="value">
                        <el-image v-for="(item, index) in viewDetail.contract" :key="index"
                            style="width: 100px; height: 100px; margin-right: 10px" :src="item.picture"
                            :z-index="7777777" :preview-src-list="[item.picture]">
                        </el-image>
                    </p>
                </div>
                <div class="cell">
                    <p class="label">契税完税凭证</p>
                    <p class="value">
                        <el-image v-for="(item, index) in viewDetail.voucher" :key="index"
                            style="width: 100px; height: 100px;  margin-right: 10px" :src="item.picture"
                            :z-index="7777777" :preview-src-list="[item.picture]">
                        </el-image>
                    </p>
                </div>
            </div>
        </el-dialog>
        <el-dialog title="操作记录" :visible.sync="recordShow" width="800px" :close-on-press-escape="false">
            <div class="content" v-if="recordList[0]">
                <div class="cell" v-for="(item, index) in recordList" :key="index">
                    <p class="label" style="margin-right: 20px">
                        {{ item.stateName }}
                        <span v-if="item.reason">({{ item.reason }})</span>
                    </p>
                    <div class="info">
                        <p class="item">操作人：{{ item.departmentName }}</p>
                        <p class="item">操作时间：{{ item.createTime }}</p>
                    </div>
                </div>
                <p v-if="record.length === 0">暂无记录~</p>
            </div>
        </el-dialog>
        <el-dialog title="改派部门" :visible.sync="reassignmentShow" width="600px" :close-on-press-escape="false"
            :before-close="closeDialog">
            <el-form label-width="120px" :model="params">
                <el-row>
                    <el-form-item label="改派部门">
                        <el-cascader v-model="params.checkArea" placeholder="请选择部门" :options="checkAreaList"
                            :show-all-levels="false" @change="handleChange">
                        </el-cascader>
                    </el-form-item>
                </el-row>
            </el-form>
            <span slot="footer" class="dialog-footer">
                <el-button @click="closeDialog">取 消</el-button>
                <el-button type="primary" @click="determine">确 定</el-button>
            </span>
        </el-dialog>
    </div>
</template>

<script>
import TableTemplate from "@/components/Table";
import { changeList, setName, setTel, setCertNo } from "@/utils";
// import { $fileUrl } from "@/utils/mix";
// import { getTempUrl } from "@/api/exportFileUrl";

import { queryListDeedTax, queryDeedTaxDetailInfo, queryDeedTaxRecord, updateDeedTaxState, mainRevocation, updateCheckArea } from '@/api/deedtax'

export default {
    components: { TableTemplate },
    data() {
        return {
            userName: "",
            searchForm: {
                name: "",
                phone: "",
                state: "",
                departmentCode: "",
                checkArealEstateArea: ""
            },
            stateList: [
                {
                    state: "",
                    stateName: "全部",
                    type: "",
                },
                {
                    state: 0,
                    stateName: "待审核",
                    type: "warning",
                },
                {
                    state: 1,
                    stateName: "待复审",
                    type: "warning",
                },
                // {
                //     state: 2,
                //     stateName: "待用户确认",
                //     type: "warning",
                // },
                // {
                //     state: 3,
                //     stateName: "待退税办理",
                //     type: "warning",
                // },
                {
                    state: 2,
                    stateName: "待退税办理",
                    type: "warning",
                },
                {
                    state: 4,
                    stateName: "已驳回",
                    type: "danger",
                },
                {
                    state: 6,
                    stateName: "已完成",
                    type: "success",
                },
            ],
            stateList1: [
                {
                    state: 0,
                    stateName: "待审核",
                    type: "warning"
                },
                {
                    state: 1,
                    stateName: "待复审",
                    type: "warning"
                },
                {
                    state: 6,
                    stateName: "已完成",
                    type: "warning"
                },
                {
                    state: 2,
                    stateName: "资料审核",
                    type: "warning"
                },
                {
                    state: 3,
                    stateName: "卡号确认",
                    type: "success"
                },
                {
                    state: 4,
                    stateName: "已驳回",
                    type: "danger"
                },
                {
                    state: 8,
                    stateName: "初审通过",
                    type: "success"
                },
                {
                    state: 9,
                    stateName: "已驳回",
                    type: "danger"
                }
            ],
            loading: false,
            tableData: [],
            tableColumns: [
                {
                    key: "code",
                    label: "申请编号",
                    width: 200
                },
                {
                    key: "name",
                    label: "企业联系人",
                    width: 150
                },
                {
                    key: "phone",
                    label: "手机号",
                    width: 150
                },
                {
                    key: "guideName",
                    label: "事项名称",
                    width: 150
                },
                {
                    key: "realEstateArea",
                    label: "不动产坐落辖市区",
                    width: 150
                },
                {
                    key: "departmentName",
                    label: "实施主体",
                    type: "slot",
                    // width: 150
                },
                {
                    key: "createTime",
                    label: "更新时间",
                    width: 160
                }
            ],
            pagination: {
                total: 0,
                pageSize: 10,
                currentPage: 1
            },
            viewShow: false,
            viewDetail: {},
            recordShow: false,
            recordList: [],
            examineList: [], // 审核单位数据
            housingList: [], // 住建局列表数据
            totalList: [], // 合并数组
            realName: "",
            realEstateArea: null,
            reassignmentShow: false,
            params: {
                code: '',
                checkArea: '',
                departmentCode: '10000031'
            },
            checkAreaList: [
                {
                    label: '市区',
                    value: '市区',
                    children: [
                        {
                            label: '京口区',
                            value: '京口区',
                        }, {
                            label: '润州区',
                            value: '润州区',
                        }, {
                            label: '镇江高新区',
                            value: '镇江高新区',
                        }, {
                            label: '镇江新区-丁卯片区',
                            value: '镇江新区-丁卯片区',
                        }
                    ]
                }, {
                    label: '丹徒区',
                    value: '丹徒区'
                }, {
                    label: '镇江新区',
                    value: '镇江新区',
                    children: [
                        {
                            label: '大港片区',
                            value: '大港片区',
                        }
                    ]
                }, {
                    label: '句容市',
                    value: '句容市'
                }
            ],
            departmentName: '',
            areaList: [
                {
                    id: "",
                    label: "全部",
                },
                {
                    id: "京口区",
                    label: "京口区",
                },
                {
                    id: "润州区",
                    label: "润州区",
                },
                {
                    id: "丹徒区",
                    label: "丹徒区",
                },
                {
                    id: "镇江新区-大港片区",
                    label: "镇江新区-大港片区",
                },
                {
                    id: "镇江新区-丁卯片区",
                    label: "镇江新区-丁卯片区",
                },
                {
                    id: "镇江高新区",
                    label: "镇江高新区",
                },
                {
                    id: "句容市",
                    label: "句容市",
                },
            ],
        };
    },
    watch: {
        $route() {
            if (this.$route) {
                this.userName = localStorage.getItem('userName');
                // 10000027  人才窗口code   10000031 市财政局code退税办理
                this.searchForm.departmentCode = this.$route.query.departmentCode;
                // realEstateArea: 市区、镇江新区、丹徒区
                this.realEstateArea = this.$route.query.realEstateArea ? this.$route.query.realEstateArea : null
                // departmentName: 审核部门名称（左侧列表）
                this.departmentName = this.$route.query.departmentName
                this.searchForm.name = ''
                this.searchForm.phone = ''
                this.searchForm.state = ''
                this.init();
            }
        }
    },
    methods: {
        init() {
            this.tableData = [];
            this.loading = true;
            let parmas = {
                name: this.searchForm.name,
                phone: this.searchForm.phone,
                state: this.searchForm.state,
                departmentCode: this.searchForm.departmentCode,
                pageNum: this.pagination.currentPage,
                pageSize: this.pagination.pageSize,
                checkArea: this.realEstateArea,
                checkArealEstateArea: this.searchForm.checkArealEstateArea
            };
            queryListDeedTax(parmas).then(res => {
                this.loading = false;
                if (res.success) {
                    this.pagination.total = res.data.total;
                    if (res.data.total) {
                        this.tableData = res.data.list.map(item => {
                            item.stateName = this.getSatusArr(item.state).stateName;
                            item.type = this.getSatusArr(item.state).type;
                            return item;
                        });
                        if (localStorage.getItem('userName') == 'admin') {
                            this.tableData = changeList(this.tableData)
                        }
                    } else {
                        this.tableData = []
                    }
                }
            });
        },
        onSubmit() {
            this.pagination.currentPage = 1;
            this.init();
        },
        jumpPage() {
            this.init();
        },
        // changeUrl(url) {
        //     let params = {
        //         file: url,
        //         day: 1
        //     }
        //     getTempUrl(params).then((res) => {
        //         if (res.data.indexOf('81.69.44.115') !== -1) {
        //             // 测试环境
        //             window.location.href = res.data
        //         } else {
        //             // 生产环境
        //             // http跨域 ---> https
        //             let a = res.data.substr(0, 4) + 's' + res.data.substr(4)
        //             window.location.href = a
        //         }
        //     })
        // },
        download(url) {
            // this.changeUrl(url)
            if (url.indexOf('81.69.44.115') !== -1) {
                // 测试环境
                window.location.href = url
            } else {
                // 生产环境
                // http跨域 ---> https
                let a = url.substr(0, 4) + 's' + url.substr(4)
                window.location.href = a
            }
        },
        view(row) {
            let params = {
                code: row.code,
                // matterType: row.matterType
            };
            queryDeedTaxDetailInfo(params).then(res => {
                // let arr = []
                // res.data.pictures.forEach((item) => {
                //     let params = {
                //         file: item.picture,
                //         day: 1
                //     }
                //     arr.push(getTempUrl(params))
                // })
                // Promise.all(arr).then(res1 => {
                //     let arr1 = []
                //     arr1 = res1.map((item, index) => ({ picture: item.data, pictureType: res.data.pictures[index].pictureType }))
                this.viewDetail = res.data;
                if (localStorage.getItem('userName') == 'admin') {
                    this.viewDetail.name = setName(this.viewDetail.name)
                    this.viewDetail.phone = setTel(this.viewDetail.phone)
                    this.viewDetail.idCard = setCertNo(this.viewDetail.idCard)
                }
                this.viewDetail.idCardPicture = res.data.pictures.filter(item => item.pictureType === 1);
                this.viewDetail.bankCardPicture = res.data.pictures.filter(item => item.pictureType === 5);
                this.viewDetail.contract = res.data.pictures.filter(item => item.pictureType === 2);
                this.viewDetail.certificate = res.data.pictures.filter(item => item.pictureType === 3);
                this.viewDetail.voucher = res.data.pictures.filter(item => (item.pictureType === 4 || item.pictureType === 6));
                this.viewShow = true;
                // })
                let reason = []
                res.data.recordVos.map((item) => {
                    if (item) {
                        reason.push(item)
                    }
                });
                this.recordList = reason.map(item => {
                    item.stateName = this.getSatusArr1(item.state)
                        ? this.getSatusArr1(item.state).stateName
                        : "未知状态";
                    return item;
                });
                this.examineList = this.recordList;
                this.examineList.forEach(item => {
                    (item.state != 4 && item.state != 9) ? (item.state = "通过") : (item.state = "拒绝");
                });
                this.totalList = this.examineList;

            })
        },
        record(row) {
            queryDeedTaxRecord({ code: row.code }).then((res) => {
                let reason = []
                res.data.map((item) => {
                    if (item) {
                        reason.push(item)
                    }
                });
                this.recordList = reason.map(item => {
                    item.stateName = this.getSatusArr1(item.state)
                        ? this.getSatusArr1(item.state).stateName
                        : "未知状态";
                    return item;
                });
                this.recordShow = true;
            })
        },
        dispatch(row) {
            this.$prompt(`确定通过该申请的退税办理吗?`, "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                inputPlaceholder: "请输入退税金额(万元)",
                inputType: "textarea",
                type: "warning"
            })
                .then(({ value }) => {
                    if (!value) {
                        this.$message.error("未输入退税金额(万元)");
                        return;
                    }
                    let params = {
                        code: row.code,
                        idCard: row.idCard,
                        phone: row.phone,
                        createTime: row.createTime,
                        name: this.userName,
                        departmentName: this.departmentName,
                        taxReimbursementAmount: value,
                        // name: '市财政局',
                        state: 6,
                        reviewerId: row.reviewerId,
                        reason: '退税办理通过'
                    };
                    updateDeedTaxState(params).then(res => {
                        if (res.success) {
                            this.$message.success(`退税办理成功`);
                            this.init();
                        }
                    });
                })
                .catch(() => {
                    // console.log("取消审核");
                });
        },
        pass(row) {
            this.$prompt(`确定通过该申请的复审吗?`, "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                inputPlaceholder: "请输入原因",
                inputType: "textarea",
                type: "warning"
            })
                .then(({ value }) => {
                    if (!value) {
                        this.$message.error("未输入原因");
                        return;
                    }
                    queryDeedTaxDetailInfo({ code: row.code }).then(res => {
                        if (res.success) {
                            let params = {
                                code: row.code,
                                idCard: res.data.idCard,
                                phone: res.data.phone,
                                createTime: row.createTime,
                                checkArea: row.checkArea,
                                name: this.userName,
                                departmentName: this.departmentName,
                                // name: '人才窗口',
                                state: 2,
                                reviewerId: row.reviewerId,
                                reason: value
                            };
                            updateDeedTaxState(params).then(res => {
                                if (res.success) {
                                    this.$message.success(`复审通过`);
                                    this.init();
                                    // if (this.$route.query.realEstateArea != '句容市') {
                                    //     dtSubsidy({ billType: 1, code: row.code }).then((res) => {
                                    //         console.log(res)
                                    //         if (!res.success) {
                                    //             this.$message.error(res.msg || '推送失败');
                                    //         }
                                    //     })
                                    // }
                                } else {
                                    this.$message.warning(res.msg || "该申请已被其他部门驳回，无法审核通过");
                                }
                            });
                        }
                    })
                })
                .catch(() => {
                    // console.log("取消审核");
                });
        },
        deny(row) {
            this.$prompt(`确定驳回该申请的复审吗?`, "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                inputPlaceholder: "请输入原因",
                inputType: "textarea"
            })
                .then(({ value }) => {
                    if (!value) {
                        this.$message.error("未输入原因");
                        return;
                    }
                    queryDeedTaxDetailInfo({ code: row.code }).then(res => {
                        if (res.success) {
                            let params = {
                                code: row.code,
                                idCard: res.data.idCard,
                                phone: res.data.phone,
                                createTime: row.createTime,
                                checkArea: row.checkArea,
                                name: this.userName,
                                departmentName: this.departmentName,
                                state: 4,
                                reviewerId: row.reviewerId,
                                reason: value
                            };

                            updateDeedTaxState(params).then(res => {
                                console.log(res)
                                this.$message.success(`复审驳回成功`);
                                this.init();
                            });
                        }
                    })
                    
                })
                .catch(() => {
                });
        },
        drevokeeny(row) {
            this.$confirm(`确定撤回该申请的审核结果吗?`, "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            }).then(() => {
                let params = {
                    code: row.code,
                    phone: row.phone,
                    reviewerId: row.reviewerId,
                    state: row.state
                }
                mainRevocation(params).then((res) => {
                    if (res.code == 200 || res.success) {
                        this.$message.success(res.data || '审核撤回成功');
                        this.init();
                    } else {
                        this.$message.error(res.msg);
                        this.init();
                    }
                })
            })
        },
        reassignment(row) {
            this.params.code = row.code;
            this.params.checkArea = row.checkArea;
            this.reassignmentShow = true
        },
        closeDialog() {
            this.reassignmentShow = false
            this.params = {
                code: '',
                checkArea: '',
                departmentCode: '10000031'
            }
        },
        handleChange(value) {
            if (value.length == 2) {
                this.params.checkArea = value[1]
            } else {
                this.params.checkArea = value[0]
            }
        },
        determine() {
            this.$confirm(`确定改派该申请的审核部门吗?`, "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
            }).then(() => {
                updateCheckArea(this.params).then((res) => {
                    if (res.success) {
                        this.reassignmentShow = false
                        this.$message.success(`改派成功`);
                        this.init();
                    } else {
                        this.$message.warning(res.msg || "该申请已被其他部门驳回，无法审核通过");
                    }
                })
            })
        },
        getSatusArr(state) {
            return this.stateList.filter(item => {
                return item.state === state;
            })[0];
        },
        getSatusArr1(state) {
            return this.stateList1.filter(item => {
                return item.state === state;
            })[0];
        }
    },
    created() {
        this.userName = localStorage.getItem('userName');
        // 10000027  人才窗口code   10000031 市财政局code退税办理
        this.searchForm.departmentCode = this.$route.query.departmentCode;
        // realEstateArea: 市区、镇江新区、丹徒区
        this.realEstateArea = this.$route.query.realEstateArea ? this.$route.query.realEstateArea : null
        // departmentName: 审核部门名称（左侧列表）
        this.departmentName = this.$route.query.departmentName
        this.init();
    }
};
</script>

<style lang="stylus" scoped>
@import '~@/stylus/common';

.content {
  max-height: 60vh;
  overflow-y: auto;

  .cell {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;

    .label {
      width: 150px;
      color: #999;
      text-align: left;

      span {
        color: red;
        font-size: 12px;
      }
    }

    .value {
      color: #000;
      text-align: left;
    }
    .value1{
      color: red;
    }
    .value2{
      color: green;
    }

    .info {
      .item {
        width: 100%;
        text-align: left;
        color: #000;
        margin-bottom: 10px;
      }

      .item:last-child {
        margin-bottom: 0;
      }
    }
  }
}
</style>
