代码更新

This commit is contained in:
梁州 2024-08-01 16:39:00 +08:00
parent a06930fd60
commit c314f49f56
13 changed files with 982 additions and 247 deletions

View File

@ -7,7 +7,7 @@ const request = axios.create({
// axios.defaults.baseURL = 'http://192.168.3.254:12315/wms'
// axios.defaults.baseURL = 'http://localhost:12315/wms'
// axios.defaults.baseURL = 'http://10.30.9.89:12315/wms'
// axios.defaults.baseURL = 'http://192.168.8.93:12315/wms'
// // request 请求器
// // 可以自请求发送前对请求做一些处理

View File

@ -343,7 +343,7 @@ export default {
.station-div {
display: inline-flex;
justify-content: center;
width: 125px;
width: 150px;
margin-left: 5px;
margin-right: 5px;
padding: 5px;
@ -359,7 +359,7 @@ export default {
.station-no-div {
display: inline-flex;
justify-content: center;
width: 75px;
width: 200px;
padding: 5px;
border: 5px double #000000;
}

View File

@ -31,7 +31,7 @@
<span class="display-title-text">料号</span>
</div>
<div class="display-form-div">
<el-input v-model="workFormEntity.goodsId" size="default"
<el-input v-model="workFormEntity.goodsId" size="default" ref="goodsId"
v-on:keyup.enter="getCurrentWorkInfo()" clearable></el-input>
</div>
</div>
@ -45,26 +45,38 @@
controls-position="right" :min="0" width="200px" disabled />
</div>
<div class="display-form-div-right">
<span class="display-form-text-right">{{ workFormEntity.goodsUnit
}}</span>
<span class="display-form-text-right">PC</span>
</div>
</div>
</div>
<!-- <div style="display: flex; flex-direction: column;">
<div style="display: flex; flex-direction: column;">
<div class="display-title-div">
<span class="display-title-text">实际数量差异</span>
<span class="display-title-text">理论剩余数量</span>
</div>
<div style="display: flex; margin-top: 20px;">
<div class="display-form-div-left">
<el-input-number v-model.number="workFormEntity.actualDifference"
<el-input-number v-model.number="workFormEntity.remainNumOrigin"
controls-position="right" :min="0" disabled />
</div>
<div class="display-form-div-right">
<span class="display-form-text-right">PC</span>
</div>
</div>
</div>
<div style="display: flex; flex-direction: column;">
<div class="display-title-div">
<span class="display-title-text">实际剩余数量</span>
</div>
<div style="display: flex; margin-top: 20px;">
<div class="display-form-div-left">
<el-input-number v-model.number="workFormEntity.remainNumReal"
controls-position="right" :min="0" />
</div>
<div class="display-form-div-right">
<span class="display-form-text-right">{{ workFormEntity.goodsUnit
}}</span>
<span class="display-form-text-right">PC</span>
</div>
</div>
</div>
</div> -->
</div>
<div style="display: flex; margin-top: 15px">
<div
@ -103,7 +115,7 @@
<div
style="display: inline-flex; justify-content: center; width: 80px; margin: 5px; padding: 5px; background-color: #CCCCCC;">
<span style="align-self: center; font-weight: bold;font-size: 20px;">
{{ workFormEntity.goodsUnit }}
PC
</span>
</div>
</div>
@ -141,9 +153,9 @@ export default {
workFormRef: ref(),
workFormEntity: reactive({
goodsId: '',
goodsUnit: '',
planPickNum: 0,
actualDifference: 0,
remainNumOrigin: null,
remainNumReal: null,
remark: '',
finishedRows: 0,
totalRows: 0,
@ -159,6 +171,7 @@ export default {
}
},
mounted() {
this.$refs.goodsId.focus()
// this.timer = setInterval(() => {
// // this.getAllTasks()
// }, 2000)
@ -168,51 +181,51 @@ export default {
},
methods: {
getCurrentWorkInfo() {
this.workFormEntity = {
goodsId: 'text0001',
goodsUnit: 'PC',
planPickNum: 10,
actualDifference: 0,
remark: '装盒子',
finishedRows: 800,
totalRows: 2500,
finishedCounts: 2500,
totalCounts: 6000,
tip: ''
// this.workFormEntity = {
// goodsId: '5678932/CS',
// planPickNum: 10,
// remainNumOrigin: 5,
// remainNumReal: 5,
// remark: '',
// finishedRows: 800,
// totalRows: 2500,
// finishedCounts: 2500,
// totalCounts: 6000,
// tip: ''
// }
const request = {
standId: this.standId,
goodsId: this.workFormEntity.goodsId
}
// const request = {
// standId: this.standId,
// goodsId: this.workFormEntity.goodsId
// }
// getWorkByStandAndGoods(request).then(res => {
// const response = res.data
// if (response.code == 0) {
// this.workFormEntity.goodsId = response.returnData.goodsId
// this.workFormEntity.goodsUnit = response.returnData.goodsUnit
// this.workFormEntity.planPickNum = response.returnData.planPickNum
// this.workFormEntity.actualDifference = response.returnData.actualDifference
// this.workFormEntity.remark = response.returnData.remark
// this.workFormEntity.finishedRows = response.returnData.finishedRows
// this.workFormEntity.totalRows = response.returnData.totalRows
// this.workFormEntity.finishedCounts = response.returnData.finishedCounts
// this.workFormEntity.totalCounts = response.returnData.totalCounts
// this.workFormEntity.tip = response.returnData.tip
// } else {
// this.resetForms()
// ElMessage.error(response.message)
// }
// }).catch(err => {
// console.log(err)
// this.resetForms()
// ElMessage.error('')
// })
getWorkByStandAndGoods(request).then(res => {
const response = res.data
if (response.code == 0) {
this.workFormEntity.goodsId = response.returnData.goodsId
this.workFormEntity.planPickNum = response.returnData.planPickNum
this.workFormEntity.remainNumOrigin = response.returnData.remainNumOrigin
this.workFormEntity.remainNumReal = response.returnData.remainNumReal
this.workFormEntity.remark = response.returnData.remark
this.workFormEntity.finishedRows = response.returnData.finishedRows
this.workFormEntity.totalRows = response.returnData.totalRows
this.workFormEntity.finishedCounts = response.returnData.finishedCounts
this.workFormEntity.totalCounts = response.returnData.totalCounts
this.workFormEntity.tip = response.returnData.tip
} else {
this.resetForms()
ElMessage.error(response.message)
}
}).catch(err => {
console.log(err)
this.resetForms()
ElMessage.error('查询工作信息错误')
})
},
resetForms() {
this.workFormEntity = reactive({
goodsId: '',
goodsUnit: '',
planPickNum: 0,
actualDifference: 0,
remainNumOrigin: null,
remainNumReal: null,
remark: '',
finishedRows: 0,
totalRows: 0,
@ -232,7 +245,8 @@ export default {
const confirmParams = {
standId: this.standId,
goodsId: this.workFormEntity.goodsId,
actualDifference: this.workFormEntity.actualDifference
remainNumOrigin: this.workFormEntity.remainNumOrigin,
remainNumReal: this.workFormEntity.remainNumReal
}
confirmFinishWork(confirmParams).then(res => {
const response = res.data
@ -242,6 +256,7 @@ export default {
type: 'success',
})
this.resetForms()
this.$refs.goodsId.focus()
} else {
ElMessage.error(response.message)
}
@ -307,16 +322,27 @@ export default {
}
:deep(.el-input) {
width: 195px;
height: 130px;
font-size: 25px;
}
:deep(.el-input-number) {
width: 300px;
width: 125px;
height: 130px;
font-size: 25px;
}
/* :deep(.el-input .el-input__inner) {
font-size: 60px;
height: 130px;
}
:deep(.el-input-number .el-input__inner) {
font-size: 60px;
height: 130px;
} */
.title-div {
display: inline-flex;
width: -webkit-fill-available;
@ -334,7 +360,7 @@ export default {
.station-div {
display: inline-flex;
justify-content: center;
width: 125px;
width: 150px;
margin-left: 5px;
margin-right: 5px;
padding: 5px;
@ -350,7 +376,7 @@ export default {
.station-no-div {
display: inline-flex;
justify-content: center;
width: 75px;
width: 200px;
padding: 5px;
border: 5px double #000000;
}
@ -364,7 +390,7 @@ export default {
.display-title-div {
display: inline-flex;
justify-content: center;
width: 430px;
width: 205px;
height: 80px;
margin: 5px;
padding: 5px;
@ -380,7 +406,7 @@ export default {
.display-form-div {
display: inline-flex;
justify-content: center;
width: 420px;
width: 195px;
margin: 5px;
padding: 5px;
border: 5px double #000000;
@ -390,7 +416,7 @@ export default {
.display-form-div-left {
display: inline-flex;
justify-content: center;
width: 300px;
width: 125px;
margin: 5px;
padding: 5px;
border: 5px double #000000;
@ -399,7 +425,7 @@ export default {
.display-form-div-right {
display: inline-flex;
justify-content: center;
width: 100px;
width: 50px;
margin: 5px;
padding: 5px;
background-color: #CCCCCC;

View File

@ -25,7 +25,7 @@
<div style="display: flex;">
<div style="display: block; margin: 5px;">
<div
style="display: inline-flex; justify-content: center; height: 60px; width: 880px; margin: 5px; padding: 5px; background-color: #00AAE8;">
style="display: inline-flex; justify-content: center; height: 60px; width: 700px; margin: 5px; padding: 5px; background-color: #00AAE8;">
<span style="align-self: center; font-weight: bold;font-size: 25px;">
{{ workFormEntity.tip }}
</span>
@ -87,13 +87,19 @@
<span style="align-self: center; font-weight: bold;font-size: 25px;">备注</span>
</div>
<div
style="display: inline-flex; justify-content: center; width: 700px; margin: 5px; padding: 5px; background-color: #00AAE8;">
style="display: inline-flex; justify-content: center; width: 520px; margin: 5px; padding: 5px; background-color: #00AAE8;">
<span style="align-self: center; font-weight: bold;font-size: 25px;">
{{ workFormEntity.remark }}
</span>
</div>
</div>
</div>
<div style="margin: 10px;">
<div class="arrow" @click="confirmWork()">
<span
style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">打印标签</span>
</div>
</div>
<div style="margin: 10px;">
<div class="arrow" @click="confirmWork()">
<span
@ -151,34 +157,26 @@ export default {
},
methods: {
getFinishedWorkInfo() {
this.workFormEntity = {
tip: '工作已完成,请打印标签',
remark: '正常',
planRows: 2500,
actualRows: 2500,
planCounts: 6000,
actualCounts: 6000
const request = {
standId: this.standId,
}
// const request = {
// standId: this.standId,
// }
// getFinishedWorkInfo(request).then(res => {
// const response = res.data
// if (response.code == 0) {
// this.workFormEntity.tip = response.returnData.tip
// this.workFormEntity.remark = response.returnData.remark
// this.workFormEntity.planRows = response.returnData.planRows
// this.workFormEntity.actualRows = response.returnData.actualRows
// this.workFormEntity.planCounts = response.returnData.planCounts
// this.workFormEntity.actualCounts = response.returnData.actualCounts
// } else {
// this.resetForms()
// }
// }).catch(err => {
// console.log(err)
// this.resetForms()
// ElMessage.error('')
// })
getFinishedWorkInfo(request).then(res => {
const response = res.data
if (response.code == 0) {
this.workFormEntity.tip = response.returnData.tip
this.workFormEntity.remark = response.returnData.remark
this.workFormEntity.planRows = response.returnData.planRows
this.workFormEntity.actualRows = response.returnData.actualRows
this.workFormEntity.planCounts = response.returnData.planCounts
this.workFormEntity.actualCounts = response.returnData.actualCounts
} else {
this.resetForms()
}
}).catch(err => {
console.log(err)
this.resetForms()
ElMessage.error('查询工作信息错误')
})
},
resetForms() {
this.workFormEntity = reactive({
@ -191,7 +189,8 @@ export default {
})
},
confirmWork() {
if (formData.standId == '') {
console.log('完成确认')
if (this.standId == '') {
ElMessage({
message: '站台号不可缺少',
type: 'error',
@ -300,7 +299,7 @@ export default {
.station-div {
display: inline-flex;
justify-content: center;
width: 125px;
width: 150px;
margin-left: 5px;
margin-right: 5px;
padding: 5px;
@ -316,7 +315,7 @@ export default {
.station-no-div {
display: inline-flex;
justify-content: center;
width: 75px;
width: 200px;
padding: 5px;
border: 5px double #000000;
}

View File

@ -24,15 +24,23 @@
label-width="150px" style="max-width: 100%" :rules="rules" status-icon>
<div style="display: flex;">
<div style="display: block; margin: 5px;">
<div style="display: none;">{{ workFormEntity.tip }}</div>
<div style="display: flex;">
<div style="display: flex; flex-direction: column;">
<div class="display-title-div">
<span class="display-title-text">箱号</span>
</div>
<div class="display-form-div">
<el-input v-model="workFormEntity.vehicleId" size="default" ref="vehicleId"
v-on:keyup.enter="addTempTask()" clearable></el-input>
</div>
</div>
<div style="display: flex; flex-direction: column;">
<div class="display-title-div">
<span class="display-title-text">料号</span>
</div>
<div class="display-form-div">
<el-input v-model="workFormEntity.goodsId" size="default"
clearable></el-input>
<el-input v-model="workFormEntity.goodsId" size="default" clearable
ref="goodsId" v-on:keyup.enter="addTempTask()"></el-input>
</div>
</div>
<div style="display: flex; flex-direction: column;">
@ -41,34 +49,48 @@
</div>
<div style="display: flex; margin-top: 20px;">
<div class="display-form-div-left">
<el-input-number v-model.number="workFormEntity.needNum"
controls-position="right" :min="0" />
<el-input-number v-model.number="workFormEntity.goodsNum"
controls-position="right" :min="0" ref="goodsNum"
v-on:keyup.enter="addTempTask()" />
</div>
<div class="display-form-div-right">
<span class="display-form-text-right"></span>
</div>
</div>
</div>
<div style="display: flex; flex-direction: column;">
<div class="display-title-div">
<span class="display-title-text">箱号</span>
</div>
<div class="display-form-div">
<el-input v-model="workFormEntity.goodsId" size="default"
clearable></el-input>
<span class="display-form-text-right">PC</span>
</div>
</div>
</div>
</div>
</div>
<!-- <div style="margin: 10px;">
<div class="arrow" @click="addTempTask()">
<span
style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">继续绑定</span>
</div>
</div> -->
<div style="margin: 10px;">
<div class="arrow" @click="confirmTask()">
<span
style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">完成确认</span>
style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">绑定完成</span>
</div>
</div>
</div>
</el-form>
</fieldset>
<fieldset class="task-list-area" v-if="tempTasks.length > 0">
<legend>
已绑定物料
</legend>
<el-table :data="tempTasks" stripe border max-height="200px"
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
<el-table-column prop="vehicleId" label="箱号" min-width="120px" />
<el-table-column prop="goodsId" label="料号" min-width="120px" />
<el-table-column prop="goodsNum" label="数量" min-width="120px" />
<el-table-column fixed="right" label="操作" min-width="120px">
<template v-slot="scope"><el-button style="width: 120px;" plain type="primary"
@click="deleteRowTask(scope.row)">取消绑定</el-button>
</template>
</el-table-column>
</el-table>
</fieldset>
</div>
</el-container>
</el-config-provider>
@ -76,7 +98,7 @@
<script setup>
import store from '@/store'
import { callEmptyVehicle } from '@/api/task'
import { sendGoodsInTask } from '@/api/task'
import { reactive, ref } from 'vue'
import { ElMessage } from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
@ -88,44 +110,29 @@ export default {
data() {
return {
standId: store.getters.getStandId,
displayGoods: false,//
displayVehicleType1Selection: false,//
// timer: '',
labelPosition: 'top',
tempTasks: [],
currentRowTask: reactive({}),
currentVehicleId: '',
workFormRef: ref(),
workFormEntity: reactive({
vehicleType1: '',
vehicleType2: '',
vehicleId: '',
goodsId: '',
needNum: 0
goodsNum: null
}),
rules: reactive({
goodsId: [
{ required: true, message: '请输入料号' }
],
vehicleId: [
{ required: true, message: '请输入箱号' }
]
}),
vehicleType1Options: [],
vehicleType2Options: [
{
value: 'CLC一箱一料',
label: 'CLC一箱一料'
},
{
value: 'CLC一箱两料',
label: 'CLC一箱两料'
},
{
value: 'No-CLC',
label: 'No-CLC'
},
{
value: '间接物料',
label: '间接物料'
}
]
}
},
mounted() {
this.$refs.vehicleId.focus()
// this.timer = setInterval(() => {
// // this.getAllTasks()
// }, 2000)
@ -134,112 +141,88 @@ export default {
// clearInterval(this.timer)
},
methods: {
vehicleType2ChangeHandle() {
if (this.workFormEntity.vehicleType2 == '间接物料') {
this.displayGoods = true
this.displayVehicleType1Selection = false
this.vehicleType1Options = [
{
value: 'FB02',
label: '分包1/2个料箱'
},
{
value: 'FB03',
label: '分包1/3个料箱'
},
{
value: 'FB04',
label: '分包1/4个料箱'
},
{
value: 'FB05',
label: '分包1/5个料箱'
},
{
value: 'FB06',
label: '分包1/6个料箱'
}
]
} else if (this.workFormEntity.vehicleType2 == 'CLC一箱一料') {
this.displayGoods = false
this.displayVehicleType1Selection = true
this.vehicleType1Options = [
{
value: 'LR02',
label: '811左右2个'
},
{
value: 'FC01',
label: '822整体1个'
}
]
} else if (this.workFormEntity.vehicleType2 == 'CLC一箱两料') {
this.displayGoods = true
this.displayVehicleType1Selection = true
this.vehicleType1Options = [
{
value: 'LR01',
label: '810左右4个'
},
{
value: 'UD01',
label: '911上下2个'
}
]
} else {
this.displayGoods = false
this.displayVehicleType1Selection = false
this.vehicleType1Options = [
{
value: 'FB01',
label: '分包1个料箱'
},
]
}
},
resetForms() {
this.workFormEntity = reactive({
vehicleType1: '',
vehicleType2: '',
vehicleId: '',
goodsId: '',
needNum: 0
goodsNum: null
})
},
confirmTask() {
if (this.workFormEntity.vehicleType1 == '' && this.workFormEntity.vehicleType2 == '') {
addTempTask() {
if (this.workFormEntity.vehicleId != '' && this.workFormEntity.goodsId != '' && this.workFormEntity.goodsNum != null && this.workFormEntity.goodsNum > 0) {
if (this.currentVehicleId != '' && this.currentVehicleId != this.workFormEntity.vehicleId) {
ElMessage({
message: '存放类型和料箱类型至少需要一个',
message: '请下发之前料箱的任务后再继续绑定新的料箱',
type: 'error',
})
return
}
if (this.workFormEntity.needNum <= 0) {
const sameIndex = this.tempTasks.findIndex(task => task.goodsId == this.workFormEntity.goodsId)
if (sameIndex != -1) {//
var sameGoods = this.tempTasks[sameIndex]
sameGoods.goodsNum = sameGoods.goodsNum + this.workFormEntity.goodsNum
} else {
this.tempTasks.push({
vehicleId: this.workFormEntity.vehicleId,
goodsId: this.workFormEntity.goodsId,
goodsNum: this.workFormEntity.goodsNum
})
}
this.currentVehicleId = this.workFormEntity.vehicleId
this.workFormEntity.goodsId = ''
this.workFormEntity.goodsNum = null
this.$refs.goodsId.focus()
} else {
if (this.workFormEntity.vehicleId == '') {
this.$refs.vehicleId.focus()
return
}
if (this.workFormEntity.goodsId == '') {
this.$refs.goodsId.focus()
return
}
if (this.workFormEntity.goodsNum == null || this.workFormEntity.goodsNum <= 0) {
this.$refs.goodsNum.focus()
return
}
}
},
deleteRowTask(row) {//
this.tempTasks.splice(this.tempTasks.indexOf(row), 1)
if (this.tempTasks.length == 0) {
this.tempVehicleNo = ''
}
},
confirmTask() {
if (this.currentVehicleId == '') {
ElMessage({
message: '料箱数量必须为大于0的整数',
message: '必须输入料箱号',
type: 'error',
})
return
}
const request = {
vehicleType1: this.workFormEntity.vehicleType1,
vehicleType2: this.workFormEntity.vehicleType2,
goodsId: this.workFormEntity.goodsId,
needNum: this.workFormEntity.needNum
vehicleId: this.currentVehicleId,
userName: store.getters.getUserName,
goodsList: this.tempTasks.length > 0 ? this.tempTasks : [],
}
callEmptyVehicle(request).then(res => {
sendGoodsInTask(request).then(res => {
const response = res.data
if (response.code == 0) {
ElMessage({
message: '出空箱成功,请等待箱子到达',
message: '入库确认成功。',
type: 'success',
})
this.resetForms()
this.currentVehicleId = ''
this.tempTasks = []
this.$refs.vehicleId.focus()
} else {
ElMessage.error(response.message)
}
}).catch(err => {
console.log(err)
ElMessage.error('出空箱异常')
ElMessage.error('入库处理异常')
})
}
}
@ -269,6 +252,18 @@ export default {
overflow: auto;
}
.task-list-area {
margin: auto;
min-height: fit-content;
max-height: 90%;
margin-bottom: 10px;
min-width: inherit;
border: solid 1px;
border-radius: 10px;
box-shadow: 0px 15px 10px -15px #000;
overflow: auto;
}
.title-area {
display: flex;
min-height: 10%;
@ -333,7 +328,7 @@ export default {
.station-div {
display: inline-flex;
justify-content: center;
width: 125px;
width: 150px;
margin-left: 5px;
margin-right: 5px;
padding: 5px;
@ -349,7 +344,7 @@ export default {
.station-no-div {
display: inline-flex;
justify-content: center;
width: 75px;
width: 200px;
padding: 5px;
border: 5px double #000000;
}

391
src/layout/newConfig.vue Normal file
View File

@ -0,0 +1,391 @@
<template>
<div style="margin-bottom: 10px">
<el-config-provider :locale="zhCn">
<el-row>
<el-input v-model="configNameQuery" style="width: 256px; margin-right: 10px;" placeholder="配置名称"
:suffix-icon="Search" />
<el-button type="primary" @click="search()">搜索</el-button>
<el-button type="warning" @click="reset()">重置</el-button>
<el-button type="success" @click="exportExcel()">导出表格</el-button>
</el-row>
<br />
<el-table id="stock-table" :data="displayStocks" stripe border v-loading="loading" class="table-class"
max-height="650px" highlight-current-row @row-click="getCurrentRow" :row-style="rowStyle"
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
<el-table-column width="65px" fixed="left">
<template v-slot="scope">
<el-radio :label="scope.row.stockId" v-model="stockId">&nbsp;</el-radio>
</template>
</el-table-column>
<el-table-column prop="goodsRelated.goodsId" label="物料号" fixed="left" min-width="120px" show-overflow-tooltip />
<el-table-column prop="goodsRelated.goodsName" label="物料名称" fixed="left" min-width="120px" show-overflow-tooltip />
<el-table-column prop="goodsRelated.remainNum" label="剩余数量" min-width="120px" />
<el-table-column prop="goodsRelated.totalNum" label="入库数量" min-width="120px" />
<el-table-column prop="vehicleId" label="载具号" min-width="120px" show-overflow-tooltip />
<el-table-column prop="locationId" label="库位" :formatter="locationFormat" min-width="120px" show-overflow-tooltip />
<el-table-column prop="isInventory" label="是否盘点" min-width="120px" />
<el-table-column prop="createTime" label="上架时间" :formatter="timeFormat" min-width="120px" show-overflow-tooltip />
<el-table-column prop="goodsRelated.goodsStatus" label="物料状态" :formatter="goodsStatusFormat" min-width="120px" />
<el-table-column prop="stockStatus" label="库存状态" :formatter="stockStatusFormat" fixed="right"
min-width="120px" />
<!-- <el-table-column fixed="right" label="操作" width="120px" v-if="selStock == null">
<template v-slot="scope">
<el-button plain type="primary" @click="editCurrentRowStock(scope.row)">编辑</el-button>
</template>
</el-table-column> -->
</el-table>
<br />
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
:small="false" :disabled="false" :background="false" :default-page-size="10" @size-change="search"
@current-change="search" layout="total, sizes, prev, pager, next, jumper" :total="total" />
<el-dialog v-model="dialogVisible" title="库存信息" width="40%" draggable :show-close="false">
<el-form ref="stockFormRef" :model="stockFormEntity" :label-position="labelPosition" label-width="100px"
style="max-width: 100%" :rules="rules" status-icon>
<el-row :gutter="16">
<el-col :span="12" :offset="0">
<el-form-item label="型号" prop="goodsType">
<el-input v-model="stockFormEntity.goodsType" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格" prop="specification">
<el-input v-model="stockFormEntity.specification" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12" :offset="0">
<el-form-item label="条码号" prop="barcode">
<el-input v-model="stockFormEntity.barcode" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="批次号" prop="batchNo">
<el-input v-model="stockFormEntity.batchNo" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12" :offset="0">
<el-form-item label="入库数量" prop="originNum">
<el-input-number v-model.number="stockFormEntity.originNum" clearable
controls-position="right" :min="0" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="实际数量为0时删除库存" prop="realNum">
<el-input-number v-model.number="stockFormEntity.realNum" controls-position="right"
:min="0" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12" :offset="0">
<el-form-item label="库位" prop="locationId">
<el-input v-model="stockFormEntity.locationId" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="订单号" prop="orderId">
<el-input v-model="stockFormEntity.orderId" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12" :offset="0">
<el-form-item label="库存状态" prop="stockStatus">
<el-select-v2 v-model="stockFormEntity.stockStatus" placeholder="请选择库存状态"
:options="stockStatusOptions"></el-select-v2>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料状态" prop="goodsStatus">
<el-select-v2 v-model="stockFormEntity.goodsStatus" placeholder="请选择物料状态"
:options="goodsStatusOptions"></el-select-v2>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submitStockInfo(stockFormEntity)">
确定
</el-button>
</span>
</template>
</el-dialog>
</el-config-provider>
</div>
</template>
<script setup>
import { getAllStocks, updateStockInfo } from '@/api/stock.js'
import { downloadStockExcel } from '@/api/excel.js'
import { dateFormatter, locationFormatter, timeFormatter } from '@/utils/formatter.js'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { Search } from '@element-plus/icons-vue'
import { ref, reactive } from 'vue'
import { ElMessage } from 'element-plus'
// import FileSaver from 'file-saver';
// import * as XLSX from 'xlsx';
</script>
<script>
export default {
name: 'stock',
data() {
return {
pageInfo: {},
displayStocks: [],
currentPage: 1,
pageSize: 10,
total: 0,
configNameQuery: '',
loading: true,
stockId: '',
stockFormRef: ref(),
stockFormEntity: reactive({}),
rules: reactive({
goodsType: [
{ required: true, message: '请输入型号' }
],
specification: [
{ required: true, message: '请输入规格' }
],
barcode: [
{ required: true, message: '请输入条码号' }
],
batchNo: [
{ required: true, message: '请输入批次号' }
],
locationId: [
{ required: true, message: '请输入库位' }
],
orderId: [
{ required: true, message: '请输入订单号' }
],
stockStatus: [
{ required: true, message: '请输入库存状态' }
],
goodsStatus: [
{ required: true, message: '请输入物料状态' }
],
originNum: [
{ required: true, message: '请输入入库数量' },
{ type: 'number', message: '请输入数字' }
],
realNum: [
{ required: true, message: '请输入实际数量' },
{ type: 'number', message: '请输入数字' }
]
}),
labelPosition: 'top',
dialogVisible: false,
goodsStatusOptions: [
{
value: 0,
label: '合格'
},
{
value: 1,
label: '不合格'
},
{
value: 2,
label: '延期'
},
{
value: 3,
label: '过期'
},
{
value: 5,
label: '长时间未使用'
}
],
stockStatusOptions: [
{
value: 0,
label: '库存正常'
},
{
value: 1,
label: '出库中'
},
{
value: 2,
label: '盘点中'
},
{
value: 3,
label: '移库中'
},
{
value: 9,
label: '库存锁定'
}
],
}
},
mounted() {
this.search()
},
methods: {
locationFormat: (row, column, cellValue, index) => {
return locationFormatter(cellValue)
},
dateFormat: (row, column, cellValue, index) => {
return dateFormatter(cellValue)
},
timeFormat: (row, column, cellValue, index) => {
return timeFormatter(cellValue)
},
goodsStatusFormat: (row, column, cellValue, index) => {
if (cellValue === 0) {
return '合格'
} else if (cellValue === 1) {
return '不合格'
} else if (cellValue === 2) {
return '延期'
} else if (cellValue === 3) {
return '过期'
} else if (cellValue === 5) {
return '长时间未使用'
}
},
stockStatusFormat: (row, column, cellValue, index) => {
switch (cellValue) {
case 0:
return '库存正常'
case 1:
return '出库中'
case 2:
return '盘点中'
case 3:
return '移库中'
case 9:
return '库存锁定'
default:
return '异常'
}
},
rowStyle: ({ row, rowIndex }) => {
if (row.goodsStatus == 3) {
return { "color": "red" }
}
if (row.goodsStatus == 5) {
return { "color": "yellow" }
}
},
search() {
this.loading = true
const request = {
pageNo: this.currentPage,
pageSize: this.pageSize,
goodsId: this.goodsIdQuery.trim()
}
getAllStocks(request).then(res => {
const tableResponse = res.data
if (tableResponse.code != 0) {
ElMessage.error(tableResponse.message)
}
this.displayStocks = tableResponse.returnData.lists
this.total = tableResponse.returnData.total
}).catch(err => {
console.log(err)
ElMessage.error('查询库存错误')
})
this.loading = false
},
reset() {
this.queryKey = ''
this.search()
},
getCurrentRow(row) {
this.stockId = row.stockId
this.$emit('update:selStock', row)
},
exportExcel() {
downloadStockExcel().then(res => {
const link = document.createElement('a');//a
try {
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //blobblobtypexls
let blob = res.data //blob
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //
let _fileName = "库存报表" + dateFormatter(new Date) + ".xlsx"
link.style.display = 'none'//
// URL
const url = window.URL || window.webkitURL || window.moxURL
link.href = url.createObjectURL(blob)
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
url.revokeObjectURL(link.href)//url
} catch (e) {
ElMessage({
message: '下载文件失败:: ' + e,
type: 'error',
showClose: true
})
}
}).catch(err => {
ElMessage({
message: '导出失败:: ' + err,
type: 'error',
showClose: true
})
})
},
editCurrentRowStock(row) {
this.stockFormEntity = row
this.dialogVisible = true
},
submitStockInfo(stockFormEntity) {
updateStockInfo(stockFormEntity).then(res => {
if (res.data.code == 0) {
this.dialogVisible = false
ElMessage({
message: '更新库存成功',
type: 'success'
})
this.search()
} else {
ElMessage.error(res.data.message)
}
}).catch(err => {
ElMessage({
message: '更新料箱信息失败: ' + err,
type: 'error',
showClose: true
})
})
}
},
}
</script>
<style scoped>
.el-pagination {
padding-left: 5px;
}
.el-row .el-button {
width: 72px;
margin-left: 0px;
margin-right: 5px;
}
.table-class {
width: 100%;
}
.el-row .el-form-item .el-select-v2 {
width: 100% !important;
}
.el-row .el-form-item .el-input-number {
width: 100% !important;
}
</style>

310
src/layout/sortBoxs.vue Normal file
View File

@ -0,0 +1,310 @@
<template>
<el-config-provider :locale="zhCn">
<el-container class="content">
<div class="work-area">
<fieldset class="title-area">
<legend>
工作台
</legend>
<div class="title-div">
<span class="title-text">盒子分类</span>
</div>
<div class="station-div">
<span class="station-text">工作站</span>
</div>
<div class="station-no-div">
<span class="station-no-text">{{ standId }}</span>
</div>
</fieldset>
<fieldset class="main-area">
<legend>
盒子分类
</legend>
<el-form ref="workFormRef" :model="workFormEntity" :label-position="labelPosition"
label-width="150px" style="max-width: 100%" :rules="rules" status-icon>
<div style="display: flex;">
<div style="display: block; margin: 5px;">
<!-- <div style="display: none;">{{ workFormEntity.tip }}</div> -->
<div style="display: flex;">
<div style="display: flex; flex-direction: column;">
<div class="display-title-div">
<span class="display-title-text">大盒子</span>
</div>
<div class="display-form-div">
<el-input v-model="workFormEntity.goodsId" size="default"
clearable></el-input>
</div>
</div>
<div style="display: flex; flex-direction: column;">
<div class="display-title-div">
<span class="display-title-text">工单顺序</span>
</div>
<div style="display: flex; margin-top: 20px;">
<div class="display-form-div-left">
<el-input-number v-model.number="workFormEntity.goodsNum"
controls-position="right" :min="1" :max="10" />
</div>
</div>
</div>
</div>
</div>
<div style="margin: 10px;">
<div class="arrow" @click="confirmTask()">
<span
style="margin-left: 25px; align-self: center; font-weight: bold;font-size: 45px; writing-mode: vertical-lr;">完成确认</span>
</div>
</div>
</div>
</el-form>
</fieldset>
</div>
</el-container>
</el-config-provider>
</template>
<script setup>
import store from '@/store'
import { sendGoodsInTask } from '@/api/task'
import { reactive, ref } from 'vue'
import { ElMessage } from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
</script>
<script>
export default {
name: 'sortBox',
data() {
return {
standId: store.getters.getStandId,
// timer: '',
labelPosition: 'top',
workFormRef: ref(),
workFormEntity: reactive({
vehicleId: '',
goodsId: '',
goodsNum: 0
}),
rules: reactive({
goodsId: [
{ required: true, message: '请输入料号' }
],
vehicleId: [
{ required: true, message: '请输入箱号' }
]
}),
}
},
mounted() {
// this.timer = setInterval(() => {
// // this.getAllTasks()
// }, 2000)
},
beforeUnmount() {
// clearInterval(this.timer)
},
methods: {
resetForms() {
this.workFormEntity = reactive({
vehicleId: '',
goodsId: '',
goodsNum: 0
})
},
confirmTask() {
if (this.workFormEntity.vehicleId == '') {
ElMessage({
message: '必须输入料箱号',
type: 'error',
})
return
}
if (this.workFormEntity.goodsNum <= 0) {
ElMessage({
message: '入库数量必须大于等于1',
type: 'error',
})
return
}
const request = {
vehicleId: this.workFormEntity.vehicleId,
userName: store.getters.getUserName,
goodsList: this.workFormEntity.goodsId == '' ? [] : [{ goodsId: this.workFormEntity.goodsId, goodsNum: this.workFormEntity.goodsNum }],
}
sendGoodsInTask(request).then(res => {
const response = res.data
if (response.code == 0) {
ElMessage({
message: '入库确认成功。',
type: 'success',
})
this.resetForms()
} else {
ElMessage.error(response.message)
}
}).catch(err => {
console.log(err)
ElMessage.error('入库处理异常')
})
}
}
}
</script>
<style scoped>
.content {
display: flex;
width: 100%;
}
.work-area {
width: 100%;
/* padding: 5px; */
}
.main-area {
margin: auto;
min-height: fit-content;
max-height: 90%;
margin-bottom: 10px;
min-width: inherit;
border: solid 1px;
border-radius: 10px;
box-shadow: 0px 15px 10px -15px #000;
overflow: auto;
}
.title-area {
display: flex;
min-height: 10%;
max-height: max-content;
margin-bottom: 10px;
min-width: inherit;
border: solid 1px;
border-radius: 10px;
box-shadow: 0px 15px 10px -15px #000;
overflow: auto;
}
.arrow {
background: linear-gradient(-105deg,
transparent 50%,
#309330 50%,
#309330 100%) top right,
linear-gradient(-75deg,
transparent 50%,
#309330 50%,
#309330 100%) bottom right;
background-size: 100% 50%;
height: 270px;
width: 250px;
background-repeat: no-repeat;
display: inline-flex;
cursor: pointer;
}
:deep(.el-input) {
width: 340px;
height: 130px;
font-size: 25px;
}
:deep(.el-input-number) {
width: 340px;
height: 130px;
font-size: 25px;
}
.title-div {
display: inline-flex;
width: -webkit-fill-available;
margin-right: 5px;
padding: 5px;
background-color: #CCCCCC;
}
.title-text {
align-self: center;
font-weight: bold;
font-size: 25px;
}
.station-div {
display: inline-flex;
justify-content: center;
width: 150px;
margin-left: 5px;
margin-right: 5px;
padding: 5px;
background-color: #FFFAAA;
}
.station-text {
align-self: center;
font-weight: bold;
font-size: 25px;
}
.station-no-div {
display: inline-flex;
justify-content: center;
width: 200px;
padding: 5px;
border: 5px double #000000;
}
.station-no-text {
align-self: center;
font-weight: bold;
font-size: 25px;
}
.display-title-div {
display: inline-flex;
justify-content: center;
width: 350px;
height: 80px;
margin: 5px;
padding: 5px;
background-color: #FFFAAA;
}
.display-title-text {
align-self: center;
font-weight: bold;
font-size: 25px;
}
.display-form-div {
display: inline-flex;
justify-content: center;
width: 340px;
margin: 5px;
padding: 5px;
border: 5px double #000000;
margin-top: 25px;
}
.display-form-div-left {
display: inline-flex;
justify-content: center;
width: 340px;
margin: 5px;
padding: 5px;
border: 5px double #000000;
}
.display-form-div-right {
display: inline-flex;
justify-content: center;
width: 60px;
margin: 5px;
padding: 5px;
background-color: #CCCCCC;
}
.display-form-text-right {
align-self: center;
font-weight: bold;
font-size: 25px;
}
</style>

View File

@ -1,4 +1,3 @@
<template>
<div style="margin-bottom: 15px">
<el-config-provider :locale="zhCn">

View File

@ -21,6 +21,7 @@
<el-table-column prop="currentLocation" label="所在位置" fixed="left" :formatter="locationFormat" min-width="120px" show-overflow-tooltip />
<el-table-column prop="vehicleStatus" label="状态" :formatter="vehicleStatusFormat" min-width="120px" />
<el-table-column prop="isEmpty" label="空托" :formatter="isEmptyFormat" min-width="120px" />
<el-table-column prop="lastInTime" label="空托" :formatter="timeFormat" min-width="120px" />
<el-table-column fixed="right" label="操作" width="120px" v-if="selVehicle == null">
<template v-slot="scope">
<el-button plain type="primary" @click="editCurrentRowVehicle(scope.row)">编辑</el-button>
@ -80,7 +81,7 @@ import { getAllVehicles, updateVehicleInfo } from '@/api/vehicle'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { ElMessage } from 'element-plus'
import { ref, reactive } from 'vue'
import { vehicleStatusFormatter, locationFormatter, dateFormatter } from '@/utils/formatter.js'
import { vehicleStatusFormatter, locationFormatter, dateFormatter, timeFormatter } from '@/utils/formatter.js'
// import uploadVehicles from '@/excel/uploadVehicles.vue'
import { downloadVehicleExcel } from '@/api/excel.js'
</script>
@ -168,6 +169,9 @@ export default {
locationFormat: (row, column, cellValue, index) => {
return locationFormatter(cellValue)
},
timeFormat: (row, column, cellValue, index) => {
return timeFormatter(cellValue)
},
isEmptyFormat: (row, column, cellValue, index) => {
if (cellValue == 0) {
return '带料'

View File

@ -19,7 +19,7 @@ const routes = [
{ path: '/location', component: () => import('@/layout/location.vue') },// 库位
{ path: '/goods', component: () => import('@/layout/goods.vue') },// 物料
{ path: '/standSettings', component: () => import('@/layout/standSettings.vue') },// 站台(库口)设置
{ path: '/config', component: () => import('@/layout/config.vue') },// 系统配置
{ path: '/config', component: () => import('@/layout/newConfig.vue') },// 系统配置
{ path: '/taskMonitor', component: () => import('@/layout/taskMonitor.vue') },// 任务监控
{ path: '/vehicles', component: () => import('@/layout/vehicle.vue') },// 任务监控
{ path: '/inventory', component: () => import('@/layout/inventory.vue') },// 盘点
@ -28,6 +28,7 @@ const routes = [
{ path: '/testDoKitting', component: () => import('@/layout/doKitting.vue') },// 备料执行
{ path: '/testFinishKitting', component: () => import('@/layout/finishKitting.vue') },// 备料完成
{ path: '/testCallEmptyVehicle', component: () => import('@/layout/callEmptyVehicle.vue') },// 备料完成
{ path: '/testSortBoxs', component: () => import('@/layout/sortBoxs.vue') },// 备料完成
]
},
{

View File

@ -11,7 +11,7 @@ export default createStore({
menuList: [],
token: '',
verifier: '',
standId: '# 1'
standId: ''
},
getters: {
getUserName(state) {
@ -68,6 +68,14 @@ export default createStore({
sessionStorage.setItem("menuList", state.menuList)
},
/**
* 存储站台信息
*/
mutationStandId(state, data) {
state.standId = data
sessionStorage.setItem("standId", state.standId)
},
/**
* 存储认证
*/

View File

@ -10,7 +10,7 @@
<div class="user">
<el-dropdown @command="handleCommand">
<span class="el-dropdown-link" style="font-size: 15px; font-weight: bold;">
{{ userName }}
用户名{{ userName }}
</span>
<template #dropdown>
<el-dropdown-menu>
@ -47,6 +47,7 @@
</el-container>
<el-footer class="footer">
<span style="align-self: center; margin-left: 10px; font-weight: bold;">Lets do the work!</span>
<span style="align-self: center; margin-left: auto; margin-right: 25px; font-weight: bold;">Version1.0</span>
<span style="align-self: center; margin-right: 10px; font-weight: bold;">Caterpillar © 2024. All Rights Reserved</span>
</el-footer>
</el-container>

View File

@ -37,6 +37,7 @@ const login = () => {
if (res.data.code == 0) {
store.commit('mutationUser', res.data.returnData.user)//
store.commit('mutationMenu', res.data.returnData.menuList)//
store.commit('mutationStandId', res.data.returnData.standId)
// router.replace({ path: '/' })//
router.replace({ path: '/systemCenter' })//
} else {