选择物料

This commit is contained in:
2023-07-13 17:39:11 +08:00
parent 7c58abf301
commit 370b54d022
3 changed files with 48 additions and 33 deletions

View File

@@ -5,7 +5,7 @@
<div class="search-item">
<div class="search-label">车间</div>
<div class="filter_input_wraper">
<el-select v-model="value1" filterable clearable placeholder="请选择">
<el-select v-model="value1" filterable clearable placeholder="请选择" @change="changeValue">
<el-option
v-for="item in options1"
:key="item.value"
@@ -18,12 +18,12 @@
<div class="search-item">
<div class="search-label">设备</div>
<div class="filter_input_wraper">
<el-select v-model="value2" filterable clearable placeholder="请选择">
<el-select v-model="value2" filterable clearable placeholder="请选择" @change="changeValue">
<el-option
v-for="item in options2"
:key="item.value"
:label="item.label"
:value="item.value">
:key="item.device_code"
:label="item.device_name"
:value="item.device_code">
</el-option>
</el-select>
</div>
@@ -72,8 +72,7 @@
</template>
<script>
import {dictall, washdevicelist, washquery, washweighing, washweighingFinish} from '@config/getData2.js'
import {accDiv} from '@config/utils.js'
import {dictall, washdevicelist, washquery, washweighing, washweighingFinish} from '@config/getData1.js'
export default {
name: 'manpour',
data () {
@@ -127,16 +126,32 @@ export default {
this.toast(res.msg)
}
},
changeValue () {
if (this.value1 && this.value2) {
this._washquery()
}
},
// 1.2根据设备列表获取物料信息
async _washquery () {
let res = await washquery(this.value1, this.value2)
if (res.code === 200) {
this.material_spec = res.content[0].material_spec
this.material_code = res.content[0].material_code
this.material_name = res.content[0].material_name
} else {
this.toast(res.msg)
}
},
// 称重
async _washweighing () {
this.disabled1 = true
let list = []
list.push(this.value2)
try {
// let res = await washweighing(['A1_SKQX_05'])
let res = await washweighing(list)
this.toast(res.msg)
this.deviceinstor_weight = res.content[0].deviceinstor_weight
if (res.code === 200) {
this.deviceinstor_weight = res.content[0].deviceinstor_weight
}
this.disabled1 = false
} catch (e) {
this.disabled1 = false
@@ -151,14 +166,16 @@ export default {
}
try {
let res = await washweighingFinish(this.value1, this.value2, this.material_spec, this.material_code, this.material_name)
this.toast(res.msg)
this.value1 = ''
this.value2 = ''
this.material_spec = ''
this.material_code = ''
this.material_name = ''
if (res.code === 200) {
this.toast(res.msg)
this.value1 = ''
this.value2 = ''
this.material_spec = ''
this.material_code = ''
this.material_name = ''
this.$store.dispatch('setMaterObj', '')
}
this.disabled2 = false
this.$store.dispatch('setMaterObj', '')
} catch (e) {
this.disabled2 = false
}

View File

@@ -45,8 +45,6 @@ import {washsearchlist} from '@config/getData1.js'
export default {
data () {
return {
options1: [],
value1: '',
val1: '',
dataList: [],
pkId: '',