新版本合并

master
ZZYQ 2025-09-15 15:06:51 +08:00
parent 53cb5e338c
commit db4f073e1f
9 changed files with 1910 additions and 8 deletions

View File

@ -14,6 +14,15 @@ const Api = {
surplusReturn: '/api/wms/pda/surplusReturn', surplusReturn: '/api/wms/pda/surplusReturn',
manualCall: '/api/wms/pda/manualCall', manualCall: '/api/wms/pda/manualCall',
surplusOut: '/api/wms/pda/surplusOut', surplusOut: '/api/wms/pda/surplusOut',
callEmptyRackIn: '/api/wms/pda/callEmptyRackIn',
}
/** 空容器入库 */
export const callEmptyRackIn = data => {
return request({
url: Api.callEmptyRackIn,
data: data,
method: 'POST'
})
} }
/** 人工叫料 */ /** 人工叫料 */
export const manualCall = data => { export const manualCall = data => {

View File

@ -5,6 +5,8 @@ const Api = {
palletDetailUnBind: '/api/wms/pda/palletDetailUnBind', palletDetailUnBind: '/api/wms/pda/palletDetailUnBind',
queryPalletInfo: '/api/wms/pda/queryPalletInfo', queryPalletInfo: '/api/wms/pda/queryPalletInfo',
unBindRack: '/api/wms/pda/unBindRack', unBindRack: '/api/wms/pda/unBindRack',
queryLinePalletInfo: '/api/wms/pda/queryLinePalletInfo',
queryAreaByLocCode: '/api/wms/pda/queryAreaByLocCode',
} }
/** 托盘明细查询 */ /** 托盘明细查询 */
@ -32,4 +34,22 @@ export const unBindRack = data => {
data: data, data: data,
method: 'POST' method: 'POST'
}) })
}
/** 线边托盘信息查询 */
export const queryLinePalletInfo = data => {
return request({
url: Api.queryLinePalletInfo,
params: data,
method: 'GET'
})
}
/** 根据入库站台物料类别查询可到的库区 */
export const queryAreaByLocCode = data => {
return request({
url: Api.queryAreaByLocCode,
params: data,
method: 'GET'
})
} }

View File

@ -6,6 +6,15 @@ const Api = {
lineCodeList: '/api/sys/dict/data/list', lineCodeList: '/api/sys/dict/data/list',
skuTypeList: '/api/wms/skuCategory/list', skuTypeList: '/api/wms/skuCategory/list',
inventoryList: '/api/wms/pda/inventoryList', inventoryList: '/api/wms/pda/inventoryList',
getSkuByCode: '/api/wms/pda/getSkuByCode',
}
//获取获取单个物料
export async function getSkuByCode(skuCode ){
return await request({
url: Api.getSkuByCode + '/' + skuCode,
method: 'GET'
})
} }
//获取库存列表 //获取库存列表

View File

