批量入库

This commit is contained in:
2023-08-01 16:16:43 +08:00
parent 7be2ddee5d
commit af20b732c3
4 changed files with 197 additions and 189 deletions

View File

@@ -8,24 +8,23 @@
<el-select v-model="value1" filterable clearable placeholder="请选择">
<el-option
v-for="item in options1"
:key="item.value"
:label="item.label"
:value="item.value">
:key="item.stor_code"
:label="item.stor_name"
:value="item.stor_code">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-label">单据类型</div>
<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>
<input type="text" class="filter-input" v-model="storagevehicle_code">
</div>
</div>
<div class="search-item">
<div class="search-label">订单</div>
<div class="filter_input_wraper">
<input type="text" class="filter-input" v-model="sale_code">
</div>
</div>
<div class="search-item">
@@ -34,6 +33,19 @@
<el-select v-model="value2" filterable clearable placeholder="请选择">
<el-option
v-for="item in options2"
: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">
<el-select v-model="value3" filterable clearable placeholder="请选择">
<el-option
v-for="item in options3"
:key="item.value"
:label="item.label"
:value="item.value">
@@ -42,11 +54,11 @@
</div>
</div>
<div class="search-item_3">
<button class="button button--primary" @click="_washQuery">查询</button>
<button class="button button--primary" :disabled="disabled1" :class="{'button--defalut': checkArr.length === 0}" @click="_washSubmitWash">设置站点</button>
<button class="button button--primary">确认入库</button>
<button class="button button--primary" @click="toJump">托盘明细</button>
<button class="button button--primary">删除一行</button>
<button class="button button--primary" @click="_finishproductBucket">查询</button>
<button class="button button--primary" :class="{'button--defalut': checkArr.length === 0}" @click="setPoint">设置站点</button>
<button class="button button--primary" :disabled="disabled1" :class="{'button--defalut': dataList.length === 0}" @click="_finishproductBatchin">确认入库</button>
<button class="button button--primary" :class="{'button--defalut': checkArr.length !== 1}" @click="toJump">托盘明细</button>
<button class="button button--primary" :class="{'button--defalut': checkArr.length !== 1}" @click="toDelect">删除一行</button>
</div>
</div>
</div>
@@ -57,6 +69,7 @@
<th>选择</th>
<th>序号</th>
<th>托盘号</th>
<th>组盘日期</th>
<th>订单号</th>
<th>订单行号</th>
<th>规格</th>
@@ -70,14 +83,15 @@
<td>
<button class="iconfont select_icon select_square_icon" :class="e.checked ? 'selected_icon' : 'unselect_icon'"></button>
</td>
<td>{{ i+1 }}</td>
<td>{{ e.device_code }}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.deviceinstor_weight | unitskg}}</td>
<td>{{ e.deviceinstor_qty | numeric(3) }}</td>
<td>{{ e.task_code }}</td>
<td>{{ e.update_time }}</td>
<td>{{ e.sqe_on }}</td>
<td>{{e.storagevehicle_code}}</td>
<td>{{ e.create_time }}</td>
<td>{{e.sale_code}}</td>
<td>{{e.sale_seq_no}}</td>
<td>{{ e.material_spec }}</td>
<td>{{ e.storage_qty }}</td>
<td>{{ e.count }}</td>
<td>{{ e.point_code }}</td>
</tr>
</tbody>
</table>
@@ -86,7 +100,8 @@
</template>
<script>
import {dictAll, washSpecList, washQuery, washSubmitWash} from '@config/getData2.js'
import { getBillType, getPoint } from '../../../config/getData1.js'
import {finishproductStor, finishproductBucket, finishproductBatchin} from '@config/getData2.js'
export default {
name: 'batchinstore',
data () {
@@ -95,59 +110,105 @@ export default {
value1: '',
options2: [],
value2: '',
options3: [],
value3: '',
storagevehicle_code: '',
sale_code: '',
dataList: [],
checkArr: [],
disabled1: false
}
},
created () {
this._dictAll()
this._washSpecList()
this._finishproductStor()
this._getPoint()
this._getBillType()
},
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login' || to.path === '/batchtasksearch') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
activated () {
},
methods: {
// 车间下拉框
async _dictAll () {
let res = await dictAll()
// 仓库下拉框
async _finishproductStor () {
let res = await finishproductStor()
if (res.code === 200) {
this.options1 = [...res.content]
this.value1 = this.options1[0].value
this._washQuery()
}
},
// 规格下拉框
async _washSpecList () {
let res = await washSpecList()
if (res.code === 200) {
this.options2 = [...res.content]
}
// 入库点下拉框
async _getPoint () {
let res = await getPoint()
this.options2 = [...res.data]
},
// 单据类型下拉框
async _getBillType () {
let res = await getBillType()
this.options3 = [...res.data]
},
// grid
async _washQuery () {
let res = await washQuery(this.value1, this.value2)
async _finishproductBucket () {
let res = await finishproductBucket(this.storagevehicle_code, this.value1, this.sale_code)
if (res.code === 200) {
this.checkArr = []
res.content.map(el => {
this.$set(el, 'checked', false)
this.$set(el, 'point_code', '')
this.$set(el, 'stor_code', this.value1)
})
this.dataList = [...res.content]
}
},
// 确认上料
async _washSubmitWash () {
this.disabled1 = true
// 设置入库点
setPoint () {
if (!this.checkArr.length) {
return
}
if (this.value2 === '') {
this.toast('请选择入库点')
return
}
this.dataList.map(el => {
if (el.checked) {
this.$set(el, 'point_code', this.value2)
}
})
},
// 删除一行
toDelect () {
if (this.checkArr.length === 0) {
return
}
if (this.checkArr.length > 1) {
this.toast('请选择一行')
return
}
let sqe = this.checkArr[0].sqe_on
this.dataList.map((el, i) => {
if (sqe === el.sqe_on) {
this.dataList.splice(i, 1)
}
})
},
// 确认入库
async _finishproductBatchin () {
this.disabled1 = true
if (this.dataList.length === 0) {
this.disabled1 = false
return
}
try {
let arr = []
this.checkArr.map(el => {
arr.push(el.device_code)
this.dataList.map(el => {
this.$set(el, 'bill_code', this.value3)
})
let res = await washSubmitWash(arr)
let res = await finishproductBatchin(this.dataList)
if (res.code === 200) {
this.toast(res.msg)
this._washQuery()
this._finishproductBucket()
}
this.disabled1 = false
} catch (e) {
@@ -155,7 +216,21 @@ export default {
}
},
toJump () {
this.$router.push('/palletdetail')
if (this.checkArr.length === 0) {
return
}
if (this.checkArr.length > 1) {
this.toast('请选择一行')
return
}
let obj = this.checkArr[0]
this.$router.push({
path: '/palletdetail',
query: {
tcode: obj.storagevehicle_code,
code: obj.stor_code
}
})
},
toRadio (e) {
e.checked = !e.checked
@@ -167,5 +242,5 @@ export default {
<style lang="stylus" scoped>
.grid_wraper
height calc(100% - 1.1rem)
height calc(100% - 1.6rem)
</style>

View File

@@ -2,181 +2,74 @@
<div class="order-wraper">
<div class="search-confirm-wrap">
<div class="search-wrap">
<div class="search-item_2">
<div class="search-label">工单日期</div>
<div class="filter_input_wraper">
<el-date-picker
v-model="value1"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</div>
</div>
<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 filter-input_1" placeholder="工单号、物料编码">
<i v-show="closeIcon1" class="iconfont close_icon" @click="clearData(1)"></i>
</div>
</div>
<div class="search-item">
<div class="search-label">物料</div>
<div class="filter_input_wraper">
<input type="text" class="filter-input filter-input_1" placeholder="工单号、物料编码">
<i v-show="closeIcon1" class="iconfont close_icon" @click="clearData(1)"></i>
<input type="text" class="filter-input" v-model="$route.query.tcode">
</div>
</div>
<div class="search-item_2">
<button class="button button--primary" @click="_bypda">查询</button>
<button class="button button--primary" :class="{'button--defalut': pkId === ''}" @click="toSure">确定</button>
<button class="button button--primary">清除</button>
<button class="button button--primary">关闭</button>
<button class="button button--primary" @click="toJump">关闭</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">
<div class="grid_wraper">
<table class="filter-table">
<thead>
<tr>
<th>选择</th>
<th></th>
<th>日期</th>
<th></th>
<th>客户</th>
<th>箱号</th>
<th>物料编码</th>
<th>物料名称</th>
<th>物料类别</th>
<th>数量</th>
<th>单位</th>
<th>序号</th>
<th>托盘</th>
<th>组盘日期</th>
<th>单号</th>
<th>订单行号</th>
<th>规格</th>
<th>数量</th>
<th>明细数</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'selected_icon': pkId === e.struct_code}" @click="toRadio(e)">
<td>{{ i + 1 }}</td>
<td>{{e.struct_code}}</td>
<td>{{e.storagevehicle_code}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.canuse_qty | numeric(3)}}</td>
<td>{{ e.material_code }}</td>
<td>{{ e.instorage_time }}</td>
<td>{{ e.is_pick === true ? '是' : '否' }}</td>
<td>{{ e.instorage_type }}</td>
<tr v-for="(e, i) in dataList" :key="i">
<td>{{ e.sqe_on }}</td>
<td>{{e.storagevehicle_code}}</td>
<td>{{ e.create_time }}</td>
<td>{{e.sale_code}}</td>
<td>{{e.sale_seq_no}}</td>
<td>{{ e.material_spec }}</td>
<td>{{ e.storage_qty }}</td>
<td>{{ e.count }}</td>
</tr>
</tbody>
</table>
<div class="loading-tips">{{desc}}</div>
</div>
</div>
</template>
<script>
import { bypda } from '@config/getData2.js'
import {finishproductBucket2} from '@config/getData2.js'
export default {
name: 'palletdetail',
data () {
return {
dataList: [],
pkId: '',
pkObj: {},
page: 1,
size: '99',
busy: false,
desc: ''
dataList: []
}
},
created () {
this._bypda()
},
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login' || to.path === '/letteringtasklist') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
activated () {
this._finishproductBucket()
},
methods: {
clearData (e) {
switch (e) {
case 1:
this.keyValue = ''
break
}
},
// grid
async _bypda () {
this.page = 1
this.busy = false
this.desc = ''
let res = await bypda(this.page + '', this.size)
this.dataList = []
this.dataList = [...res.content]
if (res.content.length < 99) {
this.busy = true
this.desc = '已加载全部数据'
async _finishproductBucket () {
let res = await finishproductBucket2(this.$route.query.tcode, this.$route.query.code)
if (res.code === 200) {
this.dataList = [...res.content]
}
},
async loadMore () {
this.busy = true
this.page++
let res = await bypda(this.page + '', this.size)
this.dataList = [...this.dataList, ...res.content]
if (res.content.length < 99) {
this.busy = true
this.desc = '已加载全部数据'
} else {
this.busy = false
}
},
toRadio (e) {
this.pkId = this.pkId === e.struct_code ? '' : e.struct_code
this.pkObj = this.pkId === e.struct_code ? e : {}
},
toSure () {
if (!this.pkId) {
return
}
this.$router.push({
path: '/letteringmachineselect',
query: {
code: this.pkObj.struct_code,
weight: this.pkObj.canuse_qty
}
})
toJump () {
this.$router.push('/batchinstore')
}
}
}
</script>
<style lang="stylus" scoped>
.filter_item
&:nth-child(1)
width 37%
&:nth-child(2)
width calc(30% - 10px)
&:nth-child(3)
width calc(33% - 10px)
.filter-input_1
padding-right 30px
.close_icon
width 20px
height 20px
font-size 15px
line-height 20px
top 5px
right 10px
.search-item_2
margin-left 0
&:nth-child(4)
margin-left 2%
margin-right 0
.search-item
&:nth-child(2)
margin-left 2%
margin-right 0
.grid_wraper
height calc(100% - 1.1rem)
</style>