修改handArea

This commit is contained in:
2022-06-28 19:07:35 +08:00
parent be4bc2dbda
commit 6714c8c8e5
2 changed files with 111 additions and 7 deletions

View File

@@ -39,7 +39,41 @@
</div>
</div>
</section>
<div v-if="active" class="msg_wrapper">
<div v-if="obj.status === ('0' || '1' || '2' || '3')" class="msg_wrapper">
<div class="msg_box">
<div class="msg_item">
<div class="label_item">当前设备</div>
<div class="from_item">
{{obj.device_name}}
</div>
</div>
<div class="msg_item">
<div class="label_item">当前物料</div>
<div class="from_item">
<el-select v-model="value" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
<div class="msg_item">
<div class="label_item">批次</div>
<div class="from_item">
<input type="text" class="input_item" v-model="batch">
</div>
</div>
<div class="msg_btns">
<button class="msg_btn" :disabled="disabled1" @click="cleanUp">清空</button>
<button class="msg_btn" :disabled="disabled2" @click="msgSure">确认</button>
<button class="msg_btn" @click="msgCancle">取消</button>
</div>
</div>
</div>
<div v-if="obj.status === '4'" class="msg_wrapper">
<div class="msg_box">
<div class="msg_item">
<p>请确认是否放货完成</p>
@@ -56,7 +90,7 @@
<script>
import NavBar from '@components/NavBar.vue'
import {handArea, handPoint, handpointPut} from '@config/getData2'
import {handArea, handPoint, handMatrial, handDeviceStatus, handpointPut} from '@config/getData2'
export default {
name: 'PointRelease',
components: {
@@ -71,7 +105,10 @@ export default {
pointArr: [],
regobj: {},
active: false,
options: [],
value: '',
obj: {},
batch: '',
disabled1: false,
disabled2: false
}
@@ -79,7 +116,6 @@ export default {
mounted () {
document.body.removeAttribute('class', 'login-bg')
this.initArea()
this.initHandMatrial()
},
beforeDestroy () {
clearInterval(this.timer)
@@ -91,8 +127,15 @@ export default {
}, this.interTime)
},
async initArea () {
let res = await handArea('1')
let res = await handArea('3')
if (res.code === '1') {
// if (res.result.length > 0) {
// res.result.map(el => {
// if (el.region_code === '5') {
// this.areaArr.push(el)
// }
// })
// }
this.areaArr = [...res.result]
this.areaArr.map(el => {
this.$set(el, 'checked', false)
@@ -118,6 +161,14 @@ export default {
this.Dialog(res.desc)
}
},
async initHandMatrial () {
let res = await handMatrial()
if (res.code === '1') {
this.options = [...res.result]
} else {
this.Dialog(res.desc)
}
},
getPonit (e) {
clearInterval(this.timer)
this.areaArr.map(el => {
@@ -148,9 +199,55 @@ export default {
}
},
setInfo (e) {
if (e.status === '4') {
this.active = true
this.obj = e
this.active = true
this.obj = e
this.value = e.material_type
this.batch = e.batch
},
msgCancle () {
this.active = false
this.obj = {}
this.value = ''
this.batch = ''
},
msgSure () {
this.disabled2 = true
this.handStatus(this.obj.device_code, this.value, '1', this.obj.status, this.batch)
this.active = false
},
cleanUp () {
this.disabled1 = true
this.handStatus(this.obj.device_code, '', '2', this.obj.status, '')
this.active = false
},
async handStatus (code, mtype, type, no, batch) {
try {
let res = await handDeviceStatus(code, mtype, type, no, batch)
if (res.code === '1') {
this.toast(res.desc)
clearInterval(this.timer)
var that = this
setTimeout(() => {
that.initPonit(this.regobj)
this.refresh(this.regobj)
this.value = ''
this.batch = ''
this.disabled1 = false
this.disabled2 = false
}, 2000)
} else {
this.Dialog(res.desc)
this.value = ''
this.batch = ''
this.disabled1 = false
this.disabled2 = false
}
} catch (err) {
console.log(err)
this.value = ''
this.batch = ''
this.disabled1 = false
this.disabled2 = false
}
},
cancle () {

View File

@@ -119,6 +119,13 @@ export default {
async initArea () {
let res = await handArea('1')
if (res.code === '1') {
// if (res.result.length > 0) {
// res.result.map(el => {
// if (el.region_code !== '5') {
// this.areaArr.push(el)
// }
// })
// }
this.areaArr = [...res.result]
this.areaArr.map(el => {
this.$set(el, 'checked', false)