代码更新:
1. 增加二维码入库界面 2. 增加工作总结界面
This commit is contained in:
parent
1e7833ee7b
commit
66030b5573
|
|
@ -96,6 +96,13 @@ const updateWorkFlows = (params) => {
|
|||
})
|
||||
}
|
||||
|
||||
const getWorkSummary = (params) => {
|
||||
return request({
|
||||
url: '/kateWork/getWorkSummary',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
getDbs,
|
||||
|
|
@ -109,5 +116,6 @@ export {
|
|||
updateStationConfigs,
|
||||
getClcKanbanRequirement,
|
||||
getWorkFlows,
|
||||
updateWorkFlows
|
||||
updateWorkFlows,
|
||||
getWorkSummary
|
||||
}
|
||||
473
src/layout/goodsInQR.vue
Normal file
473
src/layout/goodsInQR.vue
Normal file
|
|
@ -0,0 +1,473 @@
|
|||
<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: 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.qrcode" size="default" clearable
|
||||
ref="qrcode" v-on:keyup.enter="addTempTask()"></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
|
||||
ref="goodsId" v-on:keyup.enter="addTempTask()"></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="0" :max="9999" ref="goodsNum"
|
||||
v-on:keyup.enter="addTempTask()" />
|
||||
</div>
|
||||
<div class="display-form-div-right">
|
||||
<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>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { sendGoodsInTask } from '@/api/task'
|
||||
import { replaceEnglishAndNumberIGAI } from '@/utils/formatter'
|
||||
import { reactive, ref } from 'vue'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'goodsIn',
|
||||
data() {
|
||||
return {
|
||||
standId: store.getters.getStandId,
|
||||
// timer: '',
|
||||
labelPosition: 'top',
|
||||
tempTasks: [],
|
||||
currentRowTask: reactive({}),
|
||||
currentVehicleId: '',
|
||||
workFormRef: ref(),
|
||||
workFormEntity: reactive({
|
||||
vehicleId: '',
|
||||
qrcode: '',
|
||||
goodsId: '',
|
||||
goodsNum: null
|
||||
}),
|
||||
rules: reactive({
|
||||
vehicleId: [
|
||||
{ required: true, message: '请输入箱号' }
|
||||
]
|
||||
}),
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs.vehicleId.focus()
|
||||
// this.timer = setInterval(() => {
|
||||
// // this.getAllTasks()
|
||||
// }, 2000)
|
||||
},
|
||||
beforeUnmount() {
|
||||
// clearInterval(this.timer)
|
||||
},
|
||||
methods: {
|
||||
resetForms() {
|
||||
this.workFormEntity = reactive({
|
||||
vehicleId: '',
|
||||
goodsId: '',
|
||||
goodsNum: null
|
||||
})
|
||||
},
|
||||
addTempTask() {
|
||||
this.workFormEntity.vehicleId = replaceEnglishAndNumberIGAI(this.workFormEntity.vehicleId)
|
||||
if (this.workFormEntity.qrcode != '') {
|
||||
try {
|
||||
const goodsInfo = this.workFormEntity.qrcode.split('-')
|
||||
if (goodsInfo.length == 2) {
|
||||
if (isNaN(Number.parseInt(goodsInfo[1]))) {
|
||||
errorBox('二维码格式不正确')
|
||||
return
|
||||
} else {
|
||||
this.workFormEntity.goodsId = goodsInfo[0]
|
||||
this.workFormEntity.goodsNum = Number.parseInt(goodsInfo[1])
|
||||
}
|
||||
} else {
|
||||
errorBox('二维码格式不正确')
|
||||
return
|
||||
}
|
||||
} catch (error) {
|
||||
errorBox('二维码格式不正确')
|
||||
return
|
||||
}
|
||||
}
|
||||
if (this.workFormEntity.vehicleId != '' && this.workFormEntity.goodsId != '' && this.workFormEntity.goodsNum != null && this.workFormEntity.goodsNum > 0) {
|
||||
if (this.workFormEntity.vehicleId == this.workFormEntity.goodsId) {
|
||||
errorBox('料箱号与料号不能相同')
|
||||
return
|
||||
}
|
||||
if (this.workFormEntity.goodsId == this.workFormEntity.goodsNum) {
|
||||
errorBox('料号与数量不能相同')
|
||||
return
|
||||
}
|
||||
if (this.workFormEntity.vehicleId == this.workFormEntity.goodsNum) {
|
||||
errorBox('料箱号与数量不能相同')
|
||||
return
|
||||
}
|
||||
if (this.currentVehicleId != '' && this.currentVehicleId != this.workFormEntity.vehicleId) {
|
||||
errorBox('请下发之前料箱的任务后再继续绑定新的料箱')
|
||||
return
|
||||
}
|
||||
if (this.workFormEntity.goodsNum == 9999) {
|
||||
ElMessageBox.confirm(
|
||||
'当前数量达最大值9999。\n是否继续',
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
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.workFormEntity.qrcode = ''
|
||||
this.$refs.qrcode.focus()
|
||||
return
|
||||
}).catch(() => {
|
||||
ElMessage.info('操作取消')
|
||||
this.workFormEntity.goodsNum = null
|
||||
this.$refs.goodsNum.focus()
|
||||
return
|
||||
})
|
||||
} else {
|
||||
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.workFormEntity.qrcode = ''
|
||||
this.$refs.qrcode.focus()
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if (this.workFormEntity.vehicleId == '') {
|
||||
this.$refs.vehicleId.focus()
|
||||
return
|
||||
}
|
||||
if (this.workFormEntity.qrcode == '') {
|
||||
this.$refs.qrcode.focus()
|
||||
return
|
||||
}
|
||||
}
|
||||
},
|
||||
deleteRowTask(row) {// 删除当前行的入库任务
|
||||
this.tempTasks.splice(this.tempTasks.indexOf(row), 1)
|
||||
if (this.tempTasks.length == 0) {
|
||||
this.tempVehicleNo = ''
|
||||
}
|
||||
},
|
||||
confirmTask() {
|
||||
if (this.currentVehicleId == '') {
|
||||
errorBox('必须输入料箱号')
|
||||
return
|
||||
}
|
||||
const request = {
|
||||
vehicleId: this.currentVehicleId,
|
||||
userName: store.getters.getUserName,
|
||||
goodsList: this.tempTasks.length > 0 ? this.tempTasks : [],
|
||||
}
|
||||
sendGoodsInTask(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
ElMessage.success('入库确认成功。')
|
||||
this.resetForms()
|
||||
this.currentVehicleId = ''
|
||||
this.tempTasks = []
|
||||
this.$refs.vehicleId.focus()
|
||||
} else {
|
||||
errorBox(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('入库处理异常')
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</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;
|
||||
}
|
||||
|
||||
.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%; */
|
||||
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: 230px;
|
||||
height: 130px;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
:deep(.el-input-number) {
|
||||
width: 150px;
|
||||
height: 130px;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
:deep(.el-select-v2__wrapper) {
|
||||
width: 230px;
|
||||
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: 240px;
|
||||
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: 230px;
|
||||
margin: 5px;
|
||||
padding: 5px;
|
||||
border: 5px double #000000;
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
.display-form-div-left {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
width: 150px;
|
||||
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>
|
||||
|
|
@ -28,18 +28,18 @@
|
|||
<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' }">
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }" @sort-change="handleSortChange">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.stockId" v-model="stockId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stockId" label="库存编号" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsId" label="物料号" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsName" label="物料名称" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="locationId" label="库位" :formatter="locationFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="totalNum" label="入库数量" min-width="120px" />
|
||||
<el-table-column prop="remainNum" label="剩余数量" min-width="120px" />
|
||||
<el-table-column prop="goodsStatus" label="物料状态" :formatter="goodsStatusFormat" min-width="120px" />
|
||||
|
|
@ -48,9 +48,9 @@
|
|||
<el-table-column prop="isInventory" label="是否盘点" :formatter="yesOrNoFormat" min-width="120px" />
|
||||
<el-table-column prop="inventoryTaskId" label="盘点任务号" min-width="120px" />
|
||||
<el-table-column prop="noUseDays" label="未使用天数" min-width="120px" />
|
||||
<el-table-column prop="createTime" label="上架时间" :formatter="timeFormat" min-width="120px"
|
||||
<el-table-column prop="createTime" label="上架时间" sortable="custom" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="lastUpdateTime" label="最近更新时间" :formatter="timeFormat" min-width="120px"
|
||||
<el-table-column prop="lastUpdateTime" label="最近更新时间" sortable="custom" :formatter="timeFormat" min-width="140px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="lastUpdateUser" label="最近更新用户" min-width="120px" />
|
||||
<el-table-column fixed="right" label="操作" width="120px" v-if="selStock == null">
|
||||
|
|
@ -182,6 +182,7 @@ import { getAllStocks, updateStockInfo } from '@/api/stock.js'
|
|||
import { getGoodsInfoByGoodsId } from '@/api/goods.js'
|
||||
import { downloadStockExcel } from '@/api/excel.js'
|
||||
import { dateFormatter, locationFormatter, timeFormatter, yesOrNoFormatter } from '@/utils/formatter.js'
|
||||
import { toUnderScoreCase } from '@/utils/stringUtils.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import { ref, reactive } from 'vue'
|
||||
|
|
@ -201,6 +202,8 @@ export default {
|
|||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: '',
|
||||
isAsc: true,
|
||||
goodsIdQuery: '',
|
||||
vehicleIdQuery: '',
|
||||
locationIdQuery: '',
|
||||
|
|
@ -357,11 +360,18 @@ export default {
|
|||
return { "color": "yellow" }
|
||||
}
|
||||
},
|
||||
handleSortChange(data) {
|
||||
this.sortBy = toUnderScoreCase(data.prop)
|
||||
this.isAsc = data.order == 'ascending'
|
||||
this.search()
|
||||
},
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
sortBy: this.sortBy,
|
||||
isAsc: this.isAsc,
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
vehicleId: this.vehicleIdQuery.trim(),
|
||||
locationId: this.locationIdQuery.trim(),
|
||||
|
|
|
|||
|
|
@ -33,8 +33,7 @@
|
|||
<el-table-column prop="needNum" label="需求数量" min-width="120px" />
|
||||
<el-table-column prop="pickedNum" label="已拣数量" min-width="120px" />
|
||||
<el-table-column prop="lightStatus" label="亮灯状态" :formatter="lightStatusFormat" min-width="120px" />
|
||||
<el-table-column prop="workStatus" label="工作状态" :formatter="workStatusFormat"
|
||||
min-width="120px" />
|
||||
<el-table-column prop="workStatus" label="工作状态" :formatter="workStatusFormat" min-width="120px" />
|
||||
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px"
|
||||
|
|
@ -102,7 +101,8 @@
|
|||
<el-col :span="12">
|
||||
<el-form-item label="已拣数量" prop="pickedNum">
|
||||
<el-input-number v-model.number="workFlowFormEntity.pickedNum"
|
||||
controls-position="right" :min="0" :max="workFlowFormEntity.needNum" clearable />
|
||||
controls-position="right" :min="0" :max="workFlowFormEntity.needNum"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
@ -274,10 +274,10 @@ export default {
|
|||
}
|
||||
},
|
||||
reset() {
|
||||
this.standIdQuery = '',
|
||||
this.workOrderQuery = '',
|
||||
this.workCenterQuery = '',
|
||||
this.goodsIdQuery = '',
|
||||
this.standIdQuery = ''
|
||||
this.workOrderQuery = ''
|
||||
this.workCenterQuery = ''
|
||||
this.goodsIdQuery = ''
|
||||
this.search()
|
||||
},
|
||||
editCurrentRow(row) {
|
||||
|
|
|
|||
|
|
@ -3,89 +3,61 @@
|
|||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="vehicleIdQuery" style="width: 256px; margin-right: 10px;" placeholder="箱号"
|
||||
<el-input v-model="workOrderQuery" style="width: 158px; margin-right: 10px;" placeholder="工单号"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="standQuery" style="width: 256px; margin-right: 10px;" placeholder="工站"
|
||||
<el-input v-model="workCenterQuery" style="width: 158px; margin-right: 10px;" placeholder="工位/小盒子"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px;" placeholder="站台号"
|
||||
:suffix-icon="Search" />
|
||||
<el-date-picker v-model="workDateQuery" type="date" placeholder="选择工作日期" :shortcuts="shortcuts"
|
||||
style="width: 158px; margin-right: 10px;" />
|
||||
<el-select-v2 v-model="lackStatusQuery" style="width: 158px; margin-right: 10px;"
|
||||
placeholder="请选择缺料状态" :options="lackStatusOptions" @change="search()"></el-select-v2>
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="pickTaskList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }">
|
||||
<el-table :data="workSummaryList" stripe border v-loading="loading" class="table-class"
|
||||
highlight-current-row max-height="650px" @row-click="getCurrentRow"
|
||||
: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.pickTaskId" v-model="pickTaskId"> </el-radio>
|
||||
<el-radio :label="scope.row.workFlowId" v-model="workFlowId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="pickTaskId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" />
|
||||
<el-table-column prop="standId" label="站台号" fixed="left" min-width="120px" />
|
||||
<el-table-column prop="pickStatus" label="拣选状态" :formatter="pickStatusFormat" min-width="120px" />
|
||||
<el-table-column prop="lastUpdateTime" label="最近更新时间" :formatter="timeFormat" show-overflow-tooltip
|
||||
<el-table-column prop="workFlowId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="workStation" label="站台号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="workOrder" label="工单号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="workCenter" label="工位/小盒子" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="goodsId" label="料号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="needNum" label="需求数量" min-width="120px" />
|
||||
<el-table-column prop="pickedNum" label="已拣数量" min-width="120px" />
|
||||
<el-table-column prop="lackNum" label="缺件数量" min-width="120px" />
|
||||
<el-table-column prop="eLocationId" label="拣货位置" min-width="120px" />
|
||||
<el-table-column prop="lackStatus" label="缺料状态" fixed="right" :formatter="lackStatusFormat"
|
||||
min-width="120px" />
|
||||
<el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="workStatus" label="工作状态" :formatter="workStatusFormat" min-width="120px" />
|
||||
<el-table-column prop="workDate" label="工作日期" :formatter="dateFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="opUser" label="操作用户" min-width="120px" />
|
||||
</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"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
<el-dialog v-model="dialogVisible" title="拣选任务详细信息" width="40%" draggable :show-close="false">
|
||||
<div
|
||||
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||
<el-form ref="pickTaskFormRef" :model="pickTaskFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="id" prop="pickTaskId">
|
||||
<el-input v-model="pickTaskFormEntity.pickTaskId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工站" prop="vehicleId">
|
||||
<el-input v-model="pickTaskFormEntity.vehicleId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="小盒子" prop="standId">
|
||||
<el-input v-model="pickTaskFormEntity.standId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="任务状态" prop="pickStatus">
|
||||
<el-select-v2 v-model="pickTaskFormEntity.pickStatus" placeholder="请选择任务状态"
|
||||
:options="taskStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitInfo(pickTaskFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getPickTasksByPage, updatePickTaskInfo } from '@/api/taskMonitor.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { getWorkSummary } from '@/api/kateWork.js'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
|
|
@ -94,38 +66,47 @@ import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
|||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'pickTaskMonitor',
|
||||
name: 'workFlow',
|
||||
data() {
|
||||
return {
|
||||
pickTaskList: [],
|
||||
workSummaryList: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
vehicleIdQuery: '',
|
||||
standQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
pickTaskId: '',
|
||||
pickTaskFormEntity: reactive({}),
|
||||
pickTaskFormRef: ref(),
|
||||
labelPosition: 'top',
|
||||
rules: reactive({}),
|
||||
taskStatusOptions: [
|
||||
workOrderQuery: '',
|
||||
workCenterQuery: '',
|
||||
goodsIdQuery: '',
|
||||
standIdQuery: '',
|
||||
workDateQuery: null,
|
||||
shortcuts: [
|
||||
{
|
||||
value: -1,
|
||||
label: '暂存'
|
||||
text: '今天',
|
||||
value: new Date(),
|
||||
},
|
||||
{
|
||||
text: '昨天',
|
||||
value: () => {
|
||||
const date = new Date()
|
||||
date.setTime(date.getTime() - 3600 * 1000 * 24)
|
||||
return date
|
||||
},
|
||||
},
|
||||
],
|
||||
lackStatusQuery: -99,
|
||||
loading: true,
|
||||
workFlowId: '',
|
||||
lackStatusOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '待下发'
|
||||
label: '不缺'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '已下发'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '已到达'
|
||||
label: '缺料'
|
||||
}
|
||||
],
|
||||
}
|
||||
|
|
@ -139,20 +120,25 @@ export default {
|
|||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
vehicleId: this.vehicleIdQuery.trim(),
|
||||
standId: this.standQuery.trim(),
|
||||
workStation: this.standIdQuery.trim(),
|
||||
workOrder: this.workOrderQuery.trim(),
|
||||
workCenter: this.workCenterQuery.trim(),
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
lackStatus: this.lackStatusQuery == -99 ? null : this.lackStatusQuery,
|
||||
workDate: timeFormatter(this.workDateQuery),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getPickTasksByPage(request).then(res => {
|
||||
getWorkSummary(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.pickTaskList = tableResponse.returnData.lists
|
||||
this.workSummaryList = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
ElMessage.error(tableResponse.message)
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
ElMessage.error('查询拣选任务错误' + err.message)
|
||||
console.log(err)
|
||||
errorBox('查询工作总结错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
|
|
@ -162,59 +148,38 @@ export default {
|
|||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
pickStatusFormat: (row, column, cellValue, index) => {
|
||||
lackStatusFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case -1:
|
||||
return '暂存'
|
||||
case 0:
|
||||
return '待下发'
|
||||
return '不缺'
|
||||
case 1:
|
||||
return '已下发'
|
||||
return '缺料'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
workStatusFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 0:
|
||||
return '未开始'
|
||||
case 1:
|
||||
return '正在做'
|
||||
case 2:
|
||||
return '已到达'
|
||||
return '已完成'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
this.vehicleIdQuery = ''
|
||||
this.standQuery = ''
|
||||
this.standIdQuery = ''
|
||||
this.workOrderQuery = ''
|
||||
this.workCenterQuery = ''
|
||||
this.goodsIdQuery = ''
|
||||
this.workDateQuery = null
|
||||
this.search()
|
||||
},
|
||||
editCurrentRow(row) {
|
||||
this.pickTaskId = row.pickTaskId
|
||||
this.pickTaskFormEntity = {
|
||||
pickTaskId: row.pickTaskId,
|
||||
vehicleId: row.vehicleId,
|
||||
standId: row.standId,
|
||||
pickStatus: row.pickStatus,
|
||||
lastUpdateTime: row.lastUpdateTime
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submitInfo(formData) {
|
||||
const params = {
|
||||
pickTaskId: formData.pickTaskId,
|
||||
pickStatus: formData.pickStatus,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updatePickTaskInfo(params).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.error('更新拣选任务失败。')
|
||||
})
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.pickTaskId = row.pickTaskId
|
||||
this.workFlowId = row.workFlowId
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ const routes = [
|
|||
{ path: '/goodsToStation', component: () => import('@/layout/goodsToStation.vue') },// 站台要料
|
||||
{ path: '/clcNoPlan', component: () => import('@/layout/clcNoPlan.vue') },// 非计划领料
|
||||
{ path: '/clcKanban', component: () => import('@/layout/clcKanban.vue') },// 需求看板
|
||||
{ path: '/goodsInQR', component: () => import('@/layout/goodsInQR.vue') },// 需求看板
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,6 +2,21 @@ import moment from "moment";
|
|||
function genTaskId(code) {
|
||||
return code + moment(new Date()).format("YYYYMMDDHHmmssSSS");
|
||||
}
|
||||
export {
|
||||
genTaskId
|
||||
|
||||
function toCamelCase(str) {
|
||||
return str.replace(/-(\w)/g, function (_, c) {
|
||||
return c ? c.toUpperCase() : "";
|
||||
});
|
||||
}
|
||||
|
||||
function toUnderScoreCase(str) {
|
||||
return str.replace(/([A-Z])/g, function (_, c) {
|
||||
return "_" + c.toLowerCase();
|
||||
});
|
||||
}
|
||||
|
||||
export {
|
||||
genTaskId,
|
||||
toCamelCase,
|
||||
toUnderScoreCase
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user