change
This commit is contained in:
@@ -12,6 +12,14 @@
|
||||
<input type="text" class="filter_input" v-model="val1">
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd-row border-bottom">
|
||||
<view class="zd-col-7">
|
||||
<span class="filter_label">物料类型</span>
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="zd_wrapper grid-wraper">
|
||||
<view class="slide_new">
|
||||
@@ -21,6 +29,7 @@
|
||||
<th>物料编码</th>
|
||||
<th>物料名称</th>
|
||||
<th>单位</th>
|
||||
<th>物料类型</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -28,6 +37,7 @@
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.measure_unit_id}}</td>
|
||||
<td>{{e.material_type}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -46,7 +56,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {selectMaterials} from '@/utils/getData4.js'
|
||||
import {rgfhSelectMaterials, getMaterialTypes} from '@/utils/getData4.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -55,6 +65,8 @@
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
options: [],
|
||||
index: '',
|
||||
val1: '',
|
||||
dataList: [],
|
||||
// dataList: [
|
||||
@@ -79,15 +91,34 @@
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
// this.searchList()
|
||||
this._getMaterialTypes()
|
||||
},
|
||||
methods: {
|
||||
async _getMaterialTypes () {
|
||||
try {
|
||||
let res = await getMaterialTypes()
|
||||
if (res) {
|
||||
this.options = res.data
|
||||
} else {
|
||||
this.options =[]
|
||||
}
|
||||
} catch (e) {
|
||||
this.options = []
|
||||
}
|
||||
},
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
if (this.val1 && this.index) {
|
||||
this.searchList()
|
||||
}
|
||||
},
|
||||
searchList () {
|
||||
this.dataList = []
|
||||
this.pageNum = 1
|
||||
this._selectMaterials()
|
||||
this._rgfhSelectMaterials()
|
||||
},
|
||||
async _selectMaterials () {
|
||||
let res = await selectMaterials(this.val1)
|
||||
async _rgfhSelectMaterials () {
|
||||
let res = await rgfhSelectMaterials(this.val1, this.index)
|
||||
this.dataList = res.data
|
||||
// this.totalCount = res.totalElements
|
||||
// if (res.totalElements > 0) {
|
||||
@@ -107,7 +138,7 @@
|
||||
this.status = 'loading'
|
||||
setTimeout(() => {
|
||||
this.pageNum++
|
||||
this._selectMaterials()
|
||||
this._rgfhSelectMaterials()
|
||||
}, 1000)
|
||||
} else { //停止加载
|
||||
this.status = 'noMore'
|
||||
|
||||
Reference in New Issue
Block a user