批量入库

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

@@ -408,3 +408,43 @@ export const operation = (id, method) => post('api/task/operation', {
task_id: id, task_id: id,
method_name: method method_name: method
}) })
/**
* 批量入库
*/
// 1.2仓库列表
export const finishproductStor = () => post('api/pda/finishproduct/stor', {})
// export const finishproductStor = () => {
// let res = {
// code: 200,
// content: [{stor_code: '1', stor_name: '1'}, {stor_code: '11', stor_name: '11'}]
// }
// return res
// }
// 1.1批量入库列表
export const finishproductBucket = (code, stor, sale) => post('api/pda/finishproduct/bucket', {
storagevehicle_code: code,
stor_code: stor,
sale_code: sale
})
// export const finishproductBucket = () => {
// let res = {
// code: 200,
// content: [{sqe_on: '1', storagevehicle_code: '1'}, {sqe_on: '11', storagevehicle_code: '11'}]
// }
// return res
// }
// 1.2确认入库
export const finishproductBatchin = (arr) => post('api/pda/finishproduct/batchin', arr)
// 1.1托盘明细
export const finishproductBucket2 = (code, stor) => post('api/pda/finishproduct/bucket', {
storagevehicle_code: code,
stor_code: stor
})
// export const finishproductBucket2 = () => {
// let res = {
// code: 200,
// content: [{sqe_on: '1', storagevehicle_code: '1'}, {sqe_on: '11', storagevehicle_code: '11'}]
// }
// return res
// }

View File

@@ -57,7 +57,7 @@ export default {
toPage2 (e) { toPage2 (e) {
let url = e.path let url = e.path
let name = url.substr(1) let name = url.substr(1)
if (name === 'semifinishedinstore' || name === 'semifinishedoutstore' || name === 'semifinishedcheck' || name === 'finishedinstore' || name === 'manpour' || name === 'letteringprocess') { if (name === 'semifinishedinstore' || name === 'semifinishedoutstore' || name === 'semifinishedcheck' || name === 'finishedinstore' || name === 'manpour' || name === 'letteringprocess' || name === 'batchinstore') {
this.$store.dispatch('setKeepAlive', [name]) this.$store.dispatch('setKeepAlive', [name])
} }
if (name === 'cleaningloading') { if (name === 'cleaningloading') {

View File

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

View File

@@ -2,181 +2,74 @@
<div class="order-wraper"> <div class="order-wraper">
<div class="search-confirm-wrap"> <div class="search-confirm-wrap">
<div class="search-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-item">
<div class="search-label">单据</div> <div class="search-label">托盘</div>
<div class="filter_input_wraper"> <div class="filter_input_wraper">
<input type="text" class="filter-input filter-input_1" placeholder="工单号、物料编码"> <input type="text" class="filter-input" v-model="$route.query.tcode">
<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>
</div> </div>
</div> </div>
<div class="search-item_2"> <div class="search-item_2">
<button class="button button--primary" @click="_bypda">查询</button> <button class="button button--primary" @click="toJump">关闭</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>
</div> </div>
</div> </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"> <table class="filter-table">
<thead> <thead>
<tr> <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> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'selected_icon': pkId === e.struct_code}" @click="toRadio(e)"> <tr v-for="(e, i) in dataList" :key="i">
<td>{{ i + 1 }}</td> <td>{{ e.sqe_on }}</td>
<td>{{e.struct_code}}</td>
<td>{{e.storagevehicle_code}}</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.material_spec }}</td>
<td>{{e.canuse_qty | numeric(3)}}</td> <td>{{ e.storage_qty }}</td>
<td>{{ e.material_code }}</td> <td>{{ e.count }}</td>
<td>{{ e.instorage_time }}</td>
<td>{{ e.is_pick === true ? '是' : '否' }}</td>
<td>{{ e.instorage_type }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="loading-tips">{{desc}}</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { bypda } from '@config/getData2.js' import {finishproductBucket2} from '@config/getData2.js'
export default { export default {
name: 'palletdetail', name: 'palletdetail',
data () { data () {
return { return {
dataList: [], dataList: []
pkId: '',
pkObj: {},
page: 1,
size: '99',
busy: false,
desc: ''
} }
}, },
created () { created () {
this._bypda() this._finishproductBucket()
},
beforeRouteLeave (to, from, next) {
if (to.path === '/home' || to.path === '/login' || to.path === '/letteringtasklist') {
this.$store.dispatch('setKeepAlive', [])
}
next()
},
activated () {
}, },
methods: { methods: {
clearData (e) {
switch (e) {
case 1:
this.keyValue = ''
break
}
},
// grid // grid
async _bypda () { async _finishproductBucket () {
this.page = 1 let res = await finishproductBucket2(this.$route.query.tcode, this.$route.query.code)
this.busy = false if (res.code === 200) {
this.desc = ''
let res = await bypda(this.page + '', this.size)
this.dataList = []
this.dataList = [...res.content] this.dataList = [...res.content]
if (res.content.length < 99) {
this.busy = true
this.desc = '已加载全部数据'
} }
}, },
async loadMore () { toJump () {
this.busy = true this.$router.push('/batchinstore')
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
}
})
} }
} }
} }
</script> </script>
<style lang="stylus" scoped> <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> </style>