人工倒料

This commit is contained in:
2023-07-13 11:09:54 +08:00
parent 9bbf67dd04
commit 0fa9c95c28
3 changed files with 406 additions and 0 deletions

View File

@@ -0,0 +1,254 @@
<template>
<div class="order-wraper">
<div class="search-confirm-wrap">
<div class="search-wrap">
<div class="search-item">
<div class="search-label">仓库</div>
<div class="filter_input_wraper">
<el-select v-model="value1" filterable clearable placeholder="请选择">
<el-option
v-for="item in options1"
:key="item.stor_id"
:label="item.stor_name"
:value="item.stor_id">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-label">单据类型</div>
<div class="filter_input_wraper">
<el-select v-model="value2" filterable clearable placeholder="请选择">
<el-option
v-for="item in options2"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-label">物料</div>
<div class="filter_input_wraper pointer" @click="searchMater">
<input type="text" class="filter-input" v-model="material_code" disabled>
</div>
</div>
<div class="search-item">
<div class="search-label">规格</div>
<div class="filter_input_wraper">
<input type="text" class="filter-input" v-model="material_spec" disabled>
</div>
</div>
<div class="search-item">
<div class="search-label">重量(g)</div>
<div class="filter_input_wraper">
<input type="number" class="filter-input" v-model="total_qty">
</div>
</div>
<div class="search-item">
<div class="search-label">单重(g)</div>
<div class="filter_input_wraper">
<input type="number" class="filter-input" v-model="unit_weight">
</div>
</div>
<div class="search-item">
<div class="search-label">数量</div>
<div class="filter_input_wraper">
<input type="number" class="filter-input" v-model="qty" disabled>
</div>
</div>
<div class="search-item">
<div class="search-label">入库点</div>
<div class="filter_input_wraper">
<el-select v-model="value3" filterable clearable placeholder="请选择">
<el-option
v-for="item in options3"
:key="item.point_code"
:label="item.point_name"
:value="item.point_code">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-label">载具号</div>
<div class="filter_input_wraper filter_input_wraper_1">
<input type="text" class="filter-input" v-model="storagevehicle_code">
</div>
<div class="filter_button">
<button class="button button--primary" :disabled="disabled1" @click="_callVehicle">呼叫空载具</button>
</div>
</div>
<div class="search-item">
<div class="search-label">备注</div>
<div class="filter_input_wraper">
<input type="text" class="filter-input" v-model="remark">
</div>
</div>
<div class="search-item_2">
<button class="button button--primary" :disabled="disabled2" :class="{'button--defalut': value1 === '' || value2 === '' || value3 === '' || material_code === '' || total_qty === '' || unit_weight === '' || storagevehicle_code === ''}" @click="toSure">确认入库</button>
<button class="button button--primary" @click="toJumpSearch">作业查询</button>
</div>
</div>
</div>
</div>
</template>
<script>
import {getBcpStor, getBillType, getPoint, callVehicle, createIn} from '@config/getData2.js'
import {accDiv} from '@config/utils.js'
export default {
name: 'semifinishedinstore',
data () {
return {
options1: [],
value1: '',
options2: [],
value2: '',
options3: [],
value3: '',
material_id: '',
material_code: '',
material_spec: '',
total_qty: '',
unit_weight: '',
storagevehicle_code: '',
remark: '',
disabled1: false,
disabled2: false
}
},
computed: {
qty () {
let res = ''
res = accDiv(this.total_qty, this.unit_weight)
res = Number(res).toFixed(3)
return res
}
},
watch: {
total_qty () {
this.total_qty = this.total_qty.indexOf('.') > -1 ? this.total_qty.slice(0, this.total_qty.indexOf('.') + 4) : this.total_qty
},
unit_weight () {
this.unit_weight = this.unit_weight.indexOf('.') > -1 ? this.unit_weight.slice(0, this.unit_weight.indexOf('.') + 4) : this.unit_weight
}
},
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
activated () {
if (this.$store.getters.materObj !== '') {
this.material_id = JSON.parse(this.$store.getters.materObj).material_id
this.material_code = JSON.parse(this.$store.getters.materObj).material_code
this.material_spec = JSON.parse(this.$store.getters.materObj).material_spec
this.unit_weight = Number(JSON.parse(this.$store.getters.materObj).net_weight).toFixed(3)
}
},
created () {
this._getBcpStor()
this._getBillType()
this._getPoint()
},
methods: {
// 仓库下拉框
async _getBcpStor () {
let res = await getBcpStor()
this.options1 = [...res.data]
},
// 单据类型下拉框
async _getBillType () {
let res = await getBillType()
this.options2 = [...res.data]
},
// 入库点下拉框
async _getPoint () {
let res = await getPoint()
this.options3 = [...res.data]
},
// 呼叫空载具
async _callVehicle () {
this.disabled1 = true
try {
let res = await callVehicle()
this.toast(res.message)
this.disabled1 = false
} catch (e) {
this.disabled1 = false
}
},
// 确认入库
async toSure () {
this.disabled2 = true
if (this.value1 === '' || this.value2 === '' || this.value3 === '' || this.material_code === '' || this.total_qty === '' || this.unit_weight === '' || this.storagevehicle_code === '') {
this.disabled2 = false
return
}
try {
let from = {
stor_id: this.value1,
bill_type: this.value2,
material_id: this.material_id,
material_code: this.material_code,
material_spec: this.material_spec,
total_qty: this.total_qty,
unit_weight: this.unit_weight,
qty: this.qty,
point_code: this.value3,
storagevehicle_code: this.storagevehicle_code,
remark: this.remark
}
let res = await createIn(from)
this.toast(res.message)
this.value1 = ''
this.value2 = ''
this.value3 = ''
this.material_id = ''
this.material_code = ''
this.material_spec = ''
this.total_qty = ''
this.unit_weight = ''
this.storagevehicle_code = ''
this.remark = ''
this.disabled2 = false
this.$store.dispatch('setMaterObj', '')
} catch (e) {
this.disabled2 = false
}
},
searchMater () {
this.$store.dispatch('setMaterObj', '')
this.$router.push('/semifinishedinmatersearch')
},
toJumpSearch () {
this.$router.push('/semifinishedinstoresearch')
},
handleBlur ($event) {
$event.target.value = Number($event.target.value).toFixed(3)
}
}
}
</script>
<style lang="stylus" scoped>
.search-item
width 49%
&:nth-child(3n+2)
margin-left 0
margin-right 0
&:nth-child(2n)
margin-left 2%
.search-item_2
width 100%
margin-left 0
.filter_button
width 96px
height 30px
.filter_input_wraper_1
width calc(100% - 156px)
padding-right 10px
</style>

