软废型材入库

This commit is contained in:
2026-06-11 14:15:14 +08:00
parent b1e4f0ba4f
commit 1f28289c22
2 changed files with 302 additions and 0 deletions

View File

@@ -0,0 +1,297 @@
<template>
<section>
<nav-bar title="软废型材入库"></nav-bar>
<section class="content mgt186 mgb70">
<div class="filter-wraper">
<div class="bottom-filter-tip">
<div class="fxcol">
<search-box
class="pad"
label="载具码"
v-model="val1"
@handleChange="handleChange1"
></search-box>
</div>
<div class="mgl5">
<button class="btn btn1" @click="getPallet">查找托盘</button>
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">采购订单</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="val2" disabled>
</div>
<div class="mgl20">
<button class="btn" :disabled="disabled2" :class="{'btn-disabled': disabled2 === true}" @click="getBill">查找单据</button>
</div>
</div>
<search-box
label="桶码"
:focused="true"
v-model="val3"
@handleChange="handleChange3"
></search-box>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">软废等级</div>
<div class="fxcol mgl20 visible" >
<dropdown-menu
:option="option1"
:active="active1"
:open="open1"
@toggleItem="toggleItem1"
@dropdownMenu="dropdownMenu1">
</dropdown-menu>
</div>
</div>
</div>
<div class="grid-wraper">
<div class="left_fixed">
<table class="layout-t left_layout_t">
<tr>
<th>桶码</th>
</tr>
<tr v-for="e in dataList" :key="e.bucketunique" @click="toCheck(e)" :class="{'checked': e.bucketunique === pkId}">
<td>{{e.bucketunique}}</td>
</tr>
</table>
</div>
<div class="slide">
<table class="layout-t">
<tr>
<th>软废编码</th>
<th>批次</th>
<th>重量kg</th>
<th>是否新加</th>
<th>订单号</th>
</tr>
<tr v-for="e in dataList" :key="e.bucketunique" @click="toCheck(e)" :class="{'checked': e.bucketunique === pkId}">
<td>{{e.material_code}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.storage_qty | numeric(3)}}</td>
<td>{{['否', '是'][Number(e.is_new)]}}</td>
<td>{{e.bill_code}}</td>
</tr>
</table>
</div>
</div>
</section>
<section class="calc_value_wraper">
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">总重量</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="val4">
</div>
<div class="mgl20">KG</div>
</div>
</section>
<section class="submit-bar">
<button class="btn submit-button" :class="{'btn-disabled': this.pkId === ''}" @click="deleteList">删除行</button>
<button class="btn submit-button" :disabled="disabled1" :class="{'btn-disabled': dataList.length === 0}" @click="toSure">确认组盘</button>
</section>
</section>
</template>
<script>
import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue'
import DropdownMenu from '@components/DropdownMenu.vue'
import {checkVehicle, checkBucket, confirmVehicle, inIetIvtLevel} from '@config/getData2.js'
import {accAdd} from '@config/mUtils.js'
export default {
name: 'SoftWasteInStoreGroup',
components: {
NavBar,
SearchBox,
DropdownMenu
},
data () {
return {
val1: '',
vehicle: {},
bucket_rows: [],
val2: '',
val3: '',
dataList: [],
pkId: '',
disabled1: false,
disabled2: false,
option1: [],
active1: '',
open1: false
}
},
computed: {
val4 () {
let cur = '0.000'
this.dataList.map(el => {
cur = accAdd(cur, el.storage_qty)
})
cur = Number(cur).toFixed(3) + ''
return cur
}
},
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
activated () {
if (this.$store.getters.materObj !== '') this.val2 = this.$store.getters.materObj.source_bill_code
},
created () {
this._inIetIvtLevel()
},
methods: {
handleChange1 (e, type) {
if (type) {
this._checkVehicle(e, '5')
}
},
handleChange3 (e, type) {
if (this.val1 === '' || this.val1 === undefined) {
this.toast('请扫载具码')
return
}
if (type) {
this._checkBucket(e, '5')
}
},
toCheck (e) {
this.pkId = this.pkId === e.bucketunique ? '' : e.bucketunique
this.pkObj = this.pkId === e.bucketunique ? e : {}
},
/** 查找托盘 */
getPallet () {
this.$router.push('/SearchPallet')
},
/** 查找单据 */
getBill () {
this.$router.push('/SearchSoftWasteBill')
},
/** 删除行 */
deleteList () {
if (this.pkId !== '') {
if (this.pkObj.is_new === '1') {
this.dataList.map((el, i) => {
if (el.bucketunique === this.pkId) {
this.dataList.splice(i, 1)
}
})
} else {
this.toast('只能删新加的行')
}
}
},
/** 确认组盘 */
toSure () {
this.disabled1 = true
let flag = false
this.dataList.map(el => {
if (el.is_new === '1') {
flag = true
}
})
if (!flag) {
this.toast('至少添加一个桶码')
this.disabled1 = false
return
}
if (this.active1 === '') {
this.toast('请选择软废等级')
this.disabled1 = false
return
}
this._confirmVehicle()
},
/** 查询载具码 */
async _checkVehicle (code, type) {
let res = await checkVehicle(code, type)
if (res.code === '1') {
this.vehicle = res.vehicle_jo
this.val1 = res.vehicle_jo.storagevehicle_code
this.val3 = ''
this.disabled2 = false
this.dataList = []
this.pkId = ''
this.pkObj = {}
this.dataList = [...res.bucket_rows]
} else {
this.Dialog(res.desc)
}
},
/** 查询桶码信息 */
async _checkBucket (code, type) {
let res = await checkBucket(code, type)
if (res.code === '1') {
let arr = this.dataList.filter(el => { return el.bucketunique === res.bucket_jo.bucketunique })
if (arr.length) {
this.toast('存在相同的桶码信息')
this.val3 = ''
return
}
if (this.val2 !== '' && JSON.stringify(this.$store.getters.materObj) !== '{}' && res.bucket_jo.material_id !== this.$store.getters.materObj.material_id) {
this.toast('桶物料编码须与采购订单物料一致')
this.val3 = ''
return
}
if (this.val2 !== '') {
let obj = Object.assign({}, res.bucket_jo, this.$store.getters.materObj)
this.dataList.push(obj)
} else {
this.dataList.push(res.bucket_jo)
this.disabled2 = true
}
this.val3 = res.bucket_jo.bucketunique
} else {
this.val3 = ''
this.Dialog(res.desc)
}
},
async _confirmVehicle () {
try {
let res = await confirmVehicle('5', this.vehicle, this.dataList, null, null, this.option1[this.active1].value)
if (res.code === '1') {
this.toast(res.desc)
Object.assign(this.$data, this.$options.data())
this._inIetIvtLevel()
} else {
this.Dialog(res.desc)
}
this.disabled1 = false
} catch (e) {
this.disabled1 = false
}
},
/** 获取软废等级下拉框 */
async _inIetIvtLevel () {
let res = await inIetIvtLevel()
if (res.code === '1') {
this.option1 = [...res.ivtLevel]
} else {
this.Dialog(res.desc)
}
},
toggleItem1 () {
if (!this.open1) {
this.open1 = true
} else {
this.open1 = false
}
},
dropdownMenu1 (i) {
this.active1 = i + ''
this.open1 = false
}
}
}
</script>
<style lang="stylus" scoped>
.pad
padding-top 0
.btn1
max-width auto
font-size .2rem
padding 0 .1rem
</style>

