缓存线盘点
This commit is contained in:
@@ -1,18 +1,26 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<nav-bar title="缓存线盘点"></nav-bar>
|
||||
<view class="search-confirm-wrap search-confirm-wrap1">
|
||||
<view class="search-wrap search-wrap1">
|
||||
<view class="search-item search-item1">
|
||||
<label class="search-label">缓存线</label>
|
||||
<view class="search-confirm-wrap">
|
||||
<view class="search-wrap">
|
||||
<view class="search-item">
|
||||
<label class="search-label">生产区域</label>
|
||||
<view class="filter_input_wraper">
|
||||
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="confirm-button-wrap confirm-button-wrap1">
|
||||
<view class="search-item">
|
||||
<label class="search-label">缓存线</label>
|
||||
<view class="filter_input_wraper">
|
||||
<uni-data-select v-model="index2" :localdata="options2" @change="selectChange2"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-item search-item1">
|
||||
<button class="confirm-button" @tap="toSearch()">刷 新</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="material-wrap">
|
||||
<view class="status-wrap">
|
||||
<view class="status-item">
|
||||
<text class="status-icon bg-gray"></text>
|
||||
@@ -31,11 +39,11 @@
|
||||
<text class="status-txt">异常</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="material-wrap">
|
||||
<view class="material-item" v-for="(e, i) in dataList" :key="i" :class="['bg-gray', 'bg-green', 'bg-yellow','bg-red'][Number(e.status) - 1]" @tap="toInfo(e)">
|
||||
<view class="material-title">{{e.vehicle_code}}</view>
|
||||
<view class="material-spec">{{e.material_spec}}</view>
|
||||
<view class="material-item-wrap">
|
||||
<view class="material-item" v-for="(e, i) in dataList" :key="i" :class="['bg-gray', 'bg-green', 'bg-yellow','bg-red'][Number(e.status) - 1]" @tap="toInfo(e)">
|
||||
<view class="material-title">{{e.vehicle_code}}</view>
|
||||
<view class="material-spec">{{e.material_spec}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="popup-bottom-wrap" :class="active === true ? 'addHeight' : 'delHeight'">
|
||||
@@ -52,56 +60,56 @@
|
||||
<view class="search-item">
|
||||
<label class="search-label">工序</label>
|
||||
<view class="filter_input_wraper">
|
||||
<uni-data-select v-model="index1" :localdata="options1" @change="selectChange1"></uni-data-select>
|
||||
<uni-data-select v-model="index3" :localdata="options3" @change="selectChange3"></uni-data-select>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-item">
|
||||
<label class="search-label">物料</label>
|
||||
<view class="filter_input_wraper">
|
||||
<view class="filter_input_wraper" @tap="searchMater">
|
||||
<input type="text" class="search-input-l" v-model="val2">
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-item">
|
||||
<label class="search-label">名称</label>
|
||||
<view class="filter_input_wraper">
|
||||
<view class="filter_input_wraper" @tap="searchMater">
|
||||
<input type="text" class="search-input-l" v-model="val3">
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-item">
|
||||
<label class="search-label">规格</label>
|
||||
<view class="filter_input_wraper">
|
||||
<view class="filter_input_wraper" @tap="searchMater">
|
||||
<input type="text" class="search-input-l" v-model="val4">
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-item">
|
||||
<label class="search-label">数量</label>
|
||||
<view class="filter_input_wraper">
|
||||
<input type="number" class="search-input-l" v-model="val5">
|
||||
<input type="number" class="search-input-l" v-model="val6">
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-item">
|
||||
<label class="search-label">重量</label>
|
||||
<view class="filter_input_wraper">
|
||||
<input type="number" class="search-input-l" v-model="val6">
|
||||
<input type="number" class="search-input-l" v-model="val7">
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-item">
|
||||
<label class="search-label">层</label>
|
||||
<view class="filter_input_wraper">
|
||||
<uni-data-select v-model="index2" :localdata="options2" @change="selectChange2"></uni-data-select>
|
||||
<input type="number" class="search-input-l" v-model="obj.layer_num" disabled>
|
||||
</view>
|
||||
</view>
|
||||
<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>
|
||||
<input type="text" class="search-input-l" v-model="obj.positionOrder_no" disabled>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="confirm-button-wrap">
|
||||
<button class="confirm-button" @tap="toSearch()">设为满框</button>
|
||||
<button class="confirm-button" :disabled="disabled" @tap="toSure()">设为空框</button>
|
||||
<button class="confirm-button" :disabled="disabled" @tap="toSure()">设为空位</button>
|
||||
<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}" :disabled="disabled2" @tap="_setEmptyBox">设为空框</button>
|
||||
<button class="confirm-button" :class="{'confirm-button_disabled': !val1}" :disabled="disabled3" @tap="_deleteBox">设为空位</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -111,13 +119,16 @@
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {getCacheLine, workprocedureQuery, getCacheLineMaterialInfo, setfullBox, setEmptyBox, deleteBox} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar
|
||||
NavBar,
|
||||
SearchBox
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options1: [],
|
||||
options1: [{text: 'A1', value: 'A1'}, {text: 'A2', value: 'A2'}],
|
||||
index1: '',
|
||||
options2: [],
|
||||
index2: '',
|
||||
@@ -129,29 +140,161 @@
|
||||
val4: '',
|
||||
val5: '',
|
||||
val6: '',
|
||||
val7: '',
|
||||
dataList: [],
|
||||
active: false
|
||||
active: false,
|
||||
obj: {},
|
||||
disabled1: false,
|
||||
disabled2: false,
|
||||
disabled3: false
|
||||
|
||||
};
|
||||
},
|
||||
created () {
|
||||
for(let i = 1; i < 16; i++) {
|
||||
this.dataList.push({vehicle_code: i + '', material_spec: '买了佛冷', status: '4'})
|
||||
this.dataList.push({vehicle_code: i + '', material_spec: 'a', status: '4'})
|
||||
}
|
||||
this._getCacheLine('A1')
|
||||
this._workprocedureQuery()
|
||||
},
|
||||
destroyed () {
|
||||
this.$store.dispatch('setPublicObj', '')
|
||||
},
|
||||
mounted () {
|
||||
if (this.$store.getters.publicObj !== '') {
|
||||
this.val2 = this.$store.getters.publicObj.material_code
|
||||
this.val3 = this.$store.getters.publicObj.material_name
|
||||
this.val4 = this.$store.getters.publicObj.material_spec
|
||||
this.val5 = this.$store.getters.publicObj.material_uuid
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 选择器1 */
|
||||
selectChange1(e) {
|
||||
this.index1 = e
|
||||
if (this.index1) {
|
||||
this._getCacheLine(e)
|
||||
this.index2 = ''
|
||||
}
|
||||
},
|
||||
/** 选择器2 */
|
||||
selectChange2(e) {
|
||||
this.index2 = e
|
||||
if (this.index2) {
|
||||
this._getCacheLineMaterialInfo()
|
||||
}
|
||||
},
|
||||
/** 缓存线 */
|
||||
async _getCacheLine (id) {
|
||||
let res = await getCacheLine(id)
|
||||
this.options2 = [...res.result]
|
||||
},
|
||||
async _getCacheLineMaterialInfo () {
|
||||
let res = await getCacheLineMaterialInfo(this.index1, this.index2)
|
||||
this.dataList = [...res.result]
|
||||
},
|
||||
/** 选择器3 */
|
||||
selectChange3(e) {
|
||||
this.index3 = e
|
||||
},
|
||||
/** 工序 */
|
||||
async _workprocedureQuery () {
|
||||
let res = await workprocedureQuery()
|
||||
this.options3 = [...res.result]
|
||||
},
|
||||
toSearch () {
|
||||
this._getCacheLineMaterialInfo()
|
||||
},
|
||||
toInfo(e) {
|
||||
// uni.navigateTo({
|
||||
// url: `/pages/management/hcxInfo`
|
||||
// })
|
||||
this.active = true
|
||||
this.obj = e
|
||||
this.val1 = this.obj.vehicle_code
|
||||
this.options3.map(el => {
|
||||
if (el.value === 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
|
||||
this.val5 = this.obj.material_uuid
|
||||
this.val6 = this.obj.quantity
|
||||
this.val7 = this.obj.weight
|
||||
},
|
||||
searchMater () {
|
||||
uni.navigateTo({
|
||||
url: '/pages/management/searchMater'
|
||||
})
|
||||
},
|
||||
closePop () {
|
||||
this.active = false
|
||||
},
|
||||
async __setfullBox () {
|
||||
this.disabled1 = true
|
||||
if (!this.val1 || !this.index3 || !this.val6 || !this.val7) {
|
||||
this.disabled1 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
this.$set(this.obj, 'vehicle_code', this.val1)
|
||||
this.$set(this.obj, 'workprocedure_code', this.index3)
|
||||
this.$set(this.obj, 'material_code', this.val2)
|
||||
this.$set(this.obj, 'material_name', this.val3)
|
||||
this.$set(this.obj, 'material_spec', this.val4)
|
||||
this.$set(this.obj, 'material_uuid', this.val5)
|
||||
this.$set(this.obj, 'quantity', this.val6)
|
||||
this.$set(this.obj, 'weight', this.val7)
|
||||
let res = await setfullBox(this.obj)
|
||||
this.disabled1 = false
|
||||
this.toSearch()
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled1 = false
|
||||
}
|
||||
},
|
||||
async _setEmptyBox () {
|
||||
this.disabled2 = true
|
||||
if (!this.val1) {
|
||||
this.disabled2 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let obj = {}
|
||||
this.$set(this.obj, 'vehicle_code', this.val1)
|
||||
this.$set(this.obj, 'workprocedure_code', this.index3)
|
||||
let res = await setEmptyBox(obj)
|
||||
this.disabled2 = false
|
||||
this.toSearch()
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled2 = false
|
||||
}
|
||||
},
|
||||
async _deleteBox () {
|
||||
this.disabled3 = true
|
||||
if (!this.val1) {
|
||||
this.disabled3 = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let obj = {}
|
||||
this.$set(this.obj, 'vehicle_code', this.val1)
|
||||
let res = await deleteBox(obj)
|
||||
this.disabled3 = false
|
||||
this.toSearch()
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (e) {
|
||||
this.disabled3 = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -159,15 +302,6 @@
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '../../common/style/mixin.styl';
|
||||
.search-confirm-wrap1
|
||||
_fj()
|
||||
.search-wrap1
|
||||
width 48%
|
||||
.search-item1
|
||||
width calc(100% - 120px)
|
||||
.confirm-button-wrap1
|
||||
width auto
|
||||
justify-content flex-start
|
||||
.popup-bottom-wrap
|
||||
position fixed
|
||||
bottom 0
|
||||
@@ -191,4 +325,11 @@
|
||||
.delHeight
|
||||
transition height .2s linear
|
||||
height 0
|
||||
.search-item
|
||||
width 42%
|
||||
&:nth-child(1)
|
||||
margin-right 10px
|
||||
.search-item1
|
||||
width calc(16% - 10px)
|
||||
justify-content flex-end
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user