View File

@@ -0,0 +1,142 @@
<template>
<div class="order-wraper">
<div class="search-confirm-wrap">
<div class="search-wrap">
<div class="search-item">
<div class="search-label">货位</div>
<div class="filter_input_wraper">
<input type="text" class="filter-input" v-model="val1">
</div>
</div>
<div class="search-item">
<div class="search-label">物料</div>
<div class="filter_input_wraper">
<input type="text" class="filter-input" v-model="val2">
</div>
</div>
<div class="search-item flexend">
<button class="button button--primary" @click="_checkGetMaterialIvt">查询</button>
<button class="button button--primary" :class="{'button--defalut': checkArr.length === 0}" @click="toSure">确定</button>
<button class="button button--primary" @click="clearUp">清除</button>
<button class="button button--primary" @click="colseUp">关闭</button>
</div>
</div>
</div>
<div class="grid_wraper" v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" infinite-scroll-distance="0" infinite-scroll-immediate-check="false">
<table class="filter-table">
<thead>
<tr>
<th>选择</th>
<th>库区</th>
<th>货位</th>
<th>物料编号</th>
<th>物料名称</th>
<th>重量</th>
<th>单重(g)</th>
<th>载具号</th>
</tr>
</thead>
<tbody>
<tr v-for="e in dataList" :key="e.struct_name" @click="toRadio(e)">
<td>
<button class="iconfont select_icon select_square_icon" :class="e.checked ? 'selected_icon' : 'unselect_icon'"></button>
</td>
<td>{{ e.sect_name }}</td>
<td>{{e.struct_name}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.canuse_qty | numeric(3)}}</td>
<td>{{ e.unit_weight | numeric(3) }}</td>
<td>{{ e.storagevehicle_code }}</td>
</tr>
</tbody>
</table>
<div class="loading-tips">{{desc}}</div>
</div>
</div>
</template>
<script>
import {checkGetMaterialIvt} from '@config/getData2.js'
export default {
data () {
return {
val1: '',
val2: '',
dataList: [],
checkArr: [],
page: 1,
size: '30',
busy: false,
desc: ''
}
},
created () {
this._checkGetMaterialIvt()
},
methods: {
// grid
async _checkGetMaterialIvt () {
this.page = 1
this.busy = false
this.desc = ''
let res = await checkGetMaterialIvt(this.val2, this.val1, this.page + '', this.size)
this.dataList = []
res.data.map(el => {
this.$set(el, 'checked', false)
})
this.dataList = [...res.data]
if (res.data.length < 30) {
this.busy = true
this.desc = '已加载全部数据'
}
},
async loadMore () {
this.busy = true
this.page++
let res = await checkGetMaterialIvt(this.val2, this.val1, this.page + '', this.size)
res.data.map(el => {
this.$set(el, 'checked', false)
})
this.dataList = [...this.dataList, ...res.data]
if (res.data.length < 30) {
this.busy = true
this.desc = '已加载全部数据'
} else {
this.busy = false
}
},
colseUp () {
this.$router.push('/semifinishedcheck')
},
toSure () {
if (this.checkArr.length === 0) {
return
}
this.$store.dispatch('setMaterArr', this.checkArr)
this.colseUp()
},
clearUp () {
this.checkArr = []
},
toRadio (e) {
e.checked = !e.checked
this.checkArr = this.dataList.filter(i => { return i.checked === true })
}
}
}
</script>
<style lang="stylus" scoped>
@import '~@style/mixin.styl'
.search-item
width 27%
&:nth-child(3)
width 42%
.filter_radius
_fj()
margin-right 15px
.filter_radius_label
margin-left 5px
_font(12px, 30px, #fff,,)
</style>

View File

@@ -30,6 +30,8 @@ const TemporaryLetteringLoad = r => require.ensure([], () => r(require('@page/mo
const cleanIndex = r => require.ensure([], () => r(require('@page/modules/clean/index')), 'clean')
const cleaningLoading = r => require.ensure([], () => r(require('@page/modules/clean/cleaning-loading')), 'clean')
const cleaningCutting = r => require.ensure([], () => r(require('@page/modules/clean/cleaning-cutting')), 'clean')
const manPour = r => require.ensure([], () => r(require('@page/modules/clean/man-pour')), 'clean')
const selectMater = r => require.ensure([], () => r(require('@page/modules/clean/select-mater')), 'clean')
const Homeset = r => require.ensure([], () => r(require('@page/homeset/index')), 'Homeset')
const Home = r => require.ensure([], () => r(require('@page/homeset/HomePage')), 'HomePage')
@@ -165,6 +167,14 @@ export default new Router({
path: '/cleaningcutting',
component: cleaningCutting,
meta: {guidePath: '2'}
}, {
path: '/manpour',
component: manPour,
meta: {guidePath: '3'}
}, {
path: '/selectmater',
component: selectMater,
meta: {guidePath: '4'}
}]
},
{