100 lines
3.3 KiB
Vue
100 lines
3.3 KiB
Vue
|
|
<template>
|
||
|
|
<div class="order-wraper">
|
||
|
|
<div class="search-confirm-wrap">
|
||
|
|
<div class="search-wrap">
|
||
|
|
<!-- <div class="search-item">
|
||
|
|
<div class="search-label">类别</div>
|
||
|
|
<div class="filter_input_wraper">
|
||
|
|
<el-select v-model="value1" filterable clearable placeholder="请选择">
|
||
|
|
<el-option
|
||
|
|
v-for="item in options1"
|
||
|
|
:key="item.stor_id"
|
||
|
|
:label="item.stor_name"
|
||
|
|
:value="item.stor_id">
|
||
|
|
</el-option>
|
||
|
|
</el-select>
|
||
|
|
</div>
|
||
|
|
</div> -->
|
||
|
|
<div class="search-item">
|
||
|
|
<div class="search-label">物料</div>
|
||
|
|
<div class="filter_input_wraper">
|
||
|
|
<input type="text" class="filter-input" v-model="val1">
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="search-item_2 flexend">
|
||
|
|
<button class="button button--primary" @click="_getMaterial">快速查询</button>
|
||
|
|
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" @click="toSure">确定</button>
|
||
|
|
<button class="button button--primary" @click="clearUp">清除</button>
|
||
|
|
<button class="button button--primary" @click="colseUp">关闭</button>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="grid_wraper">
|
||
|
|
<table class="filter-table">
|
||
|
|
<thead>
|
||
|
|
<tr>
|
||
|
|
<th>序号</th>
|
||
|
|
<th>物料编号</th>
|
||
|
|
<th>物料名称</th>
|
||
|
|
<th>物料类别</th>
|
||
|
|
<th>重量单位</th>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
<tbody>
|
||
|
|
<tr v-for="(e, i) in dataList" :key="i" :class="{'selected_icon': pkId === e.material_code}" @click="toRadio(e)">
|
||
|
|
<td>{{ i+1 }}</td>
|
||
|
|
<td>{{e.material_code}}</td>
|
||
|
|
<td>{{e.material_name}}</td>
|
||
|
|
<td>{{e.class_code}}</td>
|
||
|
|
<td>{{e.unit_name}}</td>
|
||
|
|
</tr>
|
||
|
|
</tbody>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
import {getMaterial} from '@config/getData2.js'
|
||
|
|
export default {
|
||
|
|
data () {
|
||
|
|
return {
|
||
|
|
options1: [],
|
||
|
|
value1: '',
|
||
|
|
val1: '',
|
||
|
|
dataList: [],
|
||
|
|
pkId: '',
|
||
|
|
pkObj: {}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
created () {
|
||
|
|
this._getMaterial()
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
// grid
|
||
|
|
async _getMaterial () {
|
||
|
|
let res = await getMaterial(this.val1)
|
||
|
|
this.dataList = [...res.data]
|
||
|
|
},
|
||
|
|
colseUp () {
|
||
|
|
this.$router.push('/semifinishedinstore')
|
||
|
|
},
|
||
|
|
toRadio (e) {
|
||
|
|
this.pkId = this.pkId === e.material_code ? '' : e.material_code
|
||
|
|
this.pkObj = this.pkId === e.material_code ? e : {}
|
||
|
|
},
|
||
|
|
toSure () {
|
||
|
|
this.$store.dispatch('setMaterObj', JSON.stringify(this.pkObj))
|
||
|
|
this.colseUp()
|
||
|
|
},
|
||
|
|
clearUp () {
|
||
|
|
this.pkId = ''
|
||
|
|
this.pkObj = {}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<style lang="stylus" scoped>
|
||
|
|
</style>
|