<style lang="sass">
    @import './sass/sort.scss'
</style>

<template>
    <div class="page-sort"  @click="showReasonList = false;showSortList = false">
        <h2>请选择分类</h2>
        <div class="row">
            <span class="key">分类：</span>
            <div class="select icon-down"  @click.stop="showSortList = !showSortList;showReasonList=false">
                <p class="label">{{sort.name}}</p>
                <div class="reason-list" v-show="showSortList">
                    <div class="list-wrap">
                        <p v-for="(item,index) in sortList" :key="index" @click.stop="selectSort(item)">
                            {{item.name}}
                        </p>
                    </div>

                </div>
            </div>
        </div>
        <div class="row">
            <span class="key">操作原因：</span>
            <div class="select icon-down" @click.stop="showReasonList = !showReasonList;showSortList=false">
                <p class="label">{{reason||''}}</p>
                <div class="reason-list" v-show="showReasonList">
                    <div class="list-wrap">
                        <p v-for="(item,index) in reasonMap" :key="index" @click.stop="selectReason(item)">
                            {{item}}
                        </p>
                    </div>

                </div>
            </div>
        </div>
        <textarea v-model="text"></textarea>
        <button class="submit" @click="submit()">确定</button>
    </div>
</template>
<script>
import sort from "./js/sort.js";
export default sort;
</script>
