forked from BaoKaiWms/202501-Wms-Kate-Wuxi
1. 增加已开始工单的物料需求
2. 增加库位监控界面
This commit is contained in:
parent
64f1067a8d
commit
78eb0460b0
20903
dev_wms_client/package-lock.json
generated
20903
dev_wms_client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
|
@ -1,40 +1,9 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
const getLocations = (params) => {
|
||||
export const queryLocationsByPage = (params) => {
|
||||
return request({
|
||||
url: '/location/getLocationsByPage',
|
||||
url: '/location/queryLocationsByPage',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const updateLocation = (params) => {
|
||||
return request({
|
||||
url: '/location/updateLocation',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const getELocationsByPage = (params) => {
|
||||
return request({
|
||||
url: '/location/getELocationsByPage',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
const updateELocationInfo = (params) => {
|
||||
return request({
|
||||
url: '/location/updateELocationInfo',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
getLocations,
|
||||
updateLocation,
|
||||
getELocationsByPage,
|
||||
updateELocationInfo
|
||||
}
|
||||
|
|
@ -42,7 +42,6 @@ const closeTag = (tag) => {
|
|||
const handleClose = (tag, index) => {
|
||||
// 处理跳转
|
||||
if (router.currentRoute.value.path === tag.path) {
|
||||
console.log(index + ':' + tags.value.length)
|
||||
if (index === (tags.value.length - 1)) { // 关闭最后一个标签,则路由跳转至最后一个
|
||||
router.push('/home')
|
||||
} else { // 路由跳转至下一个标签页
|
||||
|
|
|
|||
|
|
@ -263,4 +263,26 @@ export const outTypeOptions = [
|
|||
value: 9,
|
||||
label: '紧急出库'
|
||||
}
|
||||
]
|
||||
// 是否锁定枚举
|
||||
export const lockOptions = [
|
||||
{
|
||||
value: 0,
|
||||
label: '未锁定'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '已锁定'
|
||||
}
|
||||
]
|
||||
// 是否空闲枚举
|
||||
export const occupyOptions = [
|
||||
{
|
||||
value: 0,
|
||||
label: '空闲'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '占用'
|
||||
}
|
||||
]
|
||||
|
|
@ -7,23 +7,33 @@
|
|||
label-width="158px" style="max-width: 100%" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="任务类型">
|
||||
<el-select-v2 style="width: 196px" v-model="searchQueryFormEntity.outType" placeholder="任务类型"
|
||||
:options="addAllOptionOfOptions(outTypeOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="箱号">
|
||||
<el-input v-model="searchQueryFormEntity.vehicleId" @keyup.enter="search()" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="料号">
|
||||
<el-input v-model="searchQueryFormEntity.goodsId" @keyup.enter="search()" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间from">
|
||||
<el-date-picker v-model="searchQueryFormEntity.fromTime" type="datetime"
|
||||
placeholder="请选择from时间" :shortcuts="shortcuts"
|
||||
style="width: 196px;" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间to">
|
||||
<el-date-picker v-model="searchQueryFormEntity.toTime" type="datetime"
|
||||
placeholder="请选择to时间" :shortcuts="shortcuts"
|
||||
style="width: 196px;" clearable/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<div style="align-content: center;">
|
||||
<el-row>
|
||||
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button type="success" class="btn-search"
|
||||
@click="exportExcel()">导出excel
|
||||
</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
|
|
@ -40,36 +50,42 @@
|
|||
</el-table-column>
|
||||
<el-table-column prop="taskId" label="任务号" fixed="left" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="outType" label="任务类型" fixed="left" :formatter="outsTypeFormat" min-width="120px"
|
||||
<el-table-column prop="taskType" label="任务类型" :formatter="taskTypeFormat" min-width="120px"
|
||||
sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="taskStatus" label="任务状态" :formatter="taskStatusFormat" min-width="120px"
|
||||
sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="taskPriority" label="优先级" min-width="120px" sortable="custom"
|
||||
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="料号" min-width="120px" sortable="custom"
|
||||
<el-table-column prop="goodsId" label="料号" min-width="120px" fixed="left" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="needNum" label="需求数量"
|
||||
<el-table-column prop="goodsDesc" label="物料描述"
|
||||
min-width="120px" sortable="custom" show-overflow-tooltip/>
|
||||
<el-table-column prop="distributeNum" label="已分配数量" min-width="120px" sortable="custom"
|
||||
<el-table-column prop="opNum" label="操作数量" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="pickNum" label="已拣选数量" min-width="120px"
|
||||
<el-table-column prop="stockNum" label="库存数量" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip/>
|
||||
<el-table-column prop="destination" label="目标站台" min-width="120px" sortable="custom"
|
||||
<el-table-column prop="origin" label="起点" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="userName" label="用户" min-width="120px"
|
||||
<el-table-column prop="destination" label="终点" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip/>
|
||||
<el-table-column prop="reason" label="原因" min-width="120px" sortable="custom"
|
||||
<el-table-column prop="wcsTaskId" label="wcs任务号" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="requestTime" label="请求时间" :formatter="timeFormat" min-width="120px"
|
||||
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" fixed="right" min-width="120px"
|
||||
sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<!-- <el-table-column fixed="right" label="操作" width="170px">
|
||||
<template v-slot="scope">
|
||||
<div style="display: inline-block; align-content: center;">
|
||||
<el-button type="primary"
|
||||
@click="editCurrentRowFormEntity(scope.row)">编辑</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" fixed="right" min-width="120px"
|
||||
sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="opUser" label="操作用户" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip/>
|
||||
<el-table-column prop="remark" label="备注" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip/>
|
||||
<el-table-column prop="callStand" label="呼叫站台" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip/>
|
||||
</el-table>
|
||||
<br/>
|
||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||
|
|
@ -86,15 +102,13 @@
|
|||
<script setup>
|
||||
import store from '@/store'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import {queryOutsByPage} from '@/api/taskQuery.js'
|
||||
import {timeFormatter, outTaskTypeFormatter} from '@/utils/formatter.js'
|
||||
import {queryInTaskRecordByPage} from '@/api/taskQuery.js'
|
||||
import {timeFormatter, wmsTaskTypeFormatter, wmsTaskStatusFormatter, dateFormatter} from '@/utils/formatter.js'
|
||||
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||
import {ElMessage} from 'element-plus'
|
||||
import {genTableRequest} from '@/utils/generator.js'
|
||||
import {labelPosition} from '@/constant/form.js'
|
||||
import {outTypeOptions} from '@/constant/options.js'
|
||||
import {addAllOptionOfOptions} from '@/utils/generator.js'
|
||||
import {loading} from '@/utils/loading'
|
||||
import {labelPosition, shortcuts} from '@/constant/form.js'
|
||||
import {exportInTaskRecordExcel} from '@/api/excel.js'
|
||||
|
||||
/**
|
||||
* 常量定义
|
||||
|
|
@ -111,14 +125,15 @@ let baseTableQuery = reactive({
|
|||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: new Map([['requestTime', true]]),// 按照成品号顺序排序
|
||||
sortBy: new Map([['createTime', false]]),// 按照创建时间倒序
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
})
|
||||
let searchQueryFormEntity = reactive({
|
||||
vehicleId: '',
|
||||
goodsId: '',
|
||||
outType: -99
|
||||
fromTime: null,
|
||||
toTime: null
|
||||
})
|
||||
let searchQueryFormRef = ref()
|
||||
let taskId = ''
|
||||
|
|
@ -149,8 +164,9 @@ const search = () => {
|
|||
// 设定查询参数
|
||||
request.vehicleId = searchQueryFormEntity.vehicleId.trim()
|
||||
request.goodsId = searchQueryFormEntity.goodsId.trim()
|
||||
request.out = searchQueryFormEntity.outType === -99 ? null : searchQueryFormEntity.outType
|
||||
queryOutsByPage(request).then((res) => {
|
||||
request.fromTime = searchQueryFormEntity.fromTime == null ? null : timeFormatter(searchQueryFormEntity.fromTime)
|
||||
request.toTime = searchQueryFormEntity.toTime == null ? null : timeFormatter(searchQueryFormEntity.toTime)
|
||||
queryInTaskRecordByPage(request).then((res) => {
|
||||
const response = res.data
|
||||
if (response.code === 0) {
|
||||
const data = response.data
|
||||
|
|
@ -174,12 +190,14 @@ const search = () => {
|
|||
const clearQuery = () => {
|
||||
searchQueryFormEntity.vehicleId = ''
|
||||
searchQueryFormEntity.goodsId = ''
|
||||
searchQueryFormEntity.fromTime = null
|
||||
searchQueryFormEntity.toTime = null
|
||||
}
|
||||
const handleSortChange = (data) => {
|
||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
baseTableQuery.sortBy.delete(data.prop)
|
||||
}
|
||||
baseTableQuery.sortBy.set(data.prop, data.order === 'ascending')
|
||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||
search()
|
||||
}
|
||||
const getCurrentRow = (row) => {
|
||||
|
|
@ -188,8 +206,45 @@ const getCurrentRow = (row) => {
|
|||
const timeFormat = (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
}
|
||||
const outsTypeFormat = (row, column, cellValue, index) => {
|
||||
return outTaskTypeFormatter(cellValue)
|
||||
const taskTypeFormat = (row, column, cellValue, index) => {
|
||||
return wmsTaskTypeFormatter(cellValue)
|
||||
}
|
||||
const taskStatusFormat = (row, column, cellValue, index) => {
|
||||
return wmsTaskStatusFormatter(cellValue)
|
||||
}
|
||||
const exportExcel = () => {
|
||||
const params = {
|
||||
goodsId: searchQueryFormEntity.goodsId,
|
||||
vehicleId: searchQueryFormEntity.vehicleId,
|
||||
fromTime: searchQueryFormEntity.fromTime == null ? null : timeFormatter(searchQueryFormEntity.fromTime),
|
||||
toTime: searchQueryFormEntity.toTime == null ? null : timeFormatter(searchQueryFormEntity.toTime),
|
||||
userName: USER_NAME
|
||||
}
|
||||
exportInTaskRecordExcel(params).then(res => {
|
||||
const link = document.createElement('a');//创建a标签
|
||||
try {
|
||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||
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) {
|
||||
console.log(e)
|
||||
ElMessage.error('下载文件失败')
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('导出失败')
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
|
@ -250,34 +305,6 @@ const outsTypeFormat = (row, column, cellValue, index) => {
|
|||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.my-autocomplete li {
|
||||
width: 196px;
|
||||
line-height: normal;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.my-autocomplete li .name {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.my-autocomplete li .addr {
|
||||
font-size: 12px;
|
||||
color: #b4b4b4;
|
||||
}
|
||||
|
||||
.my-autocomplete li .highlighted .addr {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_id {
|
||||
color: brown;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_name {
|
||||
color: cornflowerblue;
|
||||
}
|
||||
|
||||
.btn-search {
|
||||
height: 30px;
|
||||
width: 80px;
|
||||
|
|
|
|||
|
|
@ -1,185 +0,0 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-row style="align-items: center;">
|
||||
<!-- <span>选择库区:</span>
|
||||
<el-select v-model="areaId" placeholder="请选择库区" style="width: 120px;" @change="getAllLocations">
|
||||
<el-option label="3楼库区" :value='1' />
|
||||
<el-option label="2楼库区" :value='2' />
|
||||
</el-select> -->
|
||||
<span style="margin-left: 5px;">状态说明:</span>
|
||||
<el-button color="green">空闲</el-button>
|
||||
<el-button color="red">占用</el-button>
|
||||
<el-button color="yellow">锁定</el-button>
|
||||
<el-button color="#00BFFF" style="margin: 0 0 0 auto;" @click="getAllLocations">刷新</el-button>
|
||||
</el-row>
|
||||
<hr style="border: 1px solid #ff0000" />
|
||||
<div>
|
||||
<el-scrollbar max-height="760px">
|
||||
<div v-for="currentRowLocation in allLocations">
|
||||
<span>第{{ currentRowLocation.row }}排</span>
|
||||
<div class="row" v-for="currentLayerLocation in currentRowLocation.currentLayerLocations">
|
||||
<div class="col" v-for="currentColLocation in currentLayerLocation.currentColLocations">
|
||||
<el-button :color="getLocationStatus(currentColLocation)"
|
||||
@click="showDialog(currentColLocation)">
|
||||
<span style="font-size: 15px;">{{ currentColLocation.queue }}排{{ currentColLocation.line}}列{{ currentColLocation.layer}}层</span>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<hr style="border: 1px solid #000000" />
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
<el-dialog v-model="dialogVisible" :title="currentLocationTitle" width="30%" draggable :show-close="false">
|
||||
<el-form :model="location">
|
||||
<el-form-item label="占用/解除占用库位" :label-width="140">
|
||||
<el-select v-model="location.locationStatus" placeholder="库位是否占用" style="width: 70%;">
|
||||
<el-option label="空闲" :value='0' />
|
||||
<el-option label="占用" :value='1' />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="锁定/解锁库位" :label-width="140">
|
||||
<el-select v-model="location.isLock" placeholder="库位是否锁定" style="width: 70%;">
|
||||
<el-option label="解锁" :value='0' />
|
||||
<el-option label="锁定" :value='1' />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具" :label-width="140">
|
||||
<el-input v-model="location.vehicleId" style="width: 70%;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitLocationStatus()">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { getLocations, updateLocation } from '@/api/location.js'
|
||||
import { ElMessage, ElLoading } from 'element-plus'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { reactive } from 'vue'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'location',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
currentSelectedLocation: {},
|
||||
allLocations: [],
|
||||
location: reactive({
|
||||
locationStatus: '',
|
||||
isLock: '',
|
||||
vehicleId: ''
|
||||
}),
|
||||
currentLocationTitle: '',
|
||||
areaId: 1
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getAllLocations()
|
||||
},
|
||||
methods: {
|
||||
getLocationStatus: (currentColLocation) => {
|
||||
if (currentColLocation.isLock === 1) {
|
||||
return 'yellow'
|
||||
}
|
||||
if (currentColLocation.locationStatus === 1) {
|
||||
return 'red'
|
||||
}
|
||||
return 'green'
|
||||
},
|
||||
getAllLocations() {
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
})
|
||||
const data = { areaId: this.areaId }
|
||||
getLocations(data).then(res => {
|
||||
loading.close()
|
||||
if (res.data.code == 0) {
|
||||
console.log(res.data.returnData)
|
||||
this.allLocations = res.data.returnData
|
||||
} else {
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
loading.close()
|
||||
ElMessage.error('查询库位失败!')
|
||||
})
|
||||
},
|
||||
showDialog(currentColLocation) {
|
||||
this.dialogVisible = true
|
||||
this.currentSelectedLocation = currentColLocation
|
||||
this.setCurrentLocationTitle()
|
||||
this.location.locationStatus = this.currentSelectedLocation.locationStatus
|
||||
this.location.isLock = this.currentSelectedLocation.isLock
|
||||
this.location.vehicleId = this.currentSelectedLocation.vehicleId
|
||||
},
|
||||
submitLocationStatus() {
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
})
|
||||
this.currentSelectedLocation.locationStatus = this.location.locationStatus
|
||||
this.currentSelectedLocation.isLock = this.location.isLock
|
||||
this.currentSelectedLocation.vehicleId = this.location.vehicleId
|
||||
updateLocation(this.currentSelectedLocation).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
loading.close()
|
||||
this.dialogVisible = false
|
||||
ElMessage({
|
||||
message: '更新库位信息成功!',
|
||||
type: 'success',
|
||||
})
|
||||
this.getAllLocations()
|
||||
} else {
|
||||
ElMessage.error(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
loading.close()
|
||||
ElMessage.error('更新库位信息失败')
|
||||
})
|
||||
},
|
||||
setCurrentLocationTitle() {
|
||||
this.currentLocationTitle = '当前选择库位:' + this.currentSelectedLocation.queue + '排' + this.currentSelectedLocation.line + '列' + this.currentSelectedLocation.layer + '层'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.col {
|
||||
/* width: 100px; */
|
||||
/* height: 40px; */
|
||||
padding: 1px;
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
.col .el-button {
|
||||
width: 100px;
|
||||
height: 50px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,200 +1,190 @@
|
|||
<template>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="search-area">
|
||||
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="任务类型">
|
||||
<el-select-v2 v-model="searchQueryFormEntity.taskType" placeholder="任务类型"
|
||||
:options="addAllOptionOfOptions(taskTypeOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务状态">
|
||||
<el-select-v2 v-model="searchQueryFormEntity.taskStatus" placeholder="任务状态"
|
||||
:options="addAllOptionOfOptions(wmsTaskStatusOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="箱号">
|
||||
<el-input v-model="searchQueryFormEntity.vehicleId" @keyup.enter="search()" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="料号">
|
||||
<el-input v-model="searchQueryFormEntity.goodsId" @keyup.enter="search()" clearable />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<div style="align-content: center;">
|
||||
<el-row>
|
||||
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<div class="table-area">
|
||||
<el-table :data="tableData" stripe border v-loading="tableLoading" class="table-class"
|
||||
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||
: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.taskId" v-model="taskId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="taskId" label="任务号" fixed="left" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="taskType" label="任务类型" fixed="left" :formatter="taskTypeFormat" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="taskStatus" label="任务状态" :formatter="taskStatusFormat" fixed="right" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="taskPriority" label="优先级" min-width="120px" sortable="custom"
|
||||
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="料号" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="goodsDesc" label="物料描述"
|
||||
min-width="120px" sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="opNum" label="操作数量" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="stockNum" label="库存数量" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="origin" label="起点" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="destination" label="终点" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="wcsTaskId" label="wcs任务号" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="opUser" label="操作用户" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="remark" label="备注" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="callStand" label="呼叫站台" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip />
|
||||
<!-- <el-table-column fixed="right" label="操作" width="170px">
|
||||
<template v-slot="scope">
|
||||
<div style="display: inline-block; align-content: center;">
|
||||
<el-button type="primary"
|
||||
@click="editCurrentRowFormEntity(scope.row)">编辑</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||
v-model:page-size="baseTableQuery.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="baseTableQuery.total" />
|
||||
</div>
|
||||
<el-dialog v-model="rowEditFlag" title="工作信息" width="40%" draggable :show-close="false">
|
||||
<el-form ref="rowEditFormRef" :model="rowFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="工作编号">
|
||||
<el-input v-model="rowFormEntity.workIndex" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工单号">
|
||||
<el-input v-model="rowFormEntity.workOrder" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="总成号">
|
||||
<el-input v-model="rowFormEntity.productId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成品号">
|
||||
<el-input v-model="rowFormEntity.singleProductId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="料盒号">
|
||||
<el-input v-model="rowFormEntity.boxNo" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="料号">
|
||||
<el-input v-model="rowFormEntity.goodsId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="需求数量">
|
||||
<el-input-number v-model.number="rowFormEntity.needNum" controls-position="right"
|
||||
:min="0" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="已完成数量">
|
||||
<el-input-number v-model.number="rowFormEntity.finishNum" controls-position="right"
|
||||
:min="0" :max="rowFormEntity.needNum" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="已分配数量">
|
||||
<el-input-number v-model.number="rowFormEntity.distributeNum"
|
||||
controls-position="right" :min="0" :max="rowFormEntity.needNum" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="工作状态">
|
||||
<el-select-v2 v-model="rowFormEntity.workStatus" placeholder="请选择工作状态"
|
||||
:options="workStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="缺料状态">
|
||||
<el-select-v2 v-model="rowFormEntity.lackStatus" placeholder="请选择缺料状态"
|
||||
:options="lackStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="search-area">
|
||||
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="锁定状态">
|
||||
<el-select-v2 style="width: 196px;" v-model="searchQueryFormEntity.isLock" placeholder="锁定状态"
|
||||
:options="addAllOptionOfOptions(lockOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="占用状态">
|
||||
<el-select-v2 style="width: 196px;" v-model="searchQueryFormEntity.isOccupy" placeholder="占用状态"
|
||||
:options="addAllOptionOfOptions(occupyOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="库位号">
|
||||
<el-input v-model="searchQueryFormEntity.locationId" @keyup.enter="search()" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="箱号">
|
||||
<el-input v-model="searchQueryFormEntity.vehicleId" @keyup.enter="search()" clearable/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<div style="align-content: center;">
|
||||
<el-row>
|
||||
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<div class="table-area">
|
||||
<el-table :data="tableData" stripe border v-loading="tableLoading" class="table-class"
|
||||
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||
: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.locationId" v-model="locationId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="locationId" label="库位号" fixed="left" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="vehicleId" label="箱号" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="isLock" label="锁定状态" min-width="120px" :formatter="isLockFormat"
|
||||
sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="isOccupy" label="占用状态" :formatter="isOccupyFormat"
|
||||
min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="equipmentId" label="设备号" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="tunnelId" label="巷道号" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="lRow" label="排" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="lCol" label="列"
|
||||
min-width="120px" sortable="custom" show-overflow-tooltip/>
|
||||
<el-table-column prop="lLayer" label="层" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="lDepth" label="深度" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip/>
|
||||
<el-table-column prop="subArea" label="子区域" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<!-- <el-table-column fixed="right" label="操作" width="170px">
|
||||
<template v-slot="scope">
|
||||
<div style="display: inline-block; align-content: center;">
|
||||
<el-button type="primary"
|
||||
@click="editCurrentRowFormEntity(scope.row)">编辑</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<br/>
|
||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||
v-model:page-size="baseTableQuery.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="baseTableQuery.total"/>
|
||||
</div>
|
||||
<el-dialog v-model="rowEditFlag" title="工作信息" width="40%" draggable :show-close="false">
|
||||
<el-form ref="rowEditFormRef" :model="rowFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="工作编号">
|
||||
<el-input v-model="rowFormEntity.workIndex" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工单号">
|
||||
<el-input v-model="rowFormEntity.workOrder" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="总成号">
|
||||
<el-input v-model="rowFormEntity.productId" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成品号">
|
||||
<el-input v-model="rowFormEntity.singleProductId" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="料盒号">
|
||||
<el-input v-model="rowFormEntity.boxNo" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="料号">
|
||||
<el-input v-model="rowFormEntity.goodsId" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="需求数量">
|
||||
<el-input-number v-model.number="rowFormEntity.needNum" controls-position="right"
|
||||
:min="0" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="已完成数量">
|
||||
<el-input-number v-model.number="rowFormEntity.finishNum" controls-position="right"
|
||||
:min="0" :max="rowFormEntity.needNum" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="已分配数量">
|
||||
<el-input-number v-model.number="rowFormEntity.distributeNum"
|
||||
controls-position="right" :min="0" :max="rowFormEntity.needNum" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="工作状态">
|
||||
<el-select-v2 v-model="rowFormEntity.workStatus" placeholder="请选择工作状态"
|
||||
:options="workStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="缺料状态">
|
||||
<el-select-v2 v-model="rowFormEntity.lackStatus" placeholder="请选择缺料状态"
|
||||
:options="lackStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button type="primary" @click="rowEditFlag = false">取消</el-button>
|
||||
<el-button type="success" @click="submitUpdateRow(rowFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { queryTasksByPage } from '@/api/taskQuery.js'
|
||||
import { timeFormatter, wmsTaskTypeFormatter, wmsTaskStatusFormatter } from '@/utils/formatter.js'
|
||||
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { genTableRequest } from '@/utils/generator.js'
|
||||
import { labelPosition } from '@/constant/form.js'
|
||||
import { taskTypeOptions, wmsTaskStatusOptions } from '@/constant/options.js'
|
||||
import { addAllOptionOfOptions } from '@/utils/generator.js'
|
||||
import { loading } from '@/utils/loading'
|
||||
import {timeFormatter} from '@/utils/formatter.js'
|
||||
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||
import {ElMessage} from 'element-plus'
|
||||
import {genTableRequest, addAllOptionOfOptions} from '@/utils/generator.js'
|
||||
import {labelPosition} from '@/constant/form.js'
|
||||
import {loading} from '@/utils/loading'
|
||||
import {queryLocationsByPage} from "@/api/location";
|
||||
import {lockOptions, occupyOptions} from "@/constant/options";
|
||||
|
||||
/**
|
||||
* 常量定义
|
||||
*/
|
||||
|
|
@ -207,259 +197,259 @@ let maxHeight = ref(window.innerHeight * 0.55)
|
|||
let tableLoading = ref(false)
|
||||
let tableData = ref([])
|
||||
let baseTableQuery = reactive({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: new Map([['createTime', true]]),// 按照成品号顺序排序
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: new Map([['lDepth', true], ['lLayer', true], ['lCol', true], ['lRow', true]]),// 按照成品号顺序排序
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
})
|
||||
let searchQueryFormEntity = reactive({
|
||||
vehicleId: '',
|
||||
goodsId: '',
|
||||
taskType: -99,
|
||||
taskStatus: -99
|
||||
locationId: '',
|
||||
vehicleId: '',
|
||||
isLock: -99,
|
||||
isOccupy: -99
|
||||
})
|
||||
let searchQueryFormRef = ref()
|
||||
let rowEditFlag = ref(false)
|
||||
let taskId = ''
|
||||
let locationId = ''
|
||||
let rowEditFormRef = ref()
|
||||
let rowFormEntity = reactive({})
|
||||
/**
|
||||
* 系统方法
|
||||
*/
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
window.addEventListener('resize', resizeHeight)
|
||||
search()
|
||||
})
|
||||
nextTick(() => {
|
||||
window.addEventListener('resize', resizeHeight)
|
||||
search()
|
||||
})
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
nextTick(() => {
|
||||
window.removeEventListener('resize', resizeHeight)
|
||||
})
|
||||
nextTick(() => {
|
||||
window.removeEventListener('resize', resizeHeight)
|
||||
})
|
||||
})
|
||||
const resizeHeight = () => {
|
||||
maxHeight.value = window.innerHeight * 0.55
|
||||
maxHeight.value = window.innerHeight * 0.55
|
||||
}
|
||||
/**
|
||||
* 自定义方法
|
||||
*/
|
||||
// 查询
|
||||
const search = () => {
|
||||
tableLoading.value = true
|
||||
let request = genTableRequest(baseTableQuery)
|
||||
// 设定查询参数
|
||||
request.vehicleId = searchQueryFormEntity.vehicleId.trim()
|
||||
request.goodsId = searchQueryFormEntity.goodsId.trim()
|
||||
request.taskType = searchQueryFormEntity.taskType == -99 ? null : searchQueryFormEntity.taskType
|
||||
request.taskStatus = searchQueryFormEntity.taskStatus == -99 ? null : searchQueryFormEntity.taskStatus
|
||||
queryTasksByPage(request).then((res) => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
const data = response.data
|
||||
if (data != null) {
|
||||
tableData.value = data.lists
|
||||
baseTableQuery.total = data.total
|
||||
} else {
|
||||
tableData.value = []
|
||||
baseTableQuery.total = 0
|
||||
}
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('查询数据异常。')
|
||||
}).finally(() => {
|
||||
tableLoading.value = false
|
||||
})
|
||||
tableLoading.value = true
|
||||
let request = genTableRequest(baseTableQuery)
|
||||
// 设定查询参数
|
||||
request.locationId = searchQueryFormEntity.locationId.trim()
|
||||
request.vehicleId = searchQueryFormEntity.vehicleId.trim()
|
||||
request.isLock = searchQueryFormEntity.isLock === -99 ? null : searchQueryFormEntity.isLock
|
||||
request.isOccupy = searchQueryFormEntity.isOccupy === -99 ? null : searchQueryFormEntity.isOccupy
|
||||
queryLocationsByPage(request).then((res) => {
|
||||
const response = res.data
|
||||
if (response.code === 0) {
|
||||
const data = response.data
|
||||
if (data != null) {
|
||||
tableData.value = data.lists
|
||||
baseTableQuery.total = data.total
|
||||
} else {
|
||||
tableData.value = []
|
||||
baseTableQuery.total = 0
|
||||
}
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('查询数据异常。')
|
||||
}).finally(() => {
|
||||
tableLoading.value = false
|
||||
})
|
||||
}
|
||||
const clearQuery = () => {
|
||||
searchQueryFormEntity.vehicleId = ''
|
||||
searchQueryFormEntity.goodsId = ''
|
||||
searchQueryFormEntity.locationId = ''
|
||||
searchQueryFormEntity.vehicleId = ''
|
||||
}
|
||||
const handleSortChange = (data) => {
|
||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
baseTableQuery.sortBy.delete(data.prop)
|
||||
}
|
||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||
search()
|
||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
baseTableQuery.sortBy.delete(data.prop)
|
||||
}
|
||||
baseTableQuery.sortBy.set(data.prop, data.order.toLowerCase() === 'ascending')
|
||||
search()
|
||||
}
|
||||
const getCurrentRow = (row) => {
|
||||
taskId = row.taskId
|
||||
locationId = row.locationId
|
||||
}
|
||||
const timeFormat = (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
return timeFormatter(cellValue)
|
||||
}
|
||||
const taskTypeFormat = (row, column, cellValue, index) => {
|
||||
return wmsTaskTypeFormatter(cellValue)
|
||||
const isLockFormat = (row, column, cellValue, index) => {
|
||||
return cellValue === 1 ? '已锁定' : '未锁定'
|
||||
}
|
||||
const taskStatusFormat = (row, column, cellValue, index) => {
|
||||
return wmsTaskStatusFormatter(cellValue)
|
||||
const isOccupyFormat = (row, column, cellValue, index) => {
|
||||
return cellValue === 1 ? '占用' : '空闲'
|
||||
}
|
||||
// 编辑弹框
|
||||
const editCurrentRowFormEntity = (row) => {
|
||||
// 设置form值
|
||||
rowFormEntity.workIndex = row.workIndex
|
||||
rowFormEntity.workOrder = row.workOrder
|
||||
rowFormEntity.productId = row.productId
|
||||
rowFormEntity.singleProductId = row.singleProductId
|
||||
rowFormEntity.boxNo = row.boxNo
|
||||
rowFormEntity.goodsId = row.goodsId
|
||||
rowFormEntity.needNum = row.needNum
|
||||
rowFormEntity.distributeNum = row.distributeNum
|
||||
rowFormEntity.finishNum = row.finishNum
|
||||
rowFormEntity.workStatus = row.workStatus
|
||||
rowFormEntity.lackStatus = row.lackStatus
|
||||
// 弹出框
|
||||
rowEditFlag.value = true
|
||||
// 设置form值
|
||||
rowFormEntity.workIndex = row.workIndex
|
||||
rowFormEntity.workOrder = row.workOrder
|
||||
rowFormEntity.productId = row.productId
|
||||
rowFormEntity.singleProductId = row.singleProductId
|
||||
rowFormEntity.boxNo = row.boxNo
|
||||
rowFormEntity.goodsId = row.goodsId
|
||||
rowFormEntity.needNum = row.needNum
|
||||
rowFormEntity.distributeNum = row.distributeNum
|
||||
rowFormEntity.finishNum = row.finishNum
|
||||
rowFormEntity.workStatus = row.workStatus
|
||||
rowFormEntity.lackStatus = row.lackStatus
|
||||
// 弹出框
|
||||
rowEditFlag.value = true
|
||||
}
|
||||
// 关闭当前缺料工作
|
||||
const closeLackWork = (row) => {
|
||||
const request = {
|
||||
workIndex: row.workIndex,
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
const request = {
|
||||
workIndex: row.workIndex,
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
}
|
||||
loading.open('关闭中...')
|
||||
closeCurrentWorks(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
ElMessage.success(response.message)
|
||||
search()
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
loading.open('关闭中...')
|
||||
closeCurrentWorks(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
ElMessage.success(response.message)
|
||||
search()
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('请求异常。')
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('请求异常。')
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
}
|
||||
// 更新当前行数据
|
||||
const submitUpdateRow = (rowFormEntity) => {
|
||||
const request = {
|
||||
workIndex: rowFormEntity.workIndex,
|
||||
distributeNum: rowFormEntity.distributeNum,
|
||||
finishNum: rowFormEntity.finishNum,
|
||||
workStatus: rowFormEntity.workStatus,
|
||||
lackStatus: rowFormEntity.lackStatus,
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
const request = {
|
||||
workIndex: rowFormEntity.workIndex,
|
||||
distributeNum: rowFormEntity.distributeNum,
|
||||
finishNum: rowFormEntity.finishNum,
|
||||
workStatus: rowFormEntity.workStatus,
|
||||
lackStatus: rowFormEntity.lackStatus,
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
}
|
||||
loading.open('更新中...')
|
||||
updateKateWorks(request).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage.success('更新数据成功。')
|
||||
rowEditFlag.value = false
|
||||
search()
|
||||
} else {
|
||||
ElMessage.error('更新数据失败。')
|
||||
}
|
||||
loading.open('更新中...')
|
||||
updateKateWorks(request).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage.success('更新数据成功。')
|
||||
rowEditFlag.value = false
|
||||
search()
|
||||
} else {
|
||||
ElMessage.error('更新数据失败。')
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('更新数据异常。')
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('更新数据异常。')
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.work-area {
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
}
|
||||
|
||||
.search-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 40%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 40%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.table-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 60%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 60%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 5px 5px 5px 5px;
|
||||
margin: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input {
|
||||
width: 196px;
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input-number {
|
||||
width: 196px;
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-select-v2 {
|
||||
width: 196px;
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
margin: 5px 5px 5px 5px;
|
||||
width: inherit;
|
||||
margin: 5px 5px 5px 5px;
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.my-autocomplete li {
|
||||
width: 196px;
|
||||
line-height: normal;
|
||||
padding: 7px;
|
||||
width: 196px;
|
||||
line-height: normal;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.my-autocomplete li .name {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.my-autocomplete li .addr {
|
||||
font-size: 12px;
|
||||
color: #b4b4b4;
|
||||
font-size: 12px;
|
||||
color: #b4b4b4;
|
||||
}
|
||||
|
||||
.my-autocomplete li .highlighted .addr {
|
||||
color: #ddd;
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_id {
|
||||
color: brown;
|
||||
color: brown;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_name {
|
||||
color: cornflowerblue;
|
||||
color: cornflowerblue;
|
||||
}
|
||||
|
||||
.btn-search {
|
||||
height: 30px;
|
||||
width: 80px;
|
||||
margin: auto 5px 5px auto;
|
||||
color: black;
|
||||
height: 30px;
|
||||
width: 80px;
|
||||
margin: auto 5px 5px auto;
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,337 +1,455 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="search-area">
|
||||
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="锁定状态">
|
||||
<el-select-v2 style="width: 196px;" v-model="searchQueryFormEntity.isLock" placeholder="锁定状态"
|
||||
:options="addAllOptionOfOptions(lockOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="占用状态">
|
||||
<el-select-v2 style="width: 196px;" v-model="searchQueryFormEntity.isOccupy" placeholder="占用状态"
|
||||
:options="addAllOptionOfOptions(occupyOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="库位号">
|
||||
<el-input v-model="searchQueryFormEntity.locationId" @keyup.enter="search()" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="箱号">
|
||||
<el-input v-model="searchQueryFormEntity.vehicleId" @keyup.enter="search()" clearable/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<div style="align-content: center;">
|
||||
<el-row>
|
||||
<el-input v-model="standIdQuery" style="width: 158px; margin-right: 10px;" placeholder="站台号"
|
||||
:suffix-icon="Search" />
|
||||
<el-select-v2 v-model="standTypeQuery" style="width: 158px; margin-right: 10px;"
|
||||
placeholder="请选择站台类型" :options="standTypeOptions" @change="search()"></el-select-v2>
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="standList" 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.standId" v-model="standId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="standId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="allowIn" label="允许入库" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="allowOut" label="允许出库" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="isLock" label="锁定" :formatter="isLockFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="standStatus" label="状态" :formatter="standStatusFormat" show-overflow-tooltip
|
||||
min-width="120px" />
|
||||
<el-table-column prop="equipmentId" label="设备号" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="areaId" label="区域" min-width="120px" />
|
||||
<el-table-column prop="standType" label="类型" :formatter="standTypeFormat" min-width="120px" />
|
||||
<el-table-column prop="standIp" label="电脑ip地址" min-width="120px" />
|
||||
<el-table-column prop="outerId" label="外部编号" min-width="120px" />
|
||||
<el-table-column prop="lastUseTime" label="上次使用时间" :formatter="timeFormat" min-width="120px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="pickGoods" label="拣选料号" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="pickVehicle" label="拣选箱号" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="pickTip" label="提示" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="pickVehicleCount" label="站台料箱数量" 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>
|
||||
<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="standFormRef" :model="standFormEntity" :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="站台号" prop="standId">
|
||||
<el-input v-model="standFormEntity.standId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="类型" prop="isLock">
|
||||
<el-select-v2 v-model="standFormEntity.standType" placeholder="请选择类型"
|
||||
:options="standTypeOptions" disabled></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="锁定" prop="isLock">
|
||||
<el-select-v2 v-model="standFormEntity.isLock" placeholder="请选择是否锁定"
|
||||
:options="isLockOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态" prop="standStatus">
|
||||
<el-select-v2 v-model="standFormEntity.standStatus" placeholder="请选择站台状态"
|
||||
:options="standStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="上次使用时间" prop="lastUseTime">
|
||||
<el-input v-model="standFormEntity.lastUseTime" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="站台料箱数量" prop="pickVehicleCount">
|
||||
<el-input-number v-model.number="standFormEntity.pickVehicleCount"
|
||||
controls-position="right" clearable />
|
||||
</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(standFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<div class="table-area">
|
||||
<el-table :data="tableData" stripe border v-loading="tableLoading" class="table-class"
|
||||
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||
: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.locationId" v-model="locationId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="locationId" label="库位号" fixed="left" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="vehicleId" label="箱号" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="isLock" label="锁定状态" min-width="120px" :formatter="isLockFormat"
|
||||
sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="isOccupy" label="占用状态" :formatter="isOccupyFormat"
|
||||
min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="equipmentId" label="设备号" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="tunnelId" label="巷道号" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="lRow" label="排" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="lCol" label="列"
|
||||
min-width="120px" sortable="custom" show-overflow-tooltip/>
|
||||
<el-table-column prop="lLayer" label="层" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="lDepth" label="深度" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip/>
|
||||
<el-table-column prop="subArea" label="子区域" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip/>
|
||||
<!-- <el-table-column fixed="right" label="操作" width="170px">
|
||||
<template v-slot="scope">
|
||||
<div style="display: inline-block; align-content: center;">
|
||||
<el-button type="primary"
|
||||
@click="editCurrentRowFormEntity(scope.row)">编辑</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<br/>
|
||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||
v-model:page-size="baseTableQuery.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="baseTableQuery.total"/>
|
||||
</div>
|
||||
<el-dialog v-model="rowEditFlag" title="工作信息" width="40%" draggable :show-close="false">
|
||||
<el-form ref="rowEditFormRef" :model="rowFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="工作编号">
|
||||
<el-input v-model="rowFormEntity.workIndex" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工单号">
|
||||
<el-input v-model="rowFormEntity.workOrder" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="总成号">
|
||||
<el-input v-model="rowFormEntity.productId" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成品号">
|
||||
<el-input v-model="rowFormEntity.singleProductId" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="料盒号">
|
||||
<el-input v-model="rowFormEntity.boxNo" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="料号">
|
||||
<el-input v-model="rowFormEntity.goodsId" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="需求数量">
|
||||
<el-input-number v-model.number="rowFormEntity.needNum" controls-position="right"
|
||||
:min="0" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="已完成数量">
|
||||
<el-input-number v-model.number="rowFormEntity.finishNum" controls-position="right"
|
||||
:min="0" :max="rowFormEntity.needNum" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="已分配数量">
|
||||
<el-input-number v-model.number="rowFormEntity.distributeNum"
|
||||
controls-position="right" :min="0" :max="rowFormEntity.needNum" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="工作状态">
|
||||
<el-select-v2 v-model="rowFormEntity.workStatus" placeholder="请选择工作状态"
|
||||
:options="workStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="缺料状态">
|
||||
<el-select-v2 v-model="rowFormEntity.lackStatus" placeholder="请选择缺料状态"
|
||||
:options="lackStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button type="primary" @click="rowEditFlag = false">取消</el-button>
|
||||
<el-button type="success" @click="submitUpdateRow(rowFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getStandsByPage, updateStandInfo } from '@/api/stand.js'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'standSettings',
|
||||
data() {
|
||||
return {
|
||||
standList: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
standIdQuery: '',
|
||||
standTypeQuery: -99,
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
standId: '',
|
||||
standFormEntity: reactive({}),
|
||||
standFormRef: ref(),
|
||||
labelPosition: 'top',
|
||||
rules: reactive({}),
|
||||
standTypeOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '入库站台'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '备料站台'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '堆垛机'
|
||||
}
|
||||
],
|
||||
isLockOptions: [
|
||||
{
|
||||
value: 0,
|
||||
label: '未锁定'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '已锁定'
|
||||
},
|
||||
],
|
||||
standStatusOptions: [
|
||||
{
|
||||
value: 0,
|
||||
label: '可用'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '不可用'
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
standId: this.standIdQuery.trim(),
|
||||
standType: this.standTypeQuery == -99 ? null : this.standTypeQuery,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getStandsByPage(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.standList = tableResponse.returnData.lists
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询站台信息错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
standTypeFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 1:
|
||||
return '入库站台'
|
||||
case 2:
|
||||
return '备料站台'
|
||||
case 3:
|
||||
return '堆垛机'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
isLockFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 0:
|
||||
return '未锁定'
|
||||
case 1:
|
||||
return '已锁定'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
standStatusFormat: (row, column, cellValue, index) => {
|
||||
switch (cellValue) {
|
||||
case 0:
|
||||
return '可用'
|
||||
case 1:
|
||||
return '不可用'
|
||||
default:
|
||||
return '未知'
|
||||
}
|
||||
},
|
||||
reset() {
|
||||
this.standIdQuery = ''
|
||||
this.standTypeQuery = -99
|
||||
this.search()
|
||||
},
|
||||
editCurrentRow(row) {
|
||||
this.standId = row.standId
|
||||
this.standFormEntity = {
|
||||
standId: row.standId,
|
||||
standType: row.standType,
|
||||
isLock: row.isLock,
|
||||
standStatus: row.standStatus,
|
||||
lastUseTime: row.lastUseTime,
|
||||
pickVehicleCount: row.pickVehicleCount,
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submitInfo(formData) {
|
||||
const params = {
|
||||
standId: formData.standId,
|
||||
standType: formData.standType,
|
||||
isLock: formData.isLock,
|
||||
standStatus: formData.standStatus,
|
||||
lastUseTime: formData.lastUseTime,
|
||||
pickVehicleCount: formData.pickVehicleCount,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateStandInfo(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('更新站台信息成功。')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('更新站台信息失败。')
|
||||
})
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.standId = row.standId
|
||||
},
|
||||
},
|
||||
import {timeFormatter} from '@/utils/formatter.js'
|
||||
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||
import {ElMessage} from 'element-plus'
|
||||
import {genTableRequest, addAllOptionOfOptions} from '@/utils/generator.js'
|
||||
import {labelPosition} from '@/constant/form.js'
|
||||
import {loading} from '@/utils/loading'
|
||||
import {queryLocationsByPage} from "@/api/location";
|
||||
import {lockOptions, occupyOptions} from "@/constant/options";
|
||||
|
||||
/**
|
||||
* 常量定义
|
||||
*/
|
||||
const STAND_ID = store.getters.getStandId
|
||||
const USER_NAME = store.getters.getUserName
|
||||
/**
|
||||
* 变量定义
|
||||
*/
|
||||
let maxHeight = ref(window.innerHeight * 0.55)
|
||||
let tableLoading = ref(false)
|
||||
let tableData = ref([])
|
||||
let baseTableQuery = reactive({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: new Map([['lDepth', true], ['lLayer', true], ['lCol', true], ['lRow', true]]),// 按照成品号顺序排序
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
})
|
||||
let searchQueryFormEntity = reactive({
|
||||
locationId: '',
|
||||
vehicleId: '',
|
||||
isLock: -99,
|
||||
isOccupy: -99
|
||||
})
|
||||
let searchQueryFormRef = ref()
|
||||
let rowEditFlag = ref(false)
|
||||
let locationId = ''
|
||||
let rowEditFormRef = ref()
|
||||
let rowFormEntity = reactive({})
|
||||
/**
|
||||
* 系统方法
|
||||
*/
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
window.addEventListener('resize', resizeHeight)
|
||||
search()
|
||||
})
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
nextTick(() => {
|
||||
window.removeEventListener('resize', resizeHeight)
|
||||
})
|
||||
})
|
||||
const resizeHeight = () => {
|
||||
maxHeight.value = window.innerHeight * 0.55
|
||||
}
|
||||
/**
|
||||
* 自定义方法
|
||||
*/
|
||||
// 查询
|
||||
const search = () => {
|
||||
tableLoading.value = true
|
||||
let request = genTableRequest(baseTableQuery)
|
||||
// 设定查询参数
|
||||
request.locationId = searchQueryFormEntity.locationId.trim()
|
||||
request.vehicleId = searchQueryFormEntity.vehicleId.trim()
|
||||
request.isLock = searchQueryFormEntity.isLock === -99 ? null : searchQueryFormEntity.isLock
|
||||
request.isOccupy = searchQueryFormEntity.isOccupy === -99 ? null : searchQueryFormEntity.isOccupy
|
||||
queryLocationsByPage(request).then((res) => {
|
||||
const response = res.data
|
||||
if (response.code === 0) {
|
||||
const data = response.data
|
||||
if (data != null) {
|
||||
tableData.value = data.lists
|
||||
baseTableQuery.total = data.total
|
||||
} else {
|
||||
tableData.value = []
|
||||
baseTableQuery.total = 0
|
||||
}
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('查询数据异常。')
|
||||
}).finally(() => {
|
||||
tableLoading.value = false
|
||||
})
|
||||
}
|
||||
const clearQuery = () => {
|
||||
searchQueryFormEntity.locationId = ''
|
||||
searchQueryFormEntity.vehicleId = ''
|
||||
}
|
||||
const handleSortChange = (data) => {
|
||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
baseTableQuery.sortBy.delete(data.prop)
|
||||
}
|
||||
baseTableQuery.sortBy.set(data.prop, data.order.toLowerCase() === 'ascending')
|
||||
search()
|
||||
}
|
||||
const getCurrentRow = (row) => {
|
||||
locationId = row.locationId
|
||||
}
|
||||
const timeFormat = (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
}
|
||||
const isLockFormat = (row, column, cellValue, index) => {
|
||||
return cellValue === 1 ? '已锁定' : '未锁定'
|
||||
}
|
||||
const isOccupyFormat = (row, column, cellValue, index) => {
|
||||
return cellValue === 1 ? '占用' : '空闲'
|
||||
}
|
||||
// 编辑弹框
|
||||
const editCurrentRowFormEntity = (row) => {
|
||||
// 设置form值
|
||||
rowFormEntity.workIndex = row.workIndex
|
||||
rowFormEntity.workOrder = row.workOrder
|
||||
rowFormEntity.productId = row.productId
|
||||
rowFormEntity.singleProductId = row.singleProductId
|
||||
rowFormEntity.boxNo = row.boxNo
|
||||
rowFormEntity.goodsId = row.goodsId
|
||||
rowFormEntity.needNum = row.needNum
|
||||
rowFormEntity.distributeNum = row.distributeNum
|
||||
rowFormEntity.finishNum = row.finishNum
|
||||
rowFormEntity.workStatus = row.workStatus
|
||||
rowFormEntity.lackStatus = row.lackStatus
|
||||
// 弹出框
|
||||
rowEditFlag.value = true
|
||||
}
|
||||
// 关闭当前缺料工作
|
||||
const closeLackWork = (row) => {
|
||||
const request = {
|
||||
workIndex: row.workIndex,
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
}
|
||||
loading.open('关闭中...')
|
||||
closeCurrentWorks(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
ElMessage.success(response.message)
|
||||
search()
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('请求异常。')
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
}
|
||||
// 更新当前行数据
|
||||
const submitUpdateRow = (rowFormEntity) => {
|
||||
const request = {
|
||||
workIndex: rowFormEntity.workIndex,
|
||||
distributeNum: rowFormEntity.distributeNum,
|
||||
finishNum: rowFormEntity.finishNum,
|
||||
workStatus: rowFormEntity.workStatus,
|
||||
lackStatus: rowFormEntity.lackStatus,
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
}
|
||||
loading.open('更新中...')
|
||||
updateKateWorks(request).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage.success('更新数据成功。')
|
||||
rowEditFlag.value = false
|
||||
search()
|
||||
} else {
|
||||
ElMessage.error('更新数据失败。')
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('更新数据异常。')
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
.work-area {
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
}
|
||||
|
||||
.search-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 40%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.table-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 60%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input-number {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-select-v2 {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
margin: 5px 5px 5px 5px;
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
.my-autocomplete li {
|
||||
width: 196px;
|
||||
line-height: normal;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
.my-autocomplete li .name {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
.my-autocomplete li .addr {
|
||||
font-size: 12px;
|
||||
color: #b4b4b4;
|
||||
}
|
||||
|
||||
.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;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
.my-autocomplete li .highlighted .addr {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_id {
|
||||
color: brown;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_name {
|
||||
color: cornflowerblue;
|
||||
}
|
||||
|
||||
.btn-search {
|
||||
height: 30px;
|
||||
width: 80px;
|
||||
margin: auto 5px 5px auto;
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
<el-form-item label="料号">
|
||||
<el-input v-model="searchQueryFormEntity.goodsId" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具号">
|
||||
<el-form-item label="箱号">
|
||||
<el-input v-model="searchQueryFormEntity.vehicleId" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间from">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,76 @@
|
|||
package com.wms_main.model.vo.wms;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 盘点记录Vo
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class InventoryRecordVo {
|
||||
/**
|
||||
* 盘点id
|
||||
*/
|
||||
private String inventoryId;
|
||||
/**
|
||||
* 料号
|
||||
*/
|
||||
private String goodsId;
|
||||
/**
|
||||
* 载具号
|
||||
*/
|
||||
private String vehicleId;
|
||||
/**
|
||||
* 库存数量
|
||||
* 只记录盘点确认时间点
|
||||
*/
|
||||
private Integer stockNum;
|
||||
/**
|
||||
* 确认数量
|
||||
*/
|
||||
private Integer confirmNum;
|
||||
/**
|
||||
* 盘点站台
|
||||
*/
|
||||
private String invStand;
|
||||
/**
|
||||
* 盘点人
|
||||
*/
|
||||
private String invUser;
|
||||
/**
|
||||
* 盘点类型:1:明盘;2:盲盘
|
||||
*/
|
||||
private Integer invType;
|
||||
/**
|
||||
* 盘点状态
|
||||
* 1. 初始化
|
||||
* 2. 已解析
|
||||
* 3. 数量确认
|
||||
* 4. 盘点关闭
|
||||
*/
|
||||
private Integer invStatus;
|
||||
/**
|
||||
* 盘点结果
|
||||
* -1: 盘亏
|
||||
* 0: 正常
|
||||
* 1: 盘盈
|
||||
*/
|
||||
private Integer invResult;
|
||||
/**
|
||||
* 盘点任务创建时间
|
||||
*/
|
||||
private LocalDateTime invCreateTime;
|
||||
/**
|
||||
* 盘点确认时间
|
||||
*/
|
||||
private LocalDateTime invConfirmTime;
|
||||
/**
|
||||
* 这个字段用于合并哪些任务是同一时间下发的
|
||||
*/
|
||||
private String invOrderId;
|
||||
}
|
||||
|
|
@ -1364,16 +1364,25 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
|||
Map<String, Integer> goodsRequireMap = new HashMap<>();
|
||||
// 查找到这个工单下未完成的工作
|
||||
List<TAppWork> workList = appWorkService.list(new LambdaQueryWrapper<TAppWork>()
|
||||
.eq(TAppWork::getWorkOrder, workOrder)
|
||||
.ne(TAppWork::getWorkStatus, 2));
|
||||
.eq(TAppWork::getWorkOrder, workOrder));
|
||||
if (workList == null || workList.isEmpty()) {
|
||||
return goodsRequireMap;
|
||||
}
|
||||
for (TAppWork work : workList) {
|
||||
if (goodsRequireMap.containsKey(work.getGoodsId())) {
|
||||
goodsRequireMap.replace(work.getGoodsId(), goodsRequireMap.get(work.getGoodsId()) + work.getNeedNum() - work.getFinishNum());
|
||||
if (work.getWorkStatus() == 2 && work.getLackStatus() == 0) {
|
||||
// 已完成且不缺料
|
||||
continue;
|
||||
}
|
||||
int remainNeedNum;
|
||||
if (work.getWorkStatus() == 2) {
|
||||
remainNeedNum = work.getNeedNum() - work.getFinishNum();
|
||||
} else {
|
||||
goodsRequireMap.put(work.getGoodsId(), work.getNeedNum() - work.getFinishNum());
|
||||
remainNeedNum = work.getNeedNum() - work.getDistributeNum();
|
||||
}
|
||||
if (goodsRequireMap.containsKey(work.getGoodsId())) {
|
||||
goodsRequireMap.replace(work.getGoodsId(), goodsRequireMap.get(work.getGoodsId()) + remainNeedNum);
|
||||
} else {
|
||||
goodsRequireMap.put(work.getGoodsId(), remainNeedNum);
|
||||
}
|
||||
}
|
||||
return goodsRequireMap;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user