缓存线盘点
This commit is contained in:
@@ -119,5 +119,5 @@
|
||||
<style lang="stylus" scoped>
|
||||
@import '../../common/style/mixin.styl';
|
||||
.grid-wrap
|
||||
height calc(100% - 526rpx)
|
||||
height calc(100% - 237px) /** 42+ 15*6+ 35*3 */
|
||||
</style>
|
||||
@@ -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>
|
||||
|
||||
@@ -23,11 +23,15 @@
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-item search-item-btns">
|
||||
<button class="confirm-button" @tap="toSearch">查询</button>
|
||||
<button class="confirm-button" :disabled="disabled" @tap="toSure">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="confirm-button-wrap">
|
||||
<!-- <view class="confirm-button-wrap">
|
||||
<button class="confirm-button" @tap="toSearch()">查询</button>
|
||||
<button class="confirm-button" :disabled="disabled" @tap="toSure()">确认</button>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="grid-wrap">
|
||||
<table class="grid-table">
|
||||
@@ -89,6 +93,7 @@
|
||||
this.index1 = e
|
||||
if (this.index1) {
|
||||
this._getCacheLine(e)
|
||||
this.index2 = ''
|
||||
}
|
||||
},
|
||||
/** 选择器2 */
|
||||
@@ -139,9 +144,3 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '../../common/style/mixin.styl';
|
||||
.grid-wrap
|
||||
height calc(100% - 237px) /** 42+ 15*6+ 35*3 */
|
||||
</style>
|
||||
|
||||
@@ -23,11 +23,15 @@
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-item search-item-btns">
|
||||
<button class="confirm-button" @tap="toSearch">查询</button>
|
||||
<button class="confirm-button" :disabled="disabled" @tap="toSure">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="confirm-button-wrap">
|
||||
<!-- <view class="confirm-button-wrap">
|
||||
<button class="confirm-button" @tap="toSearch()">查询</button>
|
||||
<button class="confirm-button" :disabled="disabled" @tap="toSure()">确认</button>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="grid-wrap">
|
||||
<table class="grid-table">
|
||||
@@ -82,12 +86,16 @@
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this._getCacheLine('A1')
|
||||
},
|
||||
methods: {
|
||||
/** 选择器1 */
|
||||
selectChange1(e) {
|
||||
this.index1 = e
|
||||
if (this.index1) {
|
||||
this._getCacheLine(e)
|
||||
this.index2 = ''
|
||||
}
|
||||
},
|
||||
/** 选择器2 */
|
||||
@@ -138,9 +146,3 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
@import '../../common/style/mixin.styl';
|
||||
.grid-wrap
|
||||
height calc(100% - 237px) /** 42+ 15*6+ 35*3 */
|
||||
</style>
|
||||
86
pages/management/searchMater.vue
Normal file
86
pages/management/searchMater.vue
Normal file
@@ -0,0 +1,86 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<nav-bar :inner2="true" @goIn="goIn" title="物料查询"></nav-bar>
|
||||
<view class="search-confirm-wrap">
|
||||
<view class="search-wrap">
|
||||
<view class="search-item">
|
||||
<label class="search-label">物料</label>
|
||||
<view class="filter_input_wraper">
|
||||
<input type="text" class="search-input-l" v-model="val1">
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-item search-item-btns">
|
||||
<button class="confirm-button" @tap="_materialQuery">查询</button>
|
||||
<button class="confirm-button" :class="{'confirm-button_disabled': !pkId}" :disabled="disabled" @tap="toSure">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="grid-wrap">
|
||||
<table class="grid-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>选择</th>
|
||||
<th>编码</th>
|
||||
<th>名称</th>
|
||||
<th>规格</th>
|
||||
<th>系列</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="e in dataList" :key="e.material_uuid" @click="toRadio(e)">
|
||||
<td>
|
||||
<view class="iconfont icon-check" :class="{'icon-checked': pkId === e.material_uuid}"></view>
|
||||
</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
<td>{{e.material_name}}</td>
|
||||
<td>{{e.material_spec}}</td>
|
||||
<td>{{e.class_name}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import {materialQuery} from '@/utils/getData2.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
val1: '',
|
||||
dataList: [],
|
||||
disabled: false,
|
||||
pkId: '',
|
||||
pkObj: {}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
goIn () {
|
||||
uni.navigateTo({
|
||||
url: `/pages/management/hcxcheck`
|
||||
})
|
||||
},
|
||||
async _materialQuery () {
|
||||
let res = await materialQuery(this.val1)
|
||||
this.dataList = [...res.result]
|
||||
},
|
||||
toRadio (e) {
|
||||
this.pkId = this.pkId === e.material_uuid ? '' : e.material_uuid
|
||||
this.pkObj = this.pkId === material_uuid ? e : {}
|
||||
},
|
||||
toSure () {
|
||||
this.$store.dispatch('setPublicObj', this.pkObj)
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="stylus">
|
||||
.grid-wrap
|
||||
height: calc(100% - 137px); /** 42+ 15*4+ 35 */
|
||||
</style>
|
||||
Reference in New Issue
Block a user