change
This commit is contained in:
@@ -13,6 +13,14 @@
|
||||
</view>
|
||||
<button class="mini-btn" type="primary" @tap="_queryMaterInfo">查询</button>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-6">
|
||||
<span class="filter_label">类别</span>
|
||||
</view>
|
||||
<view class="zd-col-18 filter_select">
|
||||
<uni-data-select v-model="index" :localdata="options"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd_wrapper grid-wraper">
|
||||
<view class="slide_new">
|
||||
@@ -48,7 +56,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {queryMaterInfo} from '@/utils/getData3.js'
|
||||
import {queryClass, queryMaterInfo} from '@/utils/getData3.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -58,6 +66,8 @@
|
||||
return {
|
||||
title: '',
|
||||
keyword: null,
|
||||
options: [],
|
||||
index: '',
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
pkObj: {}
|
||||
@@ -65,15 +75,34 @@
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
this._queryClass()
|
||||
this._queryMaterInfo()
|
||||
},
|
||||
methods: {
|
||||
handleFocus () {
|
||||
this.keyword = null
|
||||
},
|
||||
async _queryClass () {
|
||||
try {
|
||||
let res = await queryClass()
|
||||
if (res) {
|
||||
this.options = res.data
|
||||
} else {
|
||||
this.options = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.options = []
|
||||
}
|
||||
},
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
if (e) {
|
||||
this._queryMaterInfo()
|
||||
}
|
||||
},
|
||||
async _queryMaterInfo () {
|
||||
try {
|
||||
let res = await queryMaterInfo(this.keyword)
|
||||
let res = await queryMaterInfo(this.keyword, this.index)
|
||||
if (res && res.data.length > 0) {
|
||||
this.dataList = [...res.data]
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user