@ -99,6 +99,13 @@
"navigationBarTitleText": "物料组盘(入库)" "navigationBarTitleText": "物料组盘(入库)"
} }
}, },
{
"path": "pages/work/wms/skuCreatePalletByCodeH5",
"navigationStyle": "custom",
"style": {
"navigationBarTitleText": "物料组盘一码通H5"
}
},
{ {
"path": "pages/work/wms/clearEmptyLoc", "path": "pages/work/wms/clearEmptyLoc",
"navigationStyle": "custom", "navigationStyle": "custom",
@ -196,6 +203,18 @@
"style": { "style": {
"navigationBarTitleText": "托盘信息查询" "navigationBarTitleText": "托盘信息查询"
} }
},
{
"path": "pages/work/wms/mesStockChange",
"style": {
"navigationBarTitleText": "Mes工位库库存变更"
}
},
{
"path": "pages/work/wms/emptyPalletIn",
"style": {
"navigationBarTitleText": "空容器入库"
}
} }
], ],
"tabBar": { "tabBar": {

View File

@ -0,0 +1,574 @@
<template>
<view class="container">
<cu-custom bgColor="bg-gradual-pink" :isBack="true">
<block slot="backText">返回</block>
<block slot="content">空容器入库</block>
</cu-custom>
<view class="example">
<uni-forms ref="form" :model="formData" labelWidth="80px">
<uni-forms-item label="容器类型" name="skuType">
<uni-data-select v-model="formData.skuType" :localdata="skuTypeList" @change="changeSkuType"
placeholder="请选择容器类型">
</uni-data-select>
</uni-forms-item>
<uni-forms-item label="托盘编号" name="palletCode">
<uni-easyinput v-model="formData.palletCode" placeholder="请扫描托盘号" @blur="trimPalletInput"/>
</uni-forms-item>
<uni-forms-item label="货位编号" name="locCode">
<uni-easyinput v-model="formData.locCode" placeholder="请扫描货位编号" @blur="trimLocInput"/>
</uni-forms-item>
<uni-forms-item label="库区" name="warehouseArea" v-if="showWarehouseArea">
<uni-data-select v-model="formData.warehouseArea" :localdata="warehouseAreaList" placeholder="请选择库区" />
</uni-forms-item>
</uni-forms>
<view class="button-group">
<button :disabled="isButtonDisabled" style="width: 100px;" @click="callAgv"></button>
</view>
</view>
<view class="cu-modal" :class="msgModalName=='Modal'?'show':''">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">{{msgTitleName}}</view>
<view class="action" @tap="hideMsgModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-xl">
{{msg}}
</view>
</view>
</view>
</view>
</template>
<script>
import {
getSkuDictionary,getSkuTypes,getLineCodes
} from "@/api/wms/sku.js"
import{queryAreaByLocCode} from "@/api/wms/palletDetailUnBind.js"
import {
createPalletBySku, callAgvIn,callEmptyRackIn
} from "@/api/wms/bill.js"
import {
getDictionary
} from "@/api/wms/dictData.js"
import {
formatDate
} from 'tough-cookie';
export default {
data() {
return {
skuInput: '',
showSkuDropdown: false,
filteredSkuList: [],
originalSkuList: [],
whCode: this.$store.state.user.warehouse[0]?.warehouseCode,
userCode:this.$store.state.user.name,
isButtonDisabled:false,
autoCall:true,
skuInfo:"",
callStatus:"已开启自动呼叫空容器",
showWarehouseArea: false,
warehouseAreaList: [],
//
formData: {
palletCode: "",
skuType: "",
locCode: "",
warehouseArea: ""
},
rules: {
skuType: {
rules: [{
required: true,
errorMessage: '请选择容器类型'
}]
},
palletCode: {
rules: [{
required: true,
errorMessage: '请扫码托盘号'
}]
},
locCode: {
rules: [{
required: true,
errorMessage: '请扫描货位号'
}]
},
warehouseArea: {
rules: [{
required: true,
errorMessage: '请选择库区'
}]
}
},
//
billInfo: {
totalPlanQty: 0,
totalSurplusQty: 0,
wmsInBillSkuInfos: []
},
//table
searchVal: '',
tableData: [],
//
pageSize: 10,
//
pageCurrent: 1,
//
total: 0,
loading: false,
//tabe
selectedIndexs: [],
//
tableClumns: [{
dataIndex: "itemCode",
key: "itemCode",
title: "明细单号"
},
{
dataIndex: "batch",
key: "batch",
title: "批次"
},
{
dataIndex: "skuCode",
key: "skuCode",
title: "物料编号"
},
{
dataIndex: "skuName",
key: "skuName",
title: "物料名称"
},
{
dataIndex: "planQty",
key: "planQty",
title: "计划数量"
},
{
dataIndex: "lockQty",
key: "lockQty",
title: "锁定数量"
},
{
dataIndex: "qty",
key: "qty",
title: "组盘数量"
},
],
warehouseList: [],
skuList: [],
skuTypeList: [],
lineCodeList:[],
skuArray: [],
skushow: false,
invoiceCode: null,
palletCode: null,
houseCode: null,
skuCode: null,
locCode: null,
skuQty: null,
totalPlanQty: null,
totalSurplusQty: null,
msgModalName: null,
msgTitleName: null,
msg: null
};
},
onLoad() {
//
this.getSkuTypes();
this.getLineCodes();
//
// this.getWarehouses()
//this.getInvoicesByBusinessType()
},
onReady() {
this.$refs.form.setRules(this.rules)
},
watch: {
'formData.skuType': {
immediate: false,
handler: async function(newVal) {
const typeObj = this.skuTypeList.find(item => item.value === newVal);
if (typeObj && typeObj.treeLevel === 1) {
this.showWarehouseArea = true;
} else {
this.showWarehouseArea = false;
this.formData.warehouseArea = "";
}
}
}
},
methods: {
maskClick(e){
console.log('maskClick事件:', e);
},
onSkuInput(value) {
this.skuInput = value;
this.filteredSkuList = this.originalSkuList
.filter(item => item.skuCode.includes(value))
.map(item => ({
value: item.skuCode,
text: `${item.skuCode} - ${item.skuName}`
}));
this.showSkuDropdown = true;
},
selectSku(item) {
this.formData.skuCode = item.value;
this.skuInput = item.value; //
this.showSkuDropdown = false;
this.skuInfo= item.text
},
handleSkuBlur() {
setTimeout(() => {
this.showSkuDropdown = false;
}, 200);
},
//
trimPalletInput(event) {
this.formData.palletCode = event.target.value.trim();
},
//
async trimLocInput(event) {
this.formData.locCode = event.target.value.trim();
if(!this.formData.locCode) {
//
this.$modal.msgError("请扫描货位编号")
return;
}
//
let res = await queryAreaByLocCode({
locCode: this.formData.locCode,
skuType: this.formData.skuType,
});
this.warehouseAreaList = res.data.map(item => ({
value: item.locCode,
text: item.locName
}));
console.log(this.warehouseAreaList)
},
/// []
async fetch(param) {
var response = await queryInBillSkuInfo(param);
return {
total: response.data.total,
data: response.data.record,
};
},
switchChange(e){
this.autoCall = e.detail.value;
if(this.autoCall){
this.callStatus="已开启自动呼叫空容器"
}else{
this.callStatus="已停止自动呼叫空容器"
}
},
//
async getSkuTypes() {
this.skuTypeList = await getSkuTypes();
},
//线
async getLineCodes() {
this.lineCodeList = await getLineCodes();
console.log("this.lineCodeList",this.lineCodeList)
},
changeSkuType(){
this.skuInput='';
this.skuInfo='';
},
//
// async getSkus() {
// console.log("this.skuType",this.skuType)
// if(this.skuType){
// this.skuList = await getSkuDictionary(this.skuType);
// }
// },
//
async getWarehouses() {
this.warehouseList = await getDictionary('warehouseList');
console.log("this.warehouseList",this.warehouseList)
},
//
selectedItems() {
return this.selectedIndexs.map(i => this.tableData[i])
},
//
selectionChange(e) {
console.log(e.detail.index)
this.selectedIndexs = e.detail.index
//
},
//
delTable() {
console.log(this.selectedItems())
},
//
change(e) {
this.$refs.table.clearSelection()
this.selectedIndexs.length = 0
this.getData(e.current)
},
//
search() {
this.getData(1, this.searchVal)
},
//
getData(pageCurrent, value = '') {
this.loading = true
this.pageCurrent = pageCurrent
this.request({
pageSize: this.pageSize,
pageCurrent: pageCurrent,
value: value,
success: res => {
// console.log('data', res);
this.tableData = res.data
this.total = res.total
this.loading = false
}
})
},
//
getSelectDetail() {
if (this.selectedIndexs.length == 0) {
//
this.$modal.msgError("请先选择需要组盘的单据明细")
return;
}
//
let arr = [];
let len = this.billInfo.wmsInBillSkuInfos.length;
for (let i = 0; i < len; i++) {
if (this.selectedIndexs.indexOf(i) >= 0) {
arr.push(this.billInfo.wmsInBillSkuInfos[i]);
} else {
// console.log(this.selectArr.indexOf(i))
//this.selectArr.indexOf(i);
}
}
console.log("选中的单据明细数据为", arr.length)
return arr;
},
// request
request(options) {
const {
pageSize,
pageCurrent,
success,
value
} = options
let total = tableData.length
let data = tableData.filter((item, index) => {
const idx = index - (pageCurrent - 1) * pageSize
return idx < pageSize && idx >= 0
})
if (value) {
data = []
tableData.forEach(item => {
if (item.name.indexOf(value) !== -1) {
data.push(item)
}
})
total = data.length
}
setTimeout(() => {
typeof success === 'function' &&
success({
data: data,
total: total
})
}, 500)
},
// submit(ref) {
// this.$refs.form.validate().then(res => {
// updateUserProfile(this.user).then(response => {
// this.$modal.msgSuccess("")
// })
// })
// }
//
submitPallet: function(ref) {
this.isButtonDisabled = true;
this.$modal.loading("请等待...")
this.$refs.form.validate().then(res => {
let requestData={
...this.formData,
userCode:this.userCode,
warehouseCode:this.whCode
}
createPalletBySku(requestData).then(response => {
console.log("response", response)
this.$modal.msgSuccess("组盘成功")
}).finally(() => {
this.isButtonDisabled = false; //
this.$modal.closeLoading()
});
}).catch(()=>{
this.isButtonDisabled = false; //
this.$modal.closeLoading()
})
},
//AGV
callAgv: function() {
this.isButtonDisabled = true;
this.$modal.loading("请等待...")
this.$refs.form.validate().then(res => {
let requestData={
...this.formData,
userCode:this.userCode,
warehouseCode:this.whCode
}
callEmptyRackIn(requestData).then(response => {
console.log("response", response)
this.$modal.msgSuccess("呼叫入库成功")
}).finally(() => {
this.isButtonDisabled = false; //
this.$modal.closeLoading()
});
}).catch(()=>{
this.isButtonDisabled = false; //
this.$modal.closeLoading()
})
},
hideMsgModal(e) {
//
this.msgModalName = null;
},
textareaAInput(e) {
this.textareaAValue = e.detail.value
},
textareaBInput(e) {
this.textareaBValue = e.detail.value
},
//
queryRkOrder: async function(e) {
console.log('进入查询方法', e);
console.log('this.formData', this.formData);
console.log('this.formData.invoiceCode', this.formData.invoiceCode);
var invoiceCode = this.formData.invoiceCode;
if (invoiceCode == null) {
this.$modal.msgError("单据号不能为空")
return;
}
if (invoiceCode.length < 1) {
this.$modal.msgError("单据号不能为空")
return;
}
//
var billInfo = await queryInBillSkuInfo({
'invoiceCode': invoiceCode
});
console.log("billInfo", billInfo)
if (billInfo) {
this.billInfo = billInfo.data;
};
}
}
}
</script>
<style lang="scss">
.sku-dropdown {
position: absolute;
z-index: 1000;
background: white;
border: 1px solid #ddd;
border-radius: 4px;
max-height: 200px;
overflow-y: auto;
width: 100%;
box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.dropdown-item {
padding: 8px 12px;
font-size: 14px;
color: #333;
border-bottom: 1px solid #eee;
}
.dropdown-item:last-child {
border-bottom: none;
}
.dropdown-item:hover {
background-color: #f5f5f5;
}
.cu-form-group .title {
min-width: calc(4em + 15px);
}
page {
background-color: #ffffff;
}
.example {
padding: 15px;
background-color: #fff;
}
.segmented-control {
margin-bottom: 15px;
}
.button-group {
margin-top: 15px;
display: flex;
justify-content: space-around;
}
.form-item {
display: flex;
align-items: center;
flex: 1;
}
.button {
display: flex;
align-items: center;
height: 35px;
line-height: 35px;
margin-left: 10px;
}
.switch-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px;
border-bottom: 1px solid #eee;
}
/* 输入框样式 */
.full-width-textarea {
width: calc(100vw - 260rpx); /* 直接扣除边距 */
padding: 20rpx;
box-sizing: border-box;
border: 2rpx solid #e5e5e5;
border-radius: 8rpx;
min-height: 200rpx;
font-size: 28rpx;
line-height: 1.5;
}
</style>

View File

@ -0,0 +1,563 @@
<template>
<view class="container">
<cu-custom bgColor="bg-gradual-pink" :isBack="true">
<block slot="backText">返回</block>
<block slot="content">Mes工位库库存变更</block>
</cu-custom>
<view class="example">
<uni-forms ref="form" :model="formData" labelWidth="80px">
<uni-forms-item label="托盘编号" name="palletCode">
<uni-easyinput v-model="formData.palletCode" placeholder="请扫描托盘号" @blur="trimPalletInput"/>
</uni-forms-item>
<uni-forms-item label="物料编号" name="skuCode">
<uni-easyinput v-model="this.skuCode" disabled/>
</uni-forms-item>
<uni-forms-item label="物料描述" name="skuName">
<textarea class="full-width-textarea" v-model="this.skuName" disabled/>
</uni-forms-item>
<uni-forms-item label="工位" name="locCode">
<uni-easyinput v-model="this.locCode" disabled/>
</uni-forms-item>
<uni-forms-item label="MES工位" name="mesStationCode">
<uni-easyinput v-model="this.mesStationCode" disabled/>
</uni-forms-item>
<uni-forms-item label="变更类型" required>
<uni-data-checkbox v-model="formData.orderType" :localdata="orderType" />
</uni-forms-item>
<uni-forms-item label="变更数量" name="amount">
<uni-easyinput v-model="formData.amount" type="number" placeholder="请输入变更数量"/>
</uni-forms-item>
</uni-forms>
<view class="button-group">
<button :disabled="isButtonDisabled" style="width: 100px;" @click="callAgv"></button>
</view>
</view>
<view class="cu-modal" :class="msgModalName=='Modal'?'show':''">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">{{msgTitleName}}</view>
<view class="action" @tap="hideMsgModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-xl">
{{msg}}
</view>
</view>
</view>
</view>
</template>
<script>
import { getStation, setStation } from '@/utils/station'
import{queryLinePalletInfo} from "@/api/wms/palletDetailUnBind.js"
import {
getSkuDictionary,getSkuTypes
} from "@/api/wms/sku.js"
import {
createPalletBySku, callAgvIn,surplusReturn
} from "@/api/wms/bill.js"
import {
getDictionary
} from "@/api/wms/dictData.js"
import {
formatDate
} from 'tough-cookie';
export default {
data() {
return {
whCode: this.$store.state.user.warehouse[0]?.warehouseCode,
userCode:this.$store.state.user.name,
isButtonDisabled:false,
autoCall:true,
callStatus:"已开启自动呼叫空容器",
//
formData: {
palletCode: "",
locCode: "",
amount: "",
orderType: 2
},
rules: {
skuCode: {
rules: [{
required: true,
errorMessage: '请选择物料'
}]
},
palletCode: {
rules: [{
required: true,
errorMessage: '请扫码托盘号'
}]
},
locCode: {
rules: [{
required: true,
errorMessage: '请扫码货位号'
}]
},
skuQty: {
rules: [{
required: true,
errorMessage: '请输入物料数量'
}]
}
},
//
orderType: [{
text: '扣减',
value: 2
}, {
text: '增加',
value: 1
}],
//
billInfo: {
totalPlanQty: 0,
totalSurplusQty: 0,
wmsInBillSkuInfos: []
},
//table
searchVal: '',
tableData: [],
//
pageSize: 10,
//
pageCurrent: 1,
//
total: 0,
loading: false,
//tabe
selectedIndexs: [],
//
tableClumns: [{
dataIndex: "itemCode",
key: "itemCode",
title: "明细单号"
},
{
dataIndex: "batch",
key: "batch",
title: "批次"
},
{
dataIndex: "skuCode",
key: "skuCode",
title: "物料编号"
},
{
dataIndex: "skuName",
key: "skuName",
title: "物料名称"
},
{
dataIndex: "planQty",
key: "planQty",
title: "计划数量"
},
{
dataIndex: "lockQty",
key: "lockQty",
title: "锁定数量"
},
{
dataIndex: "qty",
key: "qty",
title: "组盘数量"
},
],
warehouseList: [],
skuList: [],
skuType:'',
skuTypeList: [],
skuArray: [],
skushow: false,
invoiceCode: null,
palletCode: null,
houseCode: null,
skuCode: null,
skuName: null,
locCode: null,
mesStationCode: null,
skuQty: null,
stations: [],
totalPlanQty: null,
totalSurplusQty: null,
msgModalName: null,
msgTitleName: null,
msg: null
};
},
onLoad() {
//
this.getSkuTypes()
//
// this.getWarehouses()
//this.getInvoicesByBusinessType()
const saved = getStation();
this.stations = saved ? JSON.parse(saved) : [];
console.log(this.stations);
if(this.stations.length === 0) {
this.$modal.msgError("请先在空工装回库页面配置工位!")
}
var stas = [];
for (var i = 0; i < this.stations.length; i++) {
stas[i] = {value:this.stations[i],text:this.stations[i]}
}
this.stations = stas;
},
onReady() {
this.$refs.form.setRules(this.rules)
},
watch: {
async skuType(newVal) {
var param={categoryCode:this.skuType}
this.skuList = await getSkuDictionary(param);
}
},
methods: {
//
trimPalletInput(event) {
this.formData.palletCode = event.target.value.trim();
this.queryPalletInfo();
},
queryPalletInfo: async function(e) {
console.log('进入托盘查询方法');
var palletCode = this.formData.palletCode;
if (palletCode == null) {
this.$modal.msgError("托盘编号不能为空")
return;
}
if (palletCode.length < 1) {
this.$modal.msgError("托盘编号不能为空")
return;
}
//
var palletInfo = await queryLinePalletInfo({
'palletCode': palletCode
});
console.log("palletInfo", palletInfo)
if (palletInfo) {
var palletDetails = palletInfo.data;
this.skuCode = palletDetails.skuCode;
this.skuName = palletDetails.skuName;
this.locCode = palletDetails.locCode;
this.mesStationCode = palletDetails.mesStationCode;
};
},
//
trimLocInput(event) {
this.formData.locCode = event.target.value.trim();
},
/// []
async fetch(param) {
var response = await queryInBillSkuInfo(param);
return {
total: response.data.total,
data: response.data.record,
};
},
switchChange(e){
this.autoCall = e.detail.value;
if(this.autoCall){
this.callStatus="已开启自动呼叫空容器"
}else{
this.callStatus="已停止自动呼叫空容器"
}
},
//
async getSkuTypes() {
this.skuTypeList = await getSkuTypes();
console.log("this.skutypeList",this.skuTypeList)
},
//
// async getSkus() {
// console.log("this.skuType",this.skuType)
// if(this.skuType){
// this.skuList = await getSkuDictionary(this.skuType);
// }
// },
//
async getWarehouses() {
this.warehouseList = await getDictionary('warehouseList');
console.log("this.warehouseList",this.warehouseList)
},
//
selectedItems() {
return this.selectedIndexs.map(i => this.tableData[i])
},
//
selectionChange(e) {
console.log(e.detail.index)
this.selectedIndexs = e.detail.index
//
},
//
delTable() {
console.log(this.selectedItems())
},
//
change(e) {
this.$refs.table.clearSelection()
this.selectedIndexs.length = 0
this.getData(e.current)
},
//
search() {
this.getData(1, this.searchVal)
},
//
getData(pageCurrent, value = '') {
this.loading = true
this.pageCurrent = pageCurrent
this.request({
pageSize: this.pageSize,
pageCurrent: pageCurrent,
value: value,
success: res => {
// console.log('data', res);
this.tableData = res.data
this.total = res.total
this.loading = false
}
})
},
//
getSelectDetail() {
if (this.selectedIndexs.length == 0) {
//
this.$modal.msgError("请先选择需要组盘的单据明细")
return;
}
//
let arr = [];
let len = this.billInfo.wmsInBillSkuInfos.length;
for (let i = 0; i < len; i++) {
if (this.selectedIndexs.indexOf(i) >= 0) {
arr.push(this.billInfo.wmsInBillSkuInfos[i]);
} else {
// console.log(this.selectArr.indexOf(i))
//this.selectArr.indexOf(i);
}
}
console.log("选中的单据明细数据为", arr.length)
return arr;
},
// request
request(options) {
const {
pageSize,
pageCurrent,
success,
value
} = options
let total = tableData.length
let data = tableData.filter((item, index) => {
const idx = index - (pageCurrent - 1) * pageSize
return idx < pageSize && idx >= 0
})
if (value) {
data = []
tableData.forEach(item => {
if (item.name.indexOf(value) !== -1) {
data.push(item)
}
})
total = data.length
}
setTimeout(() => {
typeof success === 'function' &&
success({
data: data,
total: total
})
}, 500)
},
// submit(ref) {
// this.$refs.form.validate().then(res => {
// updateUserProfile(this.user).then(response => {
// this.$modal.msgSuccess("")
// })
// })
// }
//
submitPallet: function(ref) {
this.isButtonDisabled = true;
this.$modal.loading("请等待...")
this.$refs.form.validate().then(res => {
let requestData={
...this.formData,
userCode:this.userCode,
warehouseCode:this.whCode
}
createPalletBySku(this.formData).then(response => {
console.log("response", response)
this.$modal.msgSuccess("组盘成功")
}).finally(() => {
this.isButtonDisabled = false; //
this.$modal.closeLoading()
});
}).catch(()=>{
this.isButtonDisabled = false; //
this.$modal.closeLoading()
})
},
generateUUID: function() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
const r = (Math.random() * 16) | 0;
const v = c === 'x' ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
},
//Mes
callAgv: function() {
this.isButtonDisabled = true;
this.$modal.loading("请等待...")
if(!this.formData.locCode){
this.$modal.closeLoading()
}
if(!this.formData.palletCode){
this.$modal.closeLoading()
}
var data={
list:[{
amount:this.formData.amount,
materialCode:this.skuCode,
orderId:this.generateUUID(),
orderType:this.formData.orderType,
stationGroupCode:this.mesStationCode
}],
siteCode:"1021"
}
uni.request({
url: 'https://gw-qd-aliyun.haier.net/hdshmls/raw-wms-remoting-service/api/seqPull/updateSeq',
method: 'POST',
data: data,
header: {
'Authorization': 'tx7rruWpIRhU2v7Ofuls3nKsrAyHWN5o'
},
success: (res) => {
console.log(res.data);
if(res.data.code == '1') {
this.$modal.msgSuccess("MES工位库库存变更成功")
} else {
this.$modal.msgError(res.data.msg)
}
},
});
this.isButtonDisabled = false; //
this.$modal.closeLoading()
},
hideMsgModal(e) {
//
this.msgModalName = null;
},
textareaAInput(e) {
this.textareaAValue = e.detail.value
},
textareaBInput(e) {
this.textareaBValue = e.detail.value
},
//
queryRkOrder: async function(e) {
console.log('进入查询方法', e);
console.log('this.formData', this.formData);
console.log('this.formData.invoiceCode', this.formData.invoiceCode);
var invoiceCode = this.formData.invoiceCode;
if (invoiceCode == null) {
this.$modal.msgError("单据号不能为空")
return;
}
if (invoiceCode.length < 1) {
this.$modal.msgError("单据号不能为空")
return;
}
//
var billInfo = await queryInBillSkuInfo({
'invoiceCode': invoiceCode
});
console.log("billInfo", billInfo)
if (billInfo) {
this.billInfo = billInfo.data;
};
}
}
}
</script>
<style lang="scss">
.cu-form-group .title {
min-width: calc(4em + 15px);
}
page {
background-color: #ffffff;
}
.example {
padding: 15px;
background-color: #fff;
}
.segmented-control {
margin-bottom: 15px;
}
.button-group {
margin-top: 15px;
display: flex;
justify-content: space-around;
}
.form-item {
display: flex;
align-items: center;
flex: 1;
}
.button {
display: flex;
align-items: center;
height: 35px;
line-height: 35px;
margin-left: 10px;
}
.switch-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px;
border-bottom: 1px solid #eee;
}
/* 输入框样式 */
.full-width-textarea {
width: calc(100vw - 260rpx); /* 直接扣除边距 */
padding: 20rpx;
box-sizing: border-box;
border: 2rpx solid #e5e5e5;
border-radius: 8rpx;
min-height: 200rpx;
font-size: 28rpx;
line-height: 1.5;
}
</style>

