2025-03-10 13:49:13 +08:00
|
|
|
|
<template>
|
|
|
|
|
<view>
|
2025-03-11 09:45:29 +08:00
|
|
|
|
<u-navbar back-text="返回" title="成品上架" :background="background"></u-navbar>
|
2025-03-10 13:49:13 +08:00
|
|
|
|
<u-form ref="testForm">
|
2025-03-11 17:57:17 +08:00
|
|
|
|
<!-- <u-form-item :border-bottom="false">
|
2025-03-10 13:49:13 +08:00
|
|
|
|
<p>单号:</p>
|
2025-03-11 09:45:29 +08:00
|
|
|
|
<u-input :border="true" v-model="receiveRequestName" placeholder="请扫描条码"
|
2025-03-10 13:49:13 +08:00
|
|
|
|
:focus="focusReceiveRequestName" @confirm="serachList" />
|
2025-03-11 17:57:17 +08:00
|
|
|
|
</u-form-item> -->
|
2025-03-10 13:49:13 +08:00
|
|
|
|
<u-form-item :border-bottom="false">
|
|
|
|
|
<p>条码:</p>
|
|
|
|
|
<u-input :border="true" v-model="barCode" placeholder="请扫描条码" :focus="focusBarCode"
|
|
|
|
|
@confirm="searchBarcode" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item :border-bottom="false">
|
2025-03-11 17:57:17 +08:00
|
|
|
|
<!-- <p>库位:</p>
|
|
|
|
|
<!-- <u-input :border="true" v-model="kw" placeholder="请扫描库位" :focus="focusKw" @confirm="ship" /> -->
|
|
|
|
|
<view>
|
|
|
|
|
<picker @change="ship" :range="listKW">
|
|
|
|
|
<label>选择库位:</label>
|
|
|
|
|
<label class="">{{listKW[index]}}</label>
|
|
|
|
|
</picker>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
2025-03-10 13:49:13 +08:00
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-form>
|
|
|
|
|
<view class="uni-padding-wrap uni-common-mt">
|
|
|
|
|
<uni-segmented-control :current="current" :values="items" :style-type="styleType"
|
|
|
|
|
:active-color="activeColor" @clickItem="onClickItem" />
|
|
|
|
|
</view>
|
|
|
|
|
<view>
|
|
|
|
|
<view v-show="current === 0">
|
|
|
|
|
<view class="material">
|
|
|
|
|
<u-form ref="materialform">
|
|
|
|
|
<uni-z-table :style="{'height': tabH+'px'}" :tableData="requestData" :columns="matColumns"
|
|
|
|
|
:showBottomSum="true" :rowNumbers="true" :pagination="true" >
|
|
|
|
|
</uni-z-table>
|
|
|
|
|
</u-form>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view v-show="current === 1">
|
|
|
|
|
<uni-card :is-shadow="false">
|
|
|
|
|
<view v-for="item in barCodeData">
|
2025-03-11 17:57:17 +08:00
|
|
|
|
<!-- SELECT
|
|
|
|
|
BSP.PALLETNAME ,
|
|
|
|
|
BSP.FGCODE ,
|
|
|
|
|
BSP.GRADE ,
|
|
|
|
|
BSP.REVISIONCODE ,
|
|
|
|
|
BSP.CHECKINCODE ,
|
|
|
|
|
BSP.DOMESTICEXPORT ,
|
|
|
|
|
BSP.BOXQTY ,
|
|
|
|
|
BSP.PANELQTY
|
|
|
|
|
FROM
|
|
|
|
|
ZIMES.BSFGMS_SHIP_PALLET BSP
|
|
|
|
|
WHERE BSP.PALLETNAME = '' AND BSP.INTERFACEFLAG = 'N' -->
|
2025-03-10 13:49:13 +08:00
|
|
|
|
<u-form>
|
2025-03-11 17:57:17 +08:00
|
|
|
|
<u-form-item>FGCODE: {{item.FGCODE}}</u-form-item>
|
|
|
|
|
<u-form-item>条码: {{item.PALLETNAME}}</u-form-item>
|
|
|
|
|
<u-form-item>内外销: {{item.DOMESTICEXPORT}}</u-form-item>
|
|
|
|
|
<u-form-item>BOXQTY: {{item.BOXQTY}}</u-form-item>
|
|
|
|
|
<u-form-item>PANELQTY: {{item.PANELQTY}}</u-form-item>
|
|
|
|
|
<u-form-item>GRADE: {{item.GRADE}}</u-form-item>
|
|
|
|
|
<u-form-item>REVISIONCODE: {{item.REVISIONCODE}}</u-form-item>
|
|
|
|
|
<u-form-item>CHECKINCODE: {{item.CHECKINCODE}}</u-form-item>
|
2025-03-10 13:49:13 +08:00
|
|
|
|
</u-form>
|
|
|
|
|
</view>
|
|
|
|
|
</uni-card>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view v-show="current === 2">
|
|
|
|
|
<uni-z-table :style="{'height': tabH+'px'}" :tableData="returnData" :columns="returnColumns"
|
|
|
|
|
:showBottomSum="true" :rowNumbers="true" :pagination="true">
|
|
|
|
|
</uni-z-table>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2025-03-11 17:57:17 +08:00
|
|
|
|
listKW: ['CK0015','CK0016'],
|
|
|
|
|
items: ['BOX列表', '成品信息', '已入库列表'], //分栏器的选项卡
|
2025-03-10 13:49:13 +08:00
|
|
|
|
tabH: 800, //表格的宽度
|
|
|
|
|
background: {
|
|
|
|
|
backgroundImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))'
|
|
|
|
|
}, //返回按钮的样式
|
|
|
|
|
//分栏器的样式
|
|
|
|
|
styles: [{
|
|
|
|
|
value: 'button',
|
|
|
|
|
text: '按钮',
|
|
|
|
|
checked: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'text',
|
|
|
|
|
text: '文字'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
colors: ['#007aff', '#4cd964', '#dd524d'],
|
|
|
|
|
current: 0,
|
|
|
|
|
colorIndex: 0,
|
|
|
|
|
activeColor: '#007aff',
|
|
|
|
|
styleType: 'text',
|
|
|
|
|
//---------------------------------------- 分割线上方都是引用的外部的组件使用的样式,下方才是是使用的数据
|
|
|
|
|
barCode: "", //条码
|
|
|
|
|
kw: "", //库位
|
|
|
|
|
receiveRequestName: "", //单据号
|
|
|
|
|
requestData: [], //材料列表
|
|
|
|
|
barCodeData: [], //条码信息
|
|
|
|
|
returnData: [], //已退料列表
|
|
|
|
|
shipRequestDetailName: "", //行号
|
|
|
|
|
focusBarCode: false, //条码焦点是否选中
|
|
|
|
|
focusReceiveRequestName: true, //默认选中单号焦点
|
|
|
|
|
focusKw: false, //库位焦点是否选中
|
|
|
|
|
ISRELEASE:"", //是否已扫描
|
2025-03-11 17:57:17 +08:00
|
|
|
|
siteName:"",
|
|
|
|
|
userId:"",
|
2025-03-10 13:49:13 +08:00
|
|
|
|
//对应材料列表下的表格的列
|
2025-03-11 17:57:17 +08:00
|
|
|
|
// SELECT
|
|
|
|
|
// BSB.BOXNAME ,
|
|
|
|
|
// BSB.PALLETNAME ,
|
|
|
|
|
// BSB.FGCODE ,
|
|
|
|
|
// BSB.GRADE ,
|
|
|
|
|
// BSB.REVISIONCODE ,
|
|
|
|
|
// BSB.DOMESTICEXPORT ,
|
|
|
|
|
// BSB.CHECKINCODE
|
|
|
|
|
// FROM
|
|
|
|
|
// ZIMES.BSFGMS_SHIP_BOX BSB
|
|
|
|
|
// WHERE
|
|
|
|
|
// BSB.PALLETNAME = ''
|
2025-03-10 13:49:13 +08:00
|
|
|
|
matColumns: [{
|
2025-03-11 17:57:17 +08:00
|
|
|
|
title: '箱号',
|
|
|
|
|
field: "BOXNAME",
|
|
|
|
|
width: 240,
|
2025-03-10 13:49:13 +08:00
|
|
|
|
sort: true,
|
|
|
|
|
align: "left"
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-03-11 17:57:17 +08:00
|
|
|
|
title: '栈板号',
|
|
|
|
|
field: "PALLETNAME",
|
2025-03-10 13:49:13 +08:00
|
|
|
|
width: 280,
|
|
|
|
|
sort: true,
|
|
|
|
|
align: "left"
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-03-11 17:57:17 +08:00
|
|
|
|
title: '完工料号',
|
|
|
|
|
field: "FGCODE",
|
2025-03-10 13:49:13 +08:00
|
|
|
|
width: 280,
|
|
|
|
|
sort: true,
|
|
|
|
|
align: "left"
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-03-11 17:57:17 +08:00
|
|
|
|
title: 'Lot等级',
|
|
|
|
|
field: "GRADE",
|
2025-03-10 13:49:13 +08:00
|
|
|
|
width: 150,
|
|
|
|
|
sort: true,
|
|
|
|
|
align: "right"
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-03-11 17:57:17 +08:00
|
|
|
|
title: '成品等级',
|
|
|
|
|
field: "REVISIONCODE",
|
2025-03-10 13:49:13 +08:00
|
|
|
|
width: 150,
|
|
|
|
|
sort: true,
|
|
|
|
|
align: "right"
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-03-11 17:57:17 +08:00
|
|
|
|
title: 'Check In',
|
|
|
|
|
field: "CHECKINCODE",
|
|
|
|
|
width: 180,
|
2025-03-10 13:49:13 +08:00
|
|
|
|
sort: true,
|
|
|
|
|
align: "center"
|
2025-03-11 17:57:17 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '内外销',
|
|
|
|
|
field: "DOMESTICEXPORT",
|
|
|
|
|
width: 180,
|
|
|
|
|
sort: true,
|
|
|
|
|
align: "right"
|
2025-03-10 13:49:13 +08:00
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
//对应已退料的表格的列
|
|
|
|
|
returnColumns: [{
|
|
|
|
|
title: '行号',
|
|
|
|
|
field: "ROWNO",
|
|
|
|
|
width: 120,
|
|
|
|
|
sort: true,
|
|
|
|
|
align: "left"
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '条码编号',
|
|
|
|
|
field: "PACKINGCODE",
|
|
|
|
|
width: 260,
|
|
|
|
|
sort: true,
|
|
|
|
|
align: "left"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '物料编号',
|
|
|
|
|
field: "MATERIALSPECNAME",
|
|
|
|
|
width: 280,
|
|
|
|
|
sort: true,
|
|
|
|
|
align: "left"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '数量',
|
|
|
|
|
field: "QTY",
|
|
|
|
|
width: 150,
|
|
|
|
|
sort: true,
|
|
|
|
|
align: "right"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.tabH = this.$GetRemainingHeight(5, 30); //定义表格的高度
|
2025-03-11 17:57:17 +08:00
|
|
|
|
let that=this
|
|
|
|
|
uni.getStorage({
|
|
|
|
|
key:"sitename",
|
|
|
|
|
success(res) {
|
|
|
|
|
that.siteName=res.data
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
uni.getStorage({
|
|
|
|
|
key:"userid",
|
|
|
|
|
success(res) {
|
|
|
|
|
that.userId=res.data
|
|
|
|
|
}
|
|
|
|
|
})
|
2025-03-10 13:49:13 +08:00
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
//分栏器的点击事件
|
|
|
|
|
onClickItem(e) {
|
|
|
|
|
if (this.current !== e.currentIndex) {
|
|
|
|
|
this.current = e.currentIndex //获取当前选中的index
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//焦点初始化,让页面所有的焦点同时只能存在一个
|
|
|
|
|
initfocus() {
|
|
|
|
|
this.focusReceiveRequestName = false //单号焦点
|
|
|
|
|
this.focusBarCode = false //条码焦点
|
|
|
|
|
this.focusKw = false //库位焦点
|
|
|
|
|
},
|
|
|
|
|
//获取焦点的公共方法
|
|
|
|
|
getfocus(nextfocus) {
|
|
|
|
|
this.initfocus()
|
|
|
|
|
this[nextfocus] //不能用this.nextfocus
|
|
|
|
|
this.$nextTick(() => { //vue是数据全部修改后才进行的视图更新,哪nextTick函数就是为了拿到最新的数据,还不懂的可以去百度
|
|
|
|
|
this[nextfocus] = true
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//扫描条码-------------回车搜索
|
|
|
|
|
searchBarcode() {
|
|
|
|
|
if (this.barCode == "") {
|
|
|
|
|
this.$showMessage("条码不能为空")
|
|
|
|
|
this.$playFail()
|
|
|
|
|
this.getfocus('focusBarCode')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.getbarcodeinfo() //搜索条码信息
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//扫描库位入库
|
|
|
|
|
ship() {
|
|
|
|
|
if (this.barCode == "") {
|
|
|
|
|
this.$showMessage("请扫描条码")
|
|
|
|
|
this.$playFail()
|
|
|
|
|
this.getfocus('focusBarCode')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (this.kw == "") {
|
|
|
|
|
this.$showMessage("请扫描库位")
|
|
|
|
|
this.$playFail()
|
|
|
|
|
this.getfocus('focusKw')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.scanKw() //扫描库位入库
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//扫描库位入库
|
|
|
|
|
scanKw() {
|
|
|
|
|
//发送入库请求
|
2025-03-11 17:57:17 +08:00
|
|
|
|
this.$MyRequest('/productinto/stockInPallet',{
|
2025-03-10 13:49:13 +08:00
|
|
|
|
barCode: this.barCode, //条码
|
|
|
|
|
billNo: this.receiveRequestName, //单号
|
2025-03-11 17:57:17 +08:00
|
|
|
|
userId: this.userId, //登录用户
|
|
|
|
|
site: this.siteName, //工厂名称
|
2025-03-10 13:49:13 +08:00
|
|
|
|
storageName: this.kw //库位
|
|
|
|
|
}).then(res=>{
|
|
|
|
|
if (res.data.success) {
|
|
|
|
|
this.$showMessage(res.data.message)
|
|
|
|
|
this.$playSuccess()
|
|
|
|
|
this.barCode = ""
|
|
|
|
|
this.kw = "" //清空条码和库位
|
|
|
|
|
this.getfocus('focusBarCode') //焦点聚焦到条码
|
|
|
|
|
} else {
|
|
|
|
|
this.$showMessage(res.data.message)
|
|
|
|
|
this.$playFail()
|
|
|
|
|
this.kw = "" //清空库位,焦点回到库位
|
|
|
|
|
this.getfocus('focusKw')
|
|
|
|
|
}
|
|
|
|
|
this.receivedmaterial() //请求后端展示已入库数据
|
|
|
|
|
}).catch(err=>{
|
|
|
|
|
//调用失败的话重新获取焦点发送请求
|
|
|
|
|
this.$showMessage(err);
|
|
|
|
|
this.$palyFail()
|
|
|
|
|
this.kw = '';
|
|
|
|
|
this.getfocus('focusKw')
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//获取条码明细
|
|
|
|
|
getbarcodeinfo() {
|
2025-03-11 17:57:17 +08:00
|
|
|
|
this.$MyRequest('/productinto/getPalletInfo',{
|
|
|
|
|
barCode: this.barCode
|
2025-03-10 13:49:13 +08:00
|
|
|
|
}).then(res=>{
|
|
|
|
|
if (res.data.success) {
|
|
|
|
|
this.barCodeData = res.data.resultObj //获取条码的数据
|
2025-03-11 17:57:17 +08:00
|
|
|
|
this.current = 0 //扫描条码的时候直接跳转到条码明细这个分栏器
|
2025-03-10 13:49:13 +08:00
|
|
|
|
setTimeout(()=>{
|
2025-03-11 09:45:29 +08:00
|
|
|
|
this.onClickItem(e)
|
2025-03-10 13:49:13 +08:00
|
|
|
|
})
|
2025-03-11 17:57:17 +08:00
|
|
|
|
if (res.data.resultObj != null) {
|
|
|
|
|
this.getmateriallist();
|
2025-03-10 13:49:13 +08:00
|
|
|
|
}
|
|
|
|
|
this.getfocus('focusKw') //条码下移到库位输入框
|
|
|
|
|
} else {
|
|
|
|
|
this.$showMessage(res.data.message)
|
|
|
|
|
this.barCode=""
|
|
|
|
|
this.getfocus('focusBarCode')
|
|
|
|
|
}
|
|
|
|
|
}).catch(err=>{
|
|
|
|
|
this.$showMessage(err)
|
|
|
|
|
this.barCode = "" //清空条码
|
|
|
|
|
this.getfocus('focusBarCode')
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//获取材料列表
|
|
|
|
|
getmateriallist() {
|
2025-03-11 17:57:17 +08:00
|
|
|
|
this.$MyRequest('/productinto/getBoxInfo',{
|
|
|
|
|
barCode: this.barCode
|
2025-03-10 13:49:13 +08:00
|
|
|
|
}).then(res=>{
|
|
|
|
|
if (res.data.success) {
|
|
|
|
|
this.requestData = res.data.resultObj //接后端返回的物料参数,并展示在表格里面
|
2025-03-11 17:57:17 +08:00
|
|
|
|
this.getfocus('focusKw')
|
2025-03-10 13:49:13 +08:00
|
|
|
|
} else {
|
|
|
|
|
this.$showMessage(res.data.message) //单号有问题的话重新聚焦在单号输入框
|
2025-03-11 17:57:17 +08:00
|
|
|
|
this.getfocus('focusBarCode')
|
2025-03-10 13:49:13 +08:00
|
|
|
|
}
|
|
|
|
|
}).catch(err=>{
|
|
|
|
|
this.$showMessage(err)
|
2025-03-11 17:57:17 +08:00
|
|
|
|
this.getfocus('focusBarCode') //请求失败的话重新聚焦在单号输入框
|
2025-03-10 13:49:13 +08:00
|
|
|
|
})
|
|
|
|
|
},
|
2025-03-11 09:45:29 +08:00
|
|
|
|
|
2025-03-10 13:49:13 +08:00
|
|
|
|
//获取已入库列表
|
|
|
|
|
receivedmaterial() {
|
2025-03-11 17:57:17 +08:00
|
|
|
|
this.$MyRequest('/productinto/getintolist',{
|
2025-03-11 09:45:29 +08:00
|
|
|
|
receiveRequestName: this.receiveRequestName
|
|
|
|
|
}).then(res=>{
|
|
|
|
|
console.log(res)
|
|
|
|
|
if (res.data.success) {
|
|
|
|
|
this.returnData = res.data.resultObj//接数据后展示
|
|
|
|
|
} else console.log("已入库列表"+res.data.message)
|
|
|
|
|
}).catch(err=>{
|
|
|
|
|
this.$showMessage(err)
|
|
|
|
|
})
|
2025-03-10 13:49:13 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
|
|
|
|
</style>
|
2025-03-11 17:57:17 +08:00
|
|
|
|
|