View File

@@ -26,6 +26,7 @@ const FinishMaterInStoreGroup = r => require.ensure([], () => r(require('../page
const ProcedureReworkInStoreGroup = r => require.ensure([], () => r(require('../pages/xinrui/storage/instorage/ProcedureReworkInStoreGroup')), 'instorage')
const LikuReworkInStoreGroup = r => require.ensure([], () => r(require('../pages/xinrui/storage/instorage/LikuReworkInStoreGroup')), 'instorage')
const SoftWasteInStoreGroup = r => require.ensure([], () => r(require('../pages/xinrui/storage/instorage/SoftWasteInStoreGroup')), 'instorage')
const SoftWasteProfileInStore = r => require.ensure([], () => r(require('../pages/xinrui/storage/instorage/SoftWasteProfileInStore')), 'instorage')
const SearchPallet = r => require.ensure([], () => r(require('../pages/xinrui/storage/instorage/SearchPallet')), 'instorage')
const SearchSoftWasteBill = r => require.ensure([], () => r(require('../pages/xinrui/storage/instorage/SearchSoftWasteBill')), 'instorage')
const RemnantInStoreGroup = r => require.ensure([], () => r(require('../pages/xinrui/storage/instorage/RemnantInStoreGroup')), 'instorage')
@@ -235,6 +236,10 @@ export default new Router({
path: '/SoftWasteInStoreGroup', // 软废入库组盘
component: SoftWasteInStoreGroup
},
{
path: '/SoftWasteProfileInStore', // 软废型材入库
component: SoftWasteProfileInStore
},
{
path: '/SearchPallet', // 查找托盘
component: SearchPallet