View File

@ -60,7 +60,15 @@
<image style="width: 28rpx;" src="/static/images/right.png" mode="widthFix"></image> <image style="width: 28rpx;" src="/static/images/right.png" mode="widthFix"></image>
</view> </view>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="批次" name="batch">
<!-- <uni-section :title="'日期用法:' + formData.batch" type="line"></uni-section> -->
<!-- <view class="example-body"> -->
<uni-datetime-picker type="date" :clear-icon="false" v-model="formData.batch" @maskClick="maskClick" />
<!-- </view> -->
</uni-forms-item>
<uni-forms-item label="库区" name="warehouseArea" v-if="showWarehouseArea">
<uni-data-select v-model="formData.warehouseArea" :localdata="warehouseAreaList" placeholder="请选择库区" />
</uni-forms-item>
</uni-forms> </uni-forms>
<view class="switch-item"> <view class="switch-item">
<view class="uni-list-cell-db">{{callStatus}}</view> <view class="uni-list-cell-db">{{callStatus}}</view>
@ -98,6 +106,7 @@
getSkuTypes, getSkuTypes,
getLineCodes getLineCodes
} from "@/api/wms/sku.js" } from "@/api/wms/sku.js"
import{queryAreaByLocCode} from "@/api/wms/palletDetailUnBind.js"
import { import {
createPalletBySku, createPalletBySku,
callAgvIn callAgvIn
@ -122,13 +131,17 @@
autoCall: true, autoCall: true,
skuInfo: "", skuInfo: "",
callStatus: "已开启自动呼叫空容器", callStatus: "已开启自动呼叫空容器",
showWarehouseArea: false,
warehouseAreaList: [],
// //
formData: { formData: {
lineCode: '', lineCode: '',
palletCode: "", palletCode: "",
skuCode: "", skuCode: "",
locCode: "", locCode: "",
skuQty: "" skuQty: "",
batch: "",
warehouseArea: ""
}, },
rules: { rules: {
lineCode: { lineCode: {
@ -160,6 +173,12 @@
required: true, required: true,
errorMessage: '请输入物料数量' errorMessage: '请输入物料数量'
}] }]
},
warehouseArea: {
rules: [{
required: true,
errorMessage: '请选择库区'
}]
} }
}, },
@ -249,6 +268,13 @@
// this.getWarehouses() // this.getWarehouses()
//this.getInvoicesByBusinessType() //this.getInvoicesByBusinessType()
// batch
const today = new Date();
const yyyy = today.getFullYear();
const mm = String(today.getMonth() + 1).padStart(2, '0');
const dd = String(today.getDate()).padStart(2, '0');
this.formData.batch = `${yyyy}-${mm}-${dd}`;
}, },
onReady() { onReady() {
this.$refs.form.setRules(this.rules) this.$refs.form.setRules(this.rules)
@ -269,9 +295,23 @@
value: item.skuCode, value: item.skuCode,
text: `${item.skuCode} - ${item.skuName}` text: `${item.skuCode} - ${item.skuName}`
})); }));
// skuTypeList treeLevel
const typeObj = this.skuTypeList.find(item => item.value === newVal);
if (typeObj && typeObj.treeLevel === 1) {
this.showWarehouseArea = true;
} else {
this.showWarehouseArea = false;
this.formData.warehouseArea = "";
}
} }
}, },
methods: { methods: {
maskClick(e){
console.log('maskClick事件:', e);
},
onSkuInput(value) { onSkuInput(value) {
this.skuInput = value; this.skuInput = value;
@ -300,8 +340,26 @@
}, },
// //
trimLocInput(event) { async trimLocInput(event) {
this.formData.locCode = event.target.value.trim(); this.formData.locCode = event.target.value.trim();
if(!this.formData.locCode) {
//
this.$modal.msgError("请扫描货位编号")
return;
}
//
let res = await queryAreaByLocCode({
locCode: this.formData.locCode,
skuType: this.skuType,
});
this.warehouseAreaList = res.data.map(item => ({
value: item.locCode,
text: item.locName
}));
console.log(this.warehouseAreaList)
}, },
/// [] /// []
async fetch(param) { async fetch(param) {
@ -481,6 +539,7 @@
var data = { var data = {
locCode: this.formData.locCode, locCode: this.formData.locCode,
palletCode: this.formData.palletCode, palletCode: this.formData.palletCode,
warehouseArea:this.formData.warehouseArea,
autoCall: this.autoCall, autoCall: this.autoCall,
userCode: this.userCode, userCode: this.userCode,
warehouseCode: this.whCode warehouseCode: this.whCode

View File

@ -0,0 +1,628 @@
<template>
<view class="container">
<cu-custom bgColor="bg-gradual-pink" :isBack="true">
<block slot="backText">返回</block>
<block slot="content">一码通组盘 AGV入库</block>
</cu-custom>
<view class="example">
<uni-forms ref="form" :model="formData" labelWidth="80px">
<uni-forms-item label="一码通" >
<uni-easyinput v-model="barCode" placeholder="请扫描一码通" maxlength="-1"
@blur="trimbarCode" @confirm="handleEnter"/>
</uni-forms-item>
<!-- <uni-forms-item label="" name="">
<textarea class="full-width-textarea" v-model="codeInfo" disabled >
</textarea>
</uni-forms-item>
-->
<uni-forms-item label="生产线" name="lineCode">
<uni-data-select v-model="formData.lineCode" :localdata="lineCodeList"
placeholder="请选择收货线体">
</uni-data-select>
</uni-forms-item>
<!-- <uni-forms-item label="物料">
<uni-easyinput v-model="formData.palletCode" disabled />
</uni-forms-item> -->
<uni-forms-item label="物料编号" name="skuCode">
<uni-easyinput v-model="formData.skuCode" disabled/>
</uni-forms-item>
<uni-forms-item label="" name="">
<textarea class="full-width-textarea" v-model="skuInfo" disabled >
</textarea >
</uni-forms-item>
<uni-forms-item label="物料数量" name="skuQty">
<uni-easyinput v-model="formData.skuQty" type="number" disabled />
</uni-forms-item>
<uni-forms-item label="托盘编号" name="palletCode">
<uni-easyinput v-model="formData.palletCode" placeholder="请扫描托盘编号" />
</uni-forms-item>
<uni-forms-item label="货位编号" name="locCode">
<uni-easyinput v-model="formData.locCode" placeholder="请扫描货位编号" @blur="trimLocInput" />
</uni-forms-item>
<uni-forms-item label="批次" name="batch">
<!-- <uni-section :title="'日期用法:' + formData.batch" type="line"></uni-section> -->
<!-- <view class="example-body"> -->
<uni-datetime-picker type="date" :clear-icon="false" v-model="formData.batch" />
<!-- </view> -->
</uni-forms-item>
</uni-forms>
<view class="switch-item">
<view class="uni-list-cell-db">{{callStatus}}</view>
<switch :checked="autoCall" color="#0055ff" @change="switchChange" />
</view>
<view class="button-group">
<!-- <button type="warn" @click="toStart"></button> -->
<button type="primary" style="width: 100px;" :disabled="isButtonDisabled"
@click="submitPallet">组盘</button>
<button :disabled="isButtonDisabled" style="width: 100px;" @click="callAgv"></button>
</view>
</view>
<view class="cu-modal" :class="msgModalName=='Modal'?'show':''" >
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">{{msgTitleName}}</view>
<view class="action" @tap="hideMsgModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-xl">
{{msg}}
</view>
</view>
</view>
</view>
</template>
<script>
import {
getSkuDictionary,
getSkuTypes,
getSkuByCode,
getLineCodes
} from "@/api/wms/sku.js"
import {
createPalletBySku,
callAgvIn
} from "@/api/wms/bill.js"
import {
getDictionary
} from "@/api/wms/dictData.js"
import {
formatDate
} from 'tough-cookie';
import {
debounce
} from 'lodash';
export default {
data() {
return {
fil: [0, 2, 1],
barCode: '',
isButtonDisabled: false,
autoCall: true,
callStatus: "已开启自动呼叫空容器",
whCode: this.$store.state.user.warehouse[0]?.warehouseCode,
userCode:this.$store.state.user.name,
//
formData: {
lineCode:'',
palletCode: "",
skuCode: "",
locCode: "",
skuQty: "",
batch: ""
},
rules: {
lineCode: {
rules: [{
required: true,
errorMessage: '请选择线体'
}]
},
skuCode: {
rules: [{
required: true,
errorMessage: '请选择扫描一码通获取物料编号'
}]
},
palletCode: {
rules: [{
required: true,
errorMessage: '请扫描托盘号'
}]
},
locCode: {
rules: [{
required: true,
errorMessage: '请扫描货位号'
}]
},
skuQty: {
rules: [{
required: true,
errorMessage: '请扫描一码通获取物料数量'
}]
}
},
//
billInfo: {
totalPlanQty: 0,
totalSurplusQty: 0,
wmsInBillSkuInfos: []
},
//table
searchVal: '',
tableData: [],
//
pageSize: 10,
//
pageCurrent: 1,
//
total: 0,
loading: false,
//tabe
selectedIndexs: [],
//
tableClumns: [{
dataIndex: "itemCode",
key: "itemCode",
title: "明细单号"
},
{
dataIndex: "batch",
key: "batch",
title: "批次"
},
{
dataIndex: "skuCode",
key: "skuCode",
title: "物料编号"
},
{
dataIndex: "skuName",
key: "skuName",
title: "物料名称"
},
{
dataIndex: "planQty",
key: "planQty",
title: "计划数量"
},
{
dataIndex: "lockQty",
key: "lockQty",
title: "锁定数量"
},
{
dataIndex: "qty",
key: "qty",
title: "组盘数量"
},
],
lineCodeList: [],
warehouseList: [],
skuList: [],
skuType: '',
skuTypeList: [],
skuArray: [],
skushow: false,
invoiceCode: null,
palletCode: null,
houseCode: null,
skuCode: null,
locCode: null,
skuQty: null,
codeInfo: "",
sku: null,
skuInfo: "",
totalPlanQty: null,
totalSurplusQty: null,
msgModalName: null,
msgTitleName: null,
msg: null
};
},
onLoad() {
//
this.getSkuTypes();
this.getLineCodes();
//
// this.getWarehouses()
//this.getInvoicesByBusinessType()
// batch
const today = new Date();
const yyyy = today.getFullYear();
const mm = String(today.getMonth() + 1).padStart(2, '0');
const dd = String(today.getDate()).padStart(2, '0');
this.formData.batch = `${yyyy}-${mm}-${dd}`;
},
onReady() {
this.$refs.form.setRules(this.rules)
},
watch: {
async skuType(newVal) {
var param = {
categoryCode: this.skuType
}
this.skuList = await getSkuDictionary(param);
}
},
methods: {
handleEnter:_.debounce(async function() {
console.log('回车键被按下,当前输入值:', this.barCode);
this.codeInfo = this.barCode;
//JSON
/* JSON
* {"materielCode":"0030824237","prods":[{"prodNo":"010004063420","state":"N"}]
* ,"ShouldNum":9,"SupplierNo":"V14431","binTagId":"17388018044694306385","billNo":"J250206A12429"}
*/
let jsonData;
try {
jsonData = JSON.parse(this.codeInfo);
} catch (e) {
this.$modal.msgError("未扫描到一码通数据,请重新扫描");
return;
}
//
let skuRes = await getSkuByCode(jsonData.materielCode);
console.log("this.sku", this.sku);
this.sku = skuRes.data;
this.formData.skuCode = jsonData.materielCode;
this.formData.skuQty = jsonData.ShouldNum;
this.skuInfo = this.sku.skuCode + " " + this.sku.skuName;
}, 500),
toStart: function() {
//
uni.scanCode({
onlyFromCamera: false,
success: async (res) => {
this.codeInfo = res.result;
//JSON
/* JSON
* {"materielCode":"0030824237","prods":[{"prodNo":"010004063420","state":"N"}]
* ,"ShouldNum":9,"SupplierNo":"V14431","binTagId":"17388018044694306385","billNo":"J250206A12429"}
*/
let jsonData;
try {
jsonData = JSON.parse(this.codeInfo);
} catch (e) {
this.$modal.msgError("未扫描到一码通数据,请重新扫描");
return;
}
//
let skuRes = await getSkuByCode(jsonData.materielCode);
console.log("this.sku", this.sku);
this.sku = skuRes.data;
this.formData.skuCode = jsonData.materielCode;
this.formData.skuQty = jsonData.ShouldNum;
this.skuInfo = this.sku.skuCode + " " + this.sku.skuName;
}
});
},
//线
async getLineCodes() {
this.lineCodeList = await getLineCodes();
console.log("this.lineCodeList",this.lineCodeList)
},
//
trimLocInput(event) {
this.formData.locCode = event.target.value.trim();
},
//
trimbarCode(event) {
this.barCode = event.target.value.trim();
},
/// []
async fetch(param) {
var response = await queryInBillSkuInfo(param);
return {
total: response.data.total,
data: response.data.record,
};
},
switchChange(e) {
this.autoCall = e.detail.value;
if (this.autoCall) {
this.callStatus = "已开启自动呼叫空容器"
} else {
this.callStatus = "已停止自动呼叫空容器"
}
},
//
async getSkuTypes() {
this.skuTypeList = await getSkuTypes();
console.log("this.skutypeList", this.skuTypeList)
},
//
// async getSkus() {
// console.log("this.skuType",this.skuType)
// if(this.skuType){
// this.skuList = await getSkuDictionary(this.skuType);
// }
// },
//
async getWarehouses() {
this.warehouseList = await getDictionary('warehouseList');
console.log("this.warehouseList", this.warehouseList)
},
//
selectedItems() {
return this.selectedIndexs.map(i => this.tableData[i])
},
//
selectionChange(e) {
console.log(e.detail.index)
this.selectedIndexs = e.detail.index
//
},
//
delTable() {
console.log(this.selectedItems())
},
//
change(e) {
this.$refs.table.clearSelection()
this.selectedIndexs.length = 0
this.getData(e.current)
},
//
search() {
this.getData(1, this.searchVal)
},
//
getData(pageCurrent, value = '') {
this.loading = true
this.pageCurrent = pageCurrent
this.request({
pageSize: this.pageSize,
pageCurrent: pageCurrent,
value: value,
success: res => {
// console.log('data', res);
this.tableData = res.data
this.total = res.total
this.loading = false
}
})
},
//
getSelectDetail() {
if (this.selectedIndexs.length == 0) {
//
this.$modal.msgError("请先选择需要组盘的单据明细")
return;
}
//
let arr = [];
let len = this.billInfo.wmsInBillSkuInfos.length;
for (let i = 0; i < len; i++) {
if (this.selectedIndexs.indexOf(i) >= 0) {
arr.push(this.billInfo.wmsInBillSkuInfos[i]);
} else {
// console.log(this.selectArr.indexOf(i))
//this.selectArr.indexOf(i);
}
}
console.log("选中的单据明细数据为", arr.length)
return arr;
},
// request
request(options) {
const {
pageSize,
pageCurrent,
success,
value
} = options
let total = tableData.length
let data = tableData.filter((item, index) => {
const idx = index - (pageCurrent - 1) * pageSize
return idx < pageSize && idx >= 0
})
if (value) {
data = []
tableData.forEach(item => {
if (item.name.indexOf(value) !== -1) {
data.push(item)
}
})
total = data.length
}
setTimeout(() => {
typeof success === 'function' &&
success({
data: data,
total: total
})
}, 500)
},
// submit(ref) {
// this.$refs.form.validate().then(res => {
// updateUserProfile(this.user).then(response => {
// this.$modal.msgSuccess("")
// })
// })
// }
//
submitPallet: function(ref) {
this.isButtonDisabled = true;
this.$modal.loading("请等待...")
this.$refs.form.validate().then(res => {
console.log("数据校验通过", res)
let requestData={
...this.formData,
userCode:this.userCode,
warehouseCode:this.whCode
}
createPalletBySku(requestData).then(response => {
console.log("response", response)
this.$modal.msgSuccess("组盘成功")
}).finally(() => {
this.isButtonDisabled = false; //
this.$modal.closeLoading()
});
}).catch(() => {
this.isButtonDisabled = false; //
this.$modal.closeLoading()
})
},
//AGV
callAgv: function() {
this.isButtonDisabled = true;
this.$modal.loading("请等待...")
if (!this.formData.locCode) {
this.$modal.closeLoading()
}
if (!this.formData.palletCode) {
this.$modal.closeLoading()
}
var data = {
locCode: this.formData.locCode,
palletCode: this.formData.palletCode,
autoCall: this.autoCall
}
callAgvIn(data).then(response => {
console.log("response", response)
this.$modal.msgSuccess("呼叫入库成功")
}).finally(() => {
this.isButtonDisabled = false; //
this.$modal.closeLoading()
});
},
hideMsgModal(e) {
//
this.msgModalName = null;
},
textareaAInput(e) {
this.textareaAValue = e.detail.value
},
textareaBInput(e) {
this.textareaBValue = e.detail.value
},
//
queryRkOrder: async function(e) {
console.log('进入查询方法', e);
console.log('this.formData', this.formData);
console.log('this.formData.invoiceCode', this.formData.invoiceCode);
var invoiceCode = this.formData.invoiceCode;
if (invoiceCode == null) {
this.$modal.msgError("单据号不能为空")
return;
}
if (invoiceCode.length < 1) {
this.$modal.msgError("单据号不能为空")
return;
}
//
var billInfo = await queryInBillSkuInfo({
'invoiceCode': invoiceCode
});
console.log("billInfo", billInfo)
if (billInfo) {
this.billInfo = billInfo.data;
};
}
}
}
</script>
<style lang="scss">
.cu-form-group .title {
min-width: calc(4em + 15px);
}
page {
background-color: #ffffff;
}
.example {
padding: 15px;
background-color: #fff;
}
.segmented-control {
margin-bottom: 15px;
}
.button-group {
margin-top: 15px;
display: flex;
justify-content: space-around;
}
.form-item {
display: flex;
align-items: center;
flex: 1;
}
.button {
display: flex;
align-items: center;
height: 35px;
line-height: 35px;
margin-left: 10px;
}
.switch-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px;
border-bottom: 1px solid #eee;
}
.barcode {
width: 750rpx;
height: 700rpx;
background-color: #808080;
}
.btn {
top: 20rpx;
width: 730rpx;
margin-left: 10rpx;
margin-top: 10rpx;
background-color: #458B00;
border-radius: 10rpx;
}
/* 输入框样式 */
.full-width-textarea {
width: calc(100vw - 260rpx); /* 直接扣除边距 */
padding: 20rpx;
box-sizing: border-box;
border: 2rpx solid #e5e5e5;
border-radius: 8rpx;
min-height: 200rpx;
font-size: 28rpx;
line-height: 1.5;
}
</style>

View File

@ -10,9 +10,9 @@
"icon": "/static/images/work/组合 1747.png" "icon": "/static/images/work/组合 1747.png"
}, },
{ {
"path": "/pages/work/wms/skuCreatePalletByCode", "path": "/pages/work/wms/skuCreatePalletByCodeH5",
"name": "skuCreatePalletByCode", "name": "skuCreatePalletByCodeH5",
"title": "一码通入库", "title": "一码通入库H5",
"color": "red", "color": "red",
"icon": "/static/images/work/组合 1749.png" "icon": "/static/images/work/组合 1749.png"
}, },
@ -61,7 +61,28 @@
"name": "surplusOut", "name": "surplusOut",
"title": "余料出库", "title": "余料出库",
"color": "red", "color": "red",
"icon": "/static/images/work/组合 1762.png" "icon": "cuIcon-forward"
},
{
"path": "/pages/work/wms/skuCreatePalletByCode",
"name": "skuCreatePalletByCode",
"title": "一码通入库APP",
"color": "red",
"icon": "cuIcon-qr_code"
},
{
"path": "/pages/work/wms/mesStockChange",
"name": "mesStockChange",
"title": "Mes工位库库存变更",
"color": "red",
"icon": "cuIcon-exit"
},
{
"path": "/pages/work/wms/emptyPalletIn",
"name": "emptyPalletIn",
"title": "空容器入库",
"color": "red",
"icon": "cuIcon-forwardfill"
} }
], ],
"msg": "成功" "msg": "成功"