出入库

This commit is contained in:
2023-04-12 20:07:02 +08:00
parent a22f301eff
commit ccd0c28b84
8 changed files with 243 additions and 184 deletions

View File

@@ -20,8 +20,8 @@
</view>
</view>
<view class="confirm-button-wrap confirm-button-wrap-c">
<button class="confirm-button" @tap="toSearch">点位解绑</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !val1 || !index1}" :disabled="disabled" @tap="toSure">全部解绑</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !val1 || !index1}" :disabled="disabled1" @tap="toSure1">点位解绑</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !val1 || !index1}" :disabled="disabled2" @tap="toSure2">全部解绑</button>
</view>
</view>
</view>
@@ -31,7 +31,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getCacheLine, inOutExceptionInstQuery, inOutExceptionInstConfirm} from '@/utils/getData2.js'
import {getCacheLine, releasepoint} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -39,12 +39,12 @@
},
data() {
return {
options1: [{text: 'A1', value: 'A1'}, {text: 'A2', value: 'A2'}],
index1: 'A1',
options1: [],
index1: '',
val1: '',
dataList: [],
pkId: '',
disabled: false
disabled1: false,
disabled2: false
};
},
methods: {
@@ -52,67 +52,37 @@
selectChange1(e) {
this.index1 = e
},
toSearch () {
this.dataList = []
this.pkId = ''
this._inOutExceptionInstQuery()
toSure1 () {
this.disabled1 = true
if (!this.index1 || !this.val1) {
this.disabled1 = false
return
}
this._releasepoint('one')
},
async _getCacheLine (id) {
let res = await getCacheLine(id)
this.options2 = [...res]
toSure2 () {
this.disabled2 = true
if (!this.index1 || !this.val1) {
this.disabled2 = false
return
}
this._releasepoint('all')
},
async _inOutExceptionInstQuery () {
let res = await inOutExceptionInstQuery(this.index2)
this.dataList = [...res]
},
async toSure () {
this.disabled = true
if (!this.pkId) {
uni.showToast({
title: '请选择',
icon: 'none'
})
this.disabled = false
return
}
if (!this.index2) {
uni.showToast({
title: '请选择缓存线',
icon: 'none'
})
this.disabled = false
return
}
if (!this.index3) {
uni.showToast({
title: '请选择位置类型',
icon: 'none'
})
this.disabled = false
return
}
if (!this.val1) {
uni.showToast({
title: '请扫满箱码',
icon: 'none'
})
this.disabled = false
return
}
async _releasepoint (type) {
try {
let res = await inOutExceptionInstConfirm(this.index2, this.val1, this.pkId, this.index3)
this.disabled = false
this.toSearch()
let res = await inOutExceptionInstConfirm(this.index1, this.val1, type)
this.disabled1 = false
this.disabled2 = false
this.index1 = ''
this.val1 = ''
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled = false
this.disabled1 = false
this.disabled2 = false
}
},
toRadio (e) {
this.pkId = this.pkId === e.position_code ? '' : e.position_code
}
}
}