| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- <template>
- <view class="content-box">
- <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="搜索" @clickLeft="back">
- <!--右菜单-->
- <template slot="right">
- <u-button type="success" size="small" class="u-reset-button" @click="openTreePicker"
- text="选择分类"></u-button>
- </template>
- </uni-nav-bar>
- <view class="top-wrapper">
- <view class="searchBox rx-bc">
- <input v-model="keyWord" placeholder="请输入关键字搜索" class="searchInput" />
- <view>
- <u-button @click="getList" type="success" class="u-reset-button" text="搜索">
- </u-button>
- </view>
- </view>
- </view>
- <view class="list_box">
- <u-list>
- <view v-for="(item,index) in list">
- <view>{{item}}</view>
- </view>
- </u-list>
- </view>
- <view class="bottom-wrapper rx-bc">
- <view>
- <checkbox v-if="!seletedAll" color="#fff" :checked="seletedAll" @tap="_seletedAll">全选</checkbox>
- <checkbox class="select-all" color="#fff" v-else :checked="seletedAll" @tap="_seletedAll">取消全选
- </checkbox>
- </view>
- <view>
- <u-button type="success" size="small" class="u-reset-button" :disabled="!checkListLen">
- <view class="selBtn"> 选择( {{ checkListLen }} ) </view>
- </u-button>
- </view>
- </view>
- <ba-tree-picker ref="treePicker" key="verify" :multiple="false" @select-change="confirm" title="选择分类"
- :localdata="classificationList" valueKey="id" textKey="name" childrenKey="children" />
- </view>
- </template>
- <script>
- import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
- import {
- treeByPid,
- pageeLedgerMain
- } from '@/api/pda/workOrder.js'
- export default {
- components: {
- baTreePicker
- },
- data() {
- return {
- keyWord: null,
- categoryLevelId: null,
- classificationList: [],
- treePickerShow: false,
- list: [],
- seletedAll: false, //全选状态
- checkListLen: 0,
- }
- },
- onLoad(option) {
- this.getTreeList()
- },
- methods: {
- _seletedAll() {
- this.seletedAll = !this.seletedAll
- },
-
- openTreePicker() {
-
- this.$refs.treePicker._show()
-
- },
- getTreeList() {
- let params = {
- ids: [1, 5, 7, 8, 10, 14, ]
- }
- treeByPid(params).then(res => {
- this.classificationList = res
- this.confirm([res[0].id], res[0].name)
- })
- },
- confirm(id, name) {
- this.categoryLevelId = id
- this.getList()
- },
- getList() {
- let param = {
- categoryLevelId: this.categoryLevelId,
- keyWord: this.keyWord,
- pageNum: 1,
- size: -1
- }
- pageeLedgerMain(param).then(res => {
- this.list = res.list
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .content-box {
- height: 100vh;
- overflow: hidden;
- display: flex;
- flex-direction: column;
- background-color: $page-bg;
- }
- .searchBox {
- background-color: #dedede;
- height: 100rpx;
- padding: 0 20rpx;
- input {
- height: 80rpx;
- width: 540rpx;
- background: #f9f9f9 !important;
- padding-left: 10rpx;
- border-radius: 5rpx;
- }
- }
- .list_box {
- flex: 1;
- overflow: hidden;
- padding: 6rpx 0;
- .u-list {
- height: 100% !important;
- }
- }
- .bottom-wrapper {
- height: 80rpx;
- background: #fff;
- padding: 0 32rpx;
- /deep/ .uni-checkbox-input-checked {
- background-color: $theme-color !important;
- border-color: $theme-color !important;
- }
- }
- </style>
|