Files
hht-xinrui-mes/src/pages/xinrui/equipment/SparePartOutstore.vue

96 lines
2.5 KiB
Vue
Raw Normal View History

2022-07-01 14:23:52 +08:00
<template>
<section>
<nav-bar title="备件出库"></nav-bar>
<section class="content mgt186">
<div class="grid-wraper">
<div class="left_fixed">
<table class="layout-t left_layout_t">
<tr>
<th>出库单号</th>
</tr>
2022-07-01 16:21:52 +08:00
<tr v-for="e in dataList" :key="e.iostorinvdtl_id" @click="toCheck(e)" :class="{'checked': e.iostorinvdtl_id === pkId}">
<td>{{e.bill_code}}</td>
2022-07-01 14:23:52 +08:00
</tr>
</table>
</div>
<div class="slide">
<table class="layout-t">
<tr>
<th>物料编码</th>
<th>物料名称</th>
<th>数量</th>
2022-07-01 16:21:52 +08:00
<th>已出数</th>
<th>单位</th>
<th>关联设备</th>
2022-07-01 14:23:52 +08:00
</tr>
2022-07-01 16:21:52 +08:00
<tr v-for="e in dataList" :key="e.iostorinvdtl_id" @click="toCheck(e)" :class="{'checked': e.iostorinvdtl_id === pkId}">
2022-07-01 14:23:52 +08:00
<td>{{e.material_code}}</td>
2022-07-01 16:21:52 +08:00
<td>{{e.material_name}}</td>
<td>{{e.plan_qty}}</td>
<td>{{e.finish_qty}}</td>
<td>{{e.qty_unit_name}}</td>
2022-07-01 14:23:52 +08:00
<td>{{e.device_code}}</td>
</tr>
</table>
</div>
</div>
</section>
<section class="submit-bar">
2022-07-01 16:21:52 +08:00
<button class="btn submit-button" :class="{'btn-disabled': !pkId}" @click="scaninstore">扫码出库</button>
2022-07-01 14:23:52 +08:00
</section>
</section>
</template>
<script>
import NavBar from '@components/NavBar.vue'
2022-07-01 16:21:52 +08:00
import { queryIODtl } from '@config/getData1.js'
2022-07-01 14:23:52 +08:00
export default {
name: 'SparePartOutstore',
components: {
2022-07-01 16:21:52 +08:00
NavBar
2022-07-01 14:23:52 +08:00
},
data () {
return {
dataList: [],
pkId: '',
pkObj: {}
}
},
2022-07-01 16:21:52 +08:00
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
2022-07-05 09:44:08 +08:00
created () {
this._queryIODtl()
},
2022-07-05 17:37:00 +08:00
activated () {
this._queryIODtl()
},
2022-07-01 14:23:52 +08:00
methods: {
2022-07-01 16:21:52 +08:00
/** 1.1出入库单查询 */
async _queryIODtl () {
let res = await queryIODtl('1')
if (res.code === '1') {
this.dataList = [...res.content.rows]
} else {
this.Dialog(res.desc)
2022-07-01 14:23:52 +08:00
}
},
toCheck (e) {
2022-07-01 16:21:52 +08:00
this.pkId = this.pkId === e.iostorinvdtl_id ? '' : e.iostorinvdtl_id
this.pkObj = this.pkId === e.iostorinvdtl_id ? e : {}
},
scaninstore () {
if (this.pkId) {
this.$store.dispatch('materObj', this.pkObj)
this.$router.push({
path: '/ScanOutStore'
})
}
2022-07-01 14:23:52 +08:00
}
}
}
</script>