This commit is contained in:
2023-07-13 16:52:19 +08:00
parent 668b470586
commit 2cb8c23cbf
4 changed files with 132 additions and 150 deletions

View File

@@ -146,3 +146,41 @@ export const tmpcallVechile = (dcode, qty) => post('api/pda/tmpcallVechile', {
export const tmpsendVechile = (dcode) => post('api/pda/tmpsendVechile', {
device_code: dcode
})
// 公共接口
// 1.1车间列表
export const dictall = () => post('api/dict/all', {
})
// 人工倒料
// 1.1设备列表
export const washdevicelist = (wid) => post('api/device/list', {
workprocedure_id: wid
})
// 1.2根据设备列表获取物料信息
export const washquery = (parea, dcode) => post('api/pda/wash/query', {
product_area: parea,
device_code: dcode
})
// 1.3称重
export const washweighing = (list) => post('api/pda/wash/weighing', {
list: list
})
// 1.4确认
export const washweighingFinish = (dcode, dweight, mcode, mspec, mname) => post('api/pda/wash/weighingFinish', {
device_code: dcode,
deviceinstor_weight: dweight,
material_code: mcode,
material_spec: mspec,
material_name: mname
})
// 1.5查询物料列表
export const washsearchlist = (page, size, mcode) => post('api/pda/wash/searchlist', {
page: page,
size: size,
material_code: mcode
})

View File

@@ -26,7 +26,7 @@ export default {
},
computed: {
title () {
let res = ['清洗上料', '清洗下料', '人工倒料'][Number(this.$route.meta.guidePath) - 1]
let res = ['清洗上料', '清洗下料', '人工倒料', '选择物料'][Number(this.$route.meta.guidePath) - 1]
return res
},
...mapGetters(['keepAlive'])

View File

@@ -8,9 +8,9 @@
<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">
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
@@ -31,30 +31,40 @@
<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>
<input type="text" class="filter-input" v-model="material_spec" 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>
<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="number" class="filter-input" v-model="total_qty">
<input type="number" class="filter-input" v-model="material_name" 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="qty">
<input type="number" class="filter-input" v-model="deviceinstor_weight" disabled>
</div>
</div>
<!-- <div class="search-item">
<div class="search-label">重量(g)</div>
<div class="filter_input_wraper filter_input_wraper_1">
<input type="text" class="filter-input" v-model="deviceinstor_weight" disabled>
</div>
<div class="filter_button">
<button class="button button--primary" :disabled="disabled1" @click="_washweighing">称重</button>
</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>
<button class="button button--primary" :disabled="disabled1" @click="_washweighing">称重</button>
<button class="button button--primary" :disabled="disabled2" :class="{'button--defalut': value1 === '' || value2 === '' || material_spec === '' || material_code === '' || material_name === ''}" @click="toSure">确认</button>
<button class="button button--primary" @click="toCancel">取消</button>
</div>
</div>
</div>
@@ -62,45 +72,25 @@
</template>
<script>
import {getBcpStor, getBillType, getPoint, callVehicle, createIn} from '@config/getData2.js'
import {dictall, washdevicelist, washquery, washweighing, washweighingFinish} from '@config/getData2.js'
import {accDiv} from '@config/utils.js'
export default {
name: 'semifinishedinstore',
name: 'manpour',
data () {
return {
options1: [],
value1: '',
options2: [],
value2: '',
options3: [],
value3: '',
material_id: '',
material_code: '',
material_spec: '',
total_qty: '',
unit_weight: '',
storagevehicle_code: '',
remark: '',
material_code: '',
material_name: '',
deviceinstor_weight: '',
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', [])
@@ -109,77 +99,64 @@ export default {
},
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)
this.material_code = JSON.parse(this.$store.getters.materObj).material_code
this.material_name = JSON.parse(this.$store.getters.materObj).material_name
}
},
created () {
this._getBcpStor()
this._getBillType()
this._getPoint()
this._dictall()
this._washdevicelist()
},
methods: {
// 仓库下拉框
async _getBcpStor () {
let res = await getBcpStor()
this.options1 = [...res.data]
// 车间下拉框
async _dictall () {
let res = await dictall()
if (res.code === 200) {
this.options1 = [...res.content]
} else {
this.toast(res.msg)
}
},
// 单据类型下拉框
async _getBillType () {
let res = await getBillType()
this.options2 = [...res.data]
// 设备下拉框
async _washdevicelist () {
let res = await washdevicelist('1535144682756116480')
if (res.code === 200) {
this.options2 = [...res.content]
} else {
this.toast(res.msg)
}
},
// 入库点下拉框
async _getPoint () {
let res = await getPoint()
this.options3 = [...res.data]
},
// 呼叫空载具
async _callVehicle () {
// 称重
async _washweighing () {
this.disabled1 = true
let list = []
list.push(this.value2)
try {
let res = await callVehicle()
this.toast(res.message)
// let res = await washweighing(['A1_SKQX_05'])
let res = await washweighing(list)
this.toast(res.msg)
this.deviceinstor_weight = res.content[0].deviceinstor_weight
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 === '') {
if (this.value1 === '' || this.value2 === '' || this.material_spec === '' || this.material_code === '' || this.material_name === '') {
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)
let res = await washweighingFinish(this.value1, this.value2, this.material_spec, this.material_code, this.material_name)
this.toast(res.msg)
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.material_code = ''
this.material_name = ''
this.disabled2 = false
this.$store.dispatch('setMaterObj', '')
} catch (e) {
@@ -188,13 +165,10 @@ export default {
},
searchMater () {
this.$store.dispatch('setMaterObj', '')
this.$router.push('/semifinishedinmatersearch')
this.$router.push('/selectmater')
},
toJumpSearch () {
this.$router.push('/semifinishedinstoresearch')
},
handleBlur ($event) {
$event.target.value = Number($event.target.value).toFixed(3)
toCancel () {
this.$router.push('/home')
}
}
}

View File

@@ -3,20 +3,14 @@
<div class="search-confirm-wrap">
<div class="search-wrap">
<div class="search-item">
<div class="search-label">货位</div>
<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>
<div class="search-item_2 flexend">
<button class="button button--primary" @click="_washsearchlist">查询</button>
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" @click="toSure">确定</button>
<button class="button button--primary" @click="clearUp">清除</button>
<button class="button button--primary" @click="colseUp">关闭</button>
</div>
@@ -26,28 +20,18 @@
<table class="filter-table">
<thead>
<tr>
<th>选择</th>
<th>库区</th>
<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>
<tr v-for="(e, i) in dataList" :key="i" :class="{'selected_icon': pkId === e.material_code}" @click="toRadio(e)">
<td>{{i + 1}}</td>
<td>{{e.material_spec }}</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>
@@ -57,36 +41,35 @@
</template>
<script>
import {checkGetMaterialIvt} from '@config/getData2.js'
import {washsearchlist} from '@config/getData1.js'
export default {
data () {
return {
options1: [],
value1: '',
val1: '',
val2: '',
dataList: [],
checkArr: [],
pkId: '',
pkObj: {},
page: 1,
size: '30',
size: '22',
busy: false,
desc: ''
}
},
created () {
this._checkGetMaterialIvt()
this._washsearchlist()
},
methods: {
// grid
async _checkGetMaterialIvt () {
async _washsearchlist () {
this.page = 1
this.busy = false
this.desc = ''
let res = await checkGetMaterialIvt(this.val2, this.val1, this.page + '', this.size)
let res = await washsearchlist(this.page + '', this.size, this.val1)
this.dataList = []
res.data.map(el => {
this.$set(el, 'checked', false)
})
this.dataList = [...res.data]
if (res.data.length < 30) {
this.dataList = [...res.content]
if (res.content.length < 22) {
this.busy = true
this.desc = '已加载全部数据'
}
@@ -94,12 +77,9 @@ export default {
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) {
let res = await washsearchlist(this.page + '', this.size, this.val1)
this.dataList = [...this.dataList, ...res.content]
if (res.content.length < 22) {
this.busy = true
this.desc = '已加载全部数据'
} else {
@@ -107,36 +87,26 @@ export default {
}
},
colseUp () {
this.$router.push('/semifinishedcheck')
this.$router.push('/manpour')
},
toRadio (e) {
this.pkId = this.pkId === e.material_code ? '' : e.material_code
this.pkObj = this.pkId === e.material_code ? e : {}
},
toSure () {
if (this.checkArr.length === 0) {
if (!this.pkId) {
return
}
this.$store.dispatch('setMaterArr', this.checkArr)
this.$store.dispatch('setMaterObj', JSON.stringify(this.pkObj))
this.colseUp()
},
clearUp () {
this.checkArr = []
},
toRadio (e) {
e.checked = !e.checked
this.checkArr = this.dataList.filter(i => { return i.checked === true })
this.pkId = ''
this.pkObj = {}
}
}
}
</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>