缓存线盘点

This commit is contained in:
2023-05-22 11:28:32 +08:00
parent c6516a16ff
commit d3d89424a0
3 changed files with 100 additions and 33 deletions

View File

@@ -16,7 +16,9 @@
</view>
</view>
<view class="search-item flexend">
<button class="confirm-button" @tap="toSearch()">&nbsp;&nbsp;</button>
<button class="confirm-button" :disabled="disabled4" @tap="_cacheLineHandCheck">盘点开始</button>
<button class="confirm-button" :disabled="disabled5" @tap="_cacheLineHandCheckEnd">盘点结束</button>
<button class="confirm-button" @tap="toSearch()">刷新</button>
</view>
</view>
</view>
@@ -43,6 +45,7 @@
<view v-if="Number(e.vehicle_status) !== 5" class="material-item" v-for="(e, i) in dataList" :key="i" :class="['bg-gray', 'bg-green', 'bg-yellow','bg-red'][Number(e.vehicle_status) - 1]" @tap="toInfo(e)">
<view class="material-title">{{e.vehicle_code}}</view>
<view class="material-spec">{{e.material_spec}}</view>
<view v-show="e.layer_num === 1 && (e.seat_order_num === 1 || e.seat_order_num === 2)" class="badge__content">{{['准备位', '对接位'][Number(e.seat_order_num) - 1]}}</view>
</view>
</view>
</view>
@@ -57,12 +60,12 @@
/>
</view>
</view>
<view class="search-item">
<!-- <view class="search-item">
<label class="search-label">工序</label>
<view class="filter_input_wraper">
<uni-data-select v-model="index3" :localdata="options3" @change="selectChange3"></uni-data-select>
</view>
</view>
</view> -->
<view class="search-item">
<label class="search-label">物料</label>
<view class="filter_input_wraper" @tap="searchMater">
@@ -107,7 +110,7 @@
</view>
</view>
<view class="confirm-button-wrap">
<button class="confirm-button" :class="{'confirm-button_disabled': !val1 || !index3 || !val6 || !val7}" :disabled="disabled1" @tap="_setfullBox">设为满框</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !val1 || !val6 || !val7}" :disabled="disabled1" @tap="_setfullBox">设为满框</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !val1}" :disabled="disabled2" @tap="_setEmptyBox">设为空框</button>
<button class="confirm-button" :class="{'confirm-button_disabled': !val1}" :disabled="disabled3" @tap="_deleteBox">删除</button>
</view>
@@ -120,7 +123,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getCacheLine, workprocedureQuery, getCacheLineMaterialInfo, setfullBox, setEmptyBox, deleteBox} from '@/utils/getData2.js'
import {getCacheLine, workprocedureQuery, getCacheLineMaterialInfo, setfullBox, setEmptyBox, deleteBox, cacheLineHandCheck, cacheLineHandCheckEnd} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -146,19 +149,15 @@
obj: {},
disabled1: false,
disabled2: false,
disabled3: false
disabled3: false,
disabled4: false,
disabled5: false
};
},
created () {
// for(let i = 1; i < 16; i++) {
// this.dataList.push({vehicle_code: i + '', material_spec: 'a', vehicle_status: '4'})
// if (i === 5) {
// this.dataList.push({vehicle_code: i + '', material_spec: 'a', vehicle_status: '5'})
// }
// }
this._getCacheLine('A1')
this._workprocedureQuery()
// this._workprocedureQuery()
},
destroyed () {
this.$store.dispatch('setPublicObj', '')
@@ -223,11 +222,11 @@
this.active = true
this.obj = e
this.val1 = this.obj.vehicle_code
this.options3.map(el => {
if (Number(el.workprocedure_code) === Number(e.workprocedure_code)) {
this.index3 = el.value
}
})
// this.options3.map(el => {
// if (Number(el.workprocedure_code) === Number(e.workprocedure_code)) {
// this.index3 = el.value
// }
// })
this.val2 = this.obj.material_code
this.val3 = this.obj.material_name
this.val4 = this.obj.material_spec
@@ -246,7 +245,7 @@
},
async _setfullBox () {
this.disabled1 = true
if (!this.val1 || !this.index3 || !this.val6 || !this.val7) {
if (!this.val1 || !this.val6 || !this.val7) {
this.disabled1 = false
return
}
@@ -301,6 +300,7 @@
try {
let obj = {}
this.$set(obj, 'vehicle_code', this.val1)
this.$set(obj, 'position_code', this.obj.position_code)
let res = await deleteBox(obj)
this.disabled3 = false
this.toSearch()
@@ -311,6 +311,32 @@
} catch (e) {
this.disabled3 = false
}
},
async _cacheLineHandCheck () {
this.disabled4 = true
try {
let res = await cacheLineHandCheck('0')
this.disabled4 = false
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled4 = false
}
},
async _cacheLineHandCheckEnd () {
this.disabled5 = true
try {
let res = await cacheLineHandCheckEnd('1')
this.disabled5 = false
uni.showToast({
title: res.message,
icon: 'none'
})
} catch (e) {
this.disabled5 = false
}
}
}
}
@@ -341,8 +367,9 @@
.delHeight
transition height .2s linear
height 0
// .search-item
// width 42%
// &:nth-child(1)
// margin-right 10px
.search-item
&:nth-child(1),&:nth-child(2)
width 30%
&:nth-child(3)
width 36%
</style>