forked from BaoKaiWms/202501-Wms-Kate-Wuxi
1. 报表增加
This commit is contained in:
parent
93731b685e
commit
21c049c91b
|
|
@ -161,4 +161,13 @@ export const requestPrintBoxTags = (params) => {
|
||||||
data: params,
|
data: params,
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
// 删除一条dbs计划
|
||||||
|
export const deleteDbsPlan = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/kate/deleteDbsPlan',
|
||||||
|
method: 'post',
|
||||||
|
data: params,
|
||||||
|
timeout: 5000
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -1 +1,19 @@
|
||||||
import request from "@/http/request";
|
import request from "@/http/request";
|
||||||
|
|
||||||
|
// 删除wms任务
|
||||||
|
export const deleteWmsTask = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/taskOperation/deleteWmsTask',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新wms任务
|
||||||
|
export const updateWmsTask = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/taskOperation/updateWmsTask',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -23,4 +23,20 @@ export const queryOutTaskRecordByPage = (params) => {
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
// 分页查询拣选任务
|
||||||
|
export const queryPickTasksByPage = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/taskQuery/queryPickTasksByPage',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 分页查询出库单
|
||||||
|
export const queryOutsByPage = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/taskQuery/queryOutsByPage',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -240,4 +240,27 @@ export const vehicleStatusOptions = [
|
||||||
value: 9,
|
value: 9,
|
||||||
label: '锁定中'
|
label: '锁定中'
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
// 出库单类型枚举
|
||||||
|
export const outTypeOptions = [
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: '空箱出库'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 2,
|
||||||
|
label: '普通出库'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 4,
|
||||||
|
label: '完整出库'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 5,
|
||||||
|
label: '入库使用'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 9,
|
||||||
|
label: '紧急出库'
|
||||||
|
}
|
||||||
]
|
]
|
||||||
291
dev_wms_client/src/layout/OutsMonitor.vue
Normal file
291
dev_wms_client/src/layout/OutsMonitor.vue
Normal file
|
|
@ -0,0 +1,291 @@
|
||||||
|
<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.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-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="outType" label="任务类型" fixed="left" :formatter="outsTypeFormat" 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="needNum" label="需求数量"
|
||||||
|
min-width="120px" sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="distributeNum" label="已分配数量" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="pickNum" 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="userName" label="用户" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="reason" label="原因" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="requestTime" label="请求时间" :formatter="timeFormat" 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>
|
||||||
|
</div>
|
||||||
|
</el-container>
|
||||||
|
</el-config-provider>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<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 {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'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 常量定义
|
||||||
|
*/
|
||||||
|
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([['requestTime', true]]),// 按照成品号顺序排序
|
||||||
|
standId: STAND_ID,
|
||||||
|
userName: USER_NAME
|
||||||
|
})
|
||||||
|
let searchQueryFormEntity = reactive({
|
||||||
|
vehicleId: '',
|
||||||
|
goodsId: '',
|
||||||
|
outType: -99
|
||||||
|
})
|
||||||
|
let searchQueryFormRef = ref()
|
||||||
|
let taskId = ''
|
||||||
|
/**
|
||||||
|
* 系统方法
|
||||||
|
*/
|
||||||
|
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.vehicleId = searchQueryFormEntity.vehicleId.trim()
|
||||||
|
request.goodsId = searchQueryFormEntity.goodsId.trim()
|
||||||
|
request.out = searchQueryFormEntity.outType === -99 ? null : searchQueryFormEntity.outType
|
||||||
|
queryOutsByPage(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 = ''
|
||||||
|
}
|
||||||
|
const handleSortChange = (data) => {
|
||||||
|
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||||
|
baseTableQuery.sortBy.delete(data.prop)
|
||||||
|
}
|
||||||
|
baseTableQuery.sortBy.set(data.prop, data.order === 'ascending')
|
||||||
|
search()
|
||||||
|
}
|
||||||
|
const getCurrentRow = (row) => {
|
||||||
|
taskId = row.taskId
|
||||||
|
}
|
||||||
|
const timeFormat = (row, column, cellValue, index) => {
|
||||||
|
return timeFormatter(cellValue)
|
||||||
|
}
|
||||||
|
const outsTypeFormat = (row, column, cellValue, index) => {
|
||||||
|
return outTaskTypeFormatter(cellValue)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.content {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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 {
|
||||||
|
margin: 5px 5px 5px 5px;
|
||||||
|
width: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-pagination {
|
||||||
|
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;
|
||||||
|
margin: auto 5px 5px auto;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,237 +1,244 @@
|
||||||
<template>
|
<template>
|
||||||
<el-config-provider :locale="zhCn">
|
<el-config-provider :locale="zhCn">
|
||||||
<el-container class="content">
|
<el-container class="content">
|
||||||
<div class="work-area">
|
<div class="work-area">
|
||||||
<fieldset class="search-area">
|
<fieldset class="search-area">
|
||||||
<el-form ref="dbsQueryFormRef" :model="dbsQueryFormEntity" :label-position="labelPosition"
|
<el-form ref="dbsQueryFormRef" :model="dbsQueryFormEntity" :label-position="labelPosition"
|
||||||
label-width="158px" style="max-width: 100%" status-icon>
|
label-width="158px" style="max-width: 100%" status-icon>
|
||||||
<div style="display: flex;justify-content: space-between;">
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-form-item label="工单号">
|
<el-form-item label="工单号">
|
||||||
<el-input v-model="dbsQueryFormEntity.workOrder" @keyup.enter="search()" clearable />
|
<el-input v-model="dbsQueryFormEntity.workOrder" @keyup.enter="search()" clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="零件号">
|
<el-form-item label="零件号">
|
||||||
<el-input v-model="dbsQueryFormEntity.productId" @keyup.enter="search()" clearable />
|
<el-input v-model="dbsQueryFormEntity.productId" @keyup.enter="search()" clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态">
|
<el-form-item label="状态">
|
||||||
<el-select-v2 v-model="dbsQueryFormEntity.dbsStatus" placeholder="工单状态"
|
<el-select-v2 v-model="dbsQueryFormEntity.dbsStatus" placeholder="工单状态"
|
||||||
:options="addAllOptionOfOptions(dbsStatusOptions)"
|
:options="addAllOptionOfOptions(dbsStatusOptions)"
|
||||||
@change="search()"></el-select-v2>
|
@change="search()"></el-select-v2>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="计划开工日期">
|
<el-form-item label="计划开工日期">
|
||||||
<el-date-picker v-model="dbsQueryFormEntity.planStartDate" type="date"
|
<el-date-picker v-model="dbsQueryFormEntity.planStartDate" type="date"
|
||||||
placeholder="计划开工日期" :shortcuts="shortcuts" style="width: 196px;" clearable />
|
placeholder="计划开工日期" :shortcuts="shortcuts" style="width: 196px;" clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div style="align-content: center;">
|
<div style="align-content: center;">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-button type="primary" class="btn-search" @click="search()">查询</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-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-button style="background-color: #00CED1;" class="btn-search"
|
<el-button style="background-color: #00CED1;" class="btn-search"
|
||||||
@click="openUploadDialog()">导入DBS</el-button>
|
@click="openUploadDialog()">导入DBS
|
||||||
<el-button type="success" class="btn-search"
|
</el-button>
|
||||||
@click="exportExcel()">导出excel</el-button>
|
<el-button type="success" class="btn-search"
|
||||||
</el-row>
|
@click="exportExcel()">导出excel
|
||||||
</div>
|
</el-button>
|
||||||
</div>
|
</el-row>
|
||||||
</el-form>
|
</div>
|
||||||
</fieldset>
|
|
||||||
<div class="table-area">
|
|
||||||
<el-table :data="displayDbs" stripe border v-loading="tableLoading" class="table-class"
|
|
||||||
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow" :row-style="rowStyle"
|
|
||||||
: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.dbsId" v-model="dbsId"> </el-radio>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="workOrder" label="工单" fixed="left" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="productIdOrigin" label="元零件号" fixed="left" min-width="120px"
|
|
||||||
sortable="custom" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="productId" label="零件号" fixed="left" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="testPlanStartDate" label="Test计划开始时间" :formatter="dateFormat"
|
|
||||||
fixed="left" min-width="160px" sortable="custom" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="testPlanFinishDate" label="Test计划完成时间" :formatter="dateFormat"
|
|
||||||
min-width="160px" sortable="custom" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="pntPlanStartDate" label="PNT计划开始时间" :formatter="dateFormat"
|
|
||||||
min-width="170px" sortable="custom" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="pntPlanFinishDate" label="PNT计划完成时间" :formatter="dateFormat"
|
|
||||||
min-width="170px" sortable="custom" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="planProduction" label="计划产量" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="equipmentName" label="设备名称" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="workShift" label="班次" sortable="custom" min-width="120px"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="family" label="Family" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="testNo" label="Test No#" sortable="custom" min-width="120px"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="dbsStatus" label="状态" :formatter="dbsStatusFormat" fixed="right"
|
|
||||||
min-width="120px" sortable="custom" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="workStand" label="工作站台" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="realWorkDate" label="实际工作日期" sortable="custom" :formatter="dateFormat"
|
|
||||||
min-width="140px" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="finishTime" label="完成时间" min-width="120px" :formatter="timeFormat"
|
|
||||||
sortable="custom" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="kittingRemark" label="K料备注" sortable="custom" min-width="120px"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="remark" label="备注" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<!-- <el-table-column fixed="right" label="操作" width="120px">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<el-button plain type="primary" @click="editCurrentRowStock(scope.row)">编辑</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column> -->
|
|
||||||
</el-table>
|
|
||||||
<br />
|
|
||||||
<el-pagination v-model:current-page="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="dialogVisible" title="库存信息" width="40%" draggable :show-close="false">
|
|
||||||
<el-form ref="stockFormRef" :model="stockFormEntity" :label-position="labelPosition"
|
|
||||||
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="库存编号" prop="stockId">
|
|
||||||
<el-input v-model="stockFormEntity.stockId" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="箱号" prop="vehicleId">
|
|
||||||
<el-input v-model="stockFormEntity.vehicleId" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="料号" prop="goodsId">
|
|
||||||
<el-input v-model="stockFormEntity.goodsId" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="料名" prop="goodsName">
|
|
||||||
<el-input v-model="stockFormEntity.goodsName" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="入库数量" prop="totalNum">
|
|
||||||
<el-input-number v-model.number="stockFormEntity.totalNum" controls-position="right"
|
|
||||||
:min="0" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="剩余数量(为0时删除库存)" prop="remainNum">
|
|
||||||
<el-input-number v-model.number="stockFormEntity.remainNum"
|
|
||||||
controls-position="right" :min="0" :max="stockFormEntity.totalNum" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="库位" prop="locationId">
|
|
||||||
<el-input v-model="stockFormEntity.locationId" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="未使用天数" prop="noUseDays">
|
|
||||||
<el-input-number v-model.number="stockFormEntity.noUseDays"
|
|
||||||
controls-position="right" :min="0" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="库存状态" prop="stockStatus">
|
|
||||||
<el-select-v2 v-model="stockFormEntity.stockStatus" placeholder="请选择库存状态"
|
|
||||||
:options="stockStatusOptions"></el-select-v2>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="物料状态" prop="goodsStatus">
|
|
||||||
<el-select-v2 v-model="stockFormEntity.goodsStatus" placeholder="请选择物料状态"
|
|
||||||
:options="goodsStatusOptions"></el-select-v2>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="盘点任务号" prop="inventoryTaskId">
|
|
||||||
<el-input v-model="stockFormEntity.inventoryTaskId" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="是否盘点" prop="isInventory">
|
|
||||||
<el-input v-model="stockFormEntity.isInventory" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="创建时间" prop="createTime">
|
|
||||||
<el-input v-model="stockFormEntity.createTime" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="最近更新时间" prop="lastUpdateTime">
|
|
||||||
<el-input v-model="stockFormEntity.lastUpdateTime" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="最近更新用户" prop="lastUpdateUser">
|
|
||||||
<el-input v-model="stockFormEntity.lastUpdateUser" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<span class="dialog-footer">
|
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
|
||||||
<el-button type="primary" @click="submitStockInfo(stockFormEntity)">
|
|
||||||
确定
|
|
||||||
</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-dialog> -->
|
|
||||||
<el-dialog v-model="showDbsUploadDialog" title="上传DBS" width="40%" draggable :show-close="true">
|
|
||||||
<fieldset class="search-area">
|
|
||||||
<legend>导入dbs</legend>
|
|
||||||
<UploadExcelDbs></UploadExcelDbs>
|
|
||||||
</fieldset>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</el-container>
|
</el-form>
|
||||||
</el-config-provider>
|
</fieldset>
|
||||||
|
<div class="table-area">
|
||||||
|
<el-table :data="displayDbs" stripe border v-loading="tableLoading" class="table-class"
|
||||||
|
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow" :row-style="rowStyle"
|
||||||
|
: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.dbsId" v-model="dbsId"> </el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="workOrder" label="工单" fixed="left" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="productIdOrigin" label="元零件号" fixed="left" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="productId" label="零件号" fixed="left" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="testPlanStartDate" label="Test计划开始时间" :formatter="dateFormat"
|
||||||
|
fixed="left" min-width="160px" sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="testPlanFinishDate" label="Test计划完成时间" :formatter="dateFormat"
|
||||||
|
min-width="160px" sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="pntPlanStartDate" label="PNT计划开始时间" :formatter="dateFormat"
|
||||||
|
min-width="170px" sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="pntPlanFinishDate" label="PNT计划完成时间" :formatter="dateFormat"
|
||||||
|
min-width="170px" sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="planProduction" label="计划产量" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="equipmentName" label="设备名称" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="workShift" label="班次" sortable="custom" min-width="120px"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="family" label="Family" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="testNo" label="Test No#" sortable="custom" min-width="120px"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="dbsStatus" label="状态" :formatter="dbsStatusFormat" fixed="right"
|
||||||
|
min-width="120px" sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="workStand" label="工作站台" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="realWorkDate" label="实际工作日期" sortable="custom" :formatter="dateFormat"
|
||||||
|
min-width="140px" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="finishTime" label="完成时间" min-width="120px" :formatter="timeFormat"
|
||||||
|
sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="kittingRemark" label="K料备注" sortable="custom" min-width="120px"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="remark" label="备注" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column fixed="right" label="操作" width="120px">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<!-- <el-button plain type="primary" @click="editCurrentRowStock(scope.row)">编辑</el-button>-->
|
||||||
|
<el-button plain type="danger" @click="deleteCurrentRow(scope.row)">删除</el-button>
|
||||||
|
</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="dialogVisible" title="库存信息" width="40%" draggable :show-close="false">
|
||||||
|
<el-form ref="stockFormRef" :model="stockFormEntity" :label-position="labelPosition"
|
||||||
|
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="库存编号" prop="stockId">
|
||||||
|
<el-input v-model="stockFormEntity.stockId" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="箱号" prop="vehicleId">
|
||||||
|
<el-input v-model="stockFormEntity.vehicleId" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="料号" prop="goodsId">
|
||||||
|
<el-input v-model="stockFormEntity.goodsId" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="料名" prop="goodsName">
|
||||||
|
<el-input v-model="stockFormEntity.goodsName" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="入库数量" prop="totalNum">
|
||||||
|
<el-input-number v-model.number="stockFormEntity.totalNum" controls-position="right"
|
||||||
|
:min="0" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="剩余数量(为0时删除库存)" prop="remainNum">
|
||||||
|
<el-input-number v-model.number="stockFormEntity.remainNum"
|
||||||
|
controls-position="right" :min="0" :max="stockFormEntity.totalNum" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="库位" prop="locationId">
|
||||||
|
<el-input v-model="stockFormEntity.locationId" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="未使用天数" prop="noUseDays">
|
||||||
|
<el-input-number v-model.number="stockFormEntity.noUseDays"
|
||||||
|
controls-position="right" :min="0" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="库存状态" prop="stockStatus">
|
||||||
|
<el-select-v2 v-model="stockFormEntity.stockStatus" placeholder="请选择库存状态"
|
||||||
|
:options="stockStatusOptions"></el-select-v2>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="物料状态" prop="goodsStatus">
|
||||||
|
<el-select-v2 v-model="stockFormEntity.goodsStatus" placeholder="请选择物料状态"
|
||||||
|
:options="goodsStatusOptions"></el-select-v2>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="盘点任务号" prop="inventoryTaskId">
|
||||||
|
<el-input v-model="stockFormEntity.inventoryTaskId" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否盘点" prop="isInventory">
|
||||||
|
<el-input v-model="stockFormEntity.isInventory" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="创建时间" prop="createTime">
|
||||||
|
<el-input v-model="stockFormEntity.createTime" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="最近更新时间" prop="lastUpdateTime">
|
||||||
|
<el-input v-model="stockFormEntity.lastUpdateTime" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="最近更新用户" prop="lastUpdateUser">
|
||||||
|
<el-input v-model="stockFormEntity.lastUpdateUser" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="submitStockInfo(stockFormEntity)">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog> -->
|
||||||
|
<el-dialog v-model="showDbsUploadDialog" title="上传DBS" width="40%" draggable :show-close="true">
|
||||||
|
<fieldset class="search-area">
|
||||||
|
<legend>导入dbs</legend>
|
||||||
|
<UploadExcelDbs></UploadExcelDbs>
|
||||||
|
</fieldset>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</el-container>
|
||||||
|
</el-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { queryDbsByPage } from '@/api/kateWork.js'
|
import {queryDbsByPage, deleteDbsPlan} from '@/api/kateWork.js'
|
||||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
import {dateFormatter, timeFormatter} from '@/utils/formatter.js'
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import {ElMessage, ElMessageBox} from 'element-plus'
|
||||||
import { genTableRequest, addAllOptionOfOptions } from '@/utils/generator.js'
|
import {genTableRequest, addAllOptionOfOptions} from '@/utils/generator.js'
|
||||||
import { labelPosition, shortcuts } from '@/constant/form'
|
import {labelPosition, shortcuts} from '@/constant/form'
|
||||||
import { dbsStatusOptions } from '@/constant/options'
|
import {dbsStatusOptions} from '@/constant/options'
|
||||||
import UploadExcelDbs from '@/excel/UploadExcelDbs.vue'
|
import UploadExcelDbs from '@/excel/UploadExcelDbs.vue'
|
||||||
import { exportDbsWithExcel } from '@/api/excel'
|
import {exportDbsWithExcel} from '@/api/excel'
|
||||||
|
import {loading} from "@/utils/loading";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 常量定义
|
* 常量定义
|
||||||
*/
|
*/
|
||||||
|
const USER_NAME = store.getters.getUserName
|
||||||
|
const STAND_ID = store.getters.getStandId
|
||||||
/**
|
/**
|
||||||
* 变量定义
|
* 变量定义
|
||||||
*/
|
*/
|
||||||
|
|
@ -239,18 +246,18 @@ let maxHeight = ref(window.innerHeight * 0.55)
|
||||||
let tableLoading = ref(false)
|
let tableLoading = ref(false)
|
||||||
let displayDbs = ref([])
|
let displayDbs = ref([])
|
||||||
let baseTableQuery = reactive({
|
let baseTableQuery = reactive({
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
sortBy: new Map([['workOrder', true]]),// 按照工单顺序排序
|
sortBy: new Map([['workOrder', true]]),// 按照工单顺序排序
|
||||||
standId: store.getters.getStandId,
|
standId: STAND_ID,
|
||||||
userName: store.getters.getUserName
|
userName: USER_NAME
|
||||||
})
|
})
|
||||||
let dbsQueryFormEntity = reactive({
|
let dbsQueryFormEntity = reactive({
|
||||||
workOrder: '',
|
workOrder: '',
|
||||||
productId: '',
|
productId: '',
|
||||||
dbsStatus: -99,
|
dbsStatus: -99,
|
||||||
planStartDate: null
|
planStartDate: null
|
||||||
})
|
})
|
||||||
let dbsQueryFormRef = ref()
|
let dbsQueryFormRef = ref()
|
||||||
let showEbsEditFlag = ref(false)
|
let showEbsEditFlag = ref(false)
|
||||||
|
|
@ -262,262 +269,253 @@ let showDbsUploadDialog = ref(false)
|
||||||
* 系统方法
|
* 系统方法
|
||||||
*/
|
*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
window.addEventListener('resize', resizeHeight)
|
window.addEventListener('resize', resizeHeight)
|
||||||
search()
|
search()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
window.removeEventListener('resize', resizeHeight)
|
window.removeEventListener('resize', resizeHeight)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
const resizeHeight = () => {
|
const resizeHeight = () => {
|
||||||
maxHeight.value = window.innerHeight * 0.55
|
maxHeight.value = window.innerHeight * 0.55
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 自定义方法
|
* 自定义方法
|
||||||
*/
|
*/
|
||||||
// 查询
|
// 查询
|
||||||
const search = () => {
|
const search = () => {
|
||||||
tableLoading.value = true
|
tableLoading.value = true
|
||||||
let request = genTableRequest(baseTableQuery)
|
let request = genTableRequest(baseTableQuery)
|
||||||
// 设定查询参数
|
// 设定查询参数
|
||||||
request.workOrder = dbsQueryFormEntity.workOrder.trim()
|
request.workOrder = dbsQueryFormEntity.workOrder.trim()
|
||||||
request.productId = dbsQueryFormEntity.productId.trim()
|
request.productId = dbsQueryFormEntity.productId.trim()
|
||||||
request.dbsStatus = dbsQueryFormEntity.dbsStatus == -99 ? null : dbsQueryFormEntity.dbsStatus
|
request.dbsStatus = dbsQueryFormEntity.dbsStatus == -99 ? null : dbsQueryFormEntity.dbsStatus
|
||||||
request.planStartDate = dateFormatter(dbsQueryFormEntity.planStartDate)
|
request.planStartDate = dateFormatter(dbsQueryFormEntity.planStartDate)
|
||||||
queryDbsByPage(request).then((res) => {
|
queryDbsByPage(request).then((res) => {
|
||||||
const response = res.data
|
const response = res.data
|
||||||
if (response.code == 0) {
|
if (response.code == 0) {
|
||||||
const data = response.data
|
const data = response.data
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
displayDbs.value = data.lists
|
displayDbs.value = data.lists
|
||||||
baseTableQuery.total = data.total
|
baseTableQuery.total = data.total
|
||||||
} else {
|
} else {
|
||||||
displayDbs.value = []
|
displayDbs.value = []
|
||||||
baseTableQuery.total = 0
|
baseTableQuery.total = 0
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(response.message)
|
ElMessage.error(response.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
ElMessage.error('查询DBS数据异常。')
|
ElMessage.error('查询DBS数据异常。')
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
tableLoading.value = false
|
tableLoading.value = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const clearQuery = () => {
|
const clearQuery = () => {
|
||||||
dbsQueryFormEntity.workOrder = ''
|
dbsQueryFormEntity.workOrder = ''
|
||||||
dbsQueryFormEntity.productId = ''
|
dbsQueryFormEntity.productId = ''
|
||||||
dbsQueryFormEntity.dbsStatus = -99
|
dbsQueryFormEntity.dbsStatus = -99
|
||||||
dbsQueryFormEntity.planStartDate = null
|
dbsQueryFormEntity.planStartDate = null
|
||||||
}
|
}
|
||||||
const dbsStatusFormat = (row, column, cellValue, index) => {
|
const dbsStatusFormat = (row, column, cellValue, index) => {
|
||||||
switch (cellValue) {
|
switch (cellValue) {
|
||||||
case 0:
|
case 0:
|
||||||
return '未开始'
|
return '未开始'
|
||||||
case 1:
|
case 1:
|
||||||
return '已开始'
|
return '已开始'
|
||||||
case 2:
|
case 2:
|
||||||
return '已完成'
|
return '已完成'
|
||||||
default:
|
default:
|
||||||
return '未知状态'
|
return '未知状态'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const dateFormat = (row, column, cellValue, index) => {
|
const dateFormat = (row, column, cellValue, index) => {
|
||||||
return dateFormatter(cellValue)
|
return dateFormatter(cellValue)
|
||||||
}
|
}
|
||||||
const timeFormat = (row, column, cellValue, index) => {
|
const timeFormat = (row, column, cellValue, index) => {
|
||||||
return timeFormatter(cellValue)
|
return timeFormatter(cellValue)
|
||||||
}
|
}
|
||||||
const rowStyle = ({ row, rowIndex }) => {
|
const rowStyle = ({row, rowIndex}) => {
|
||||||
if (row.dbsStatus == 2) {
|
if (row.dbsStatus == 2) {
|
||||||
return { "color": "green" }
|
return {"color": "green"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const handleSortChange = (data) => {
|
const handleSortChange = (data) => {
|
||||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||||
baseTableQuery.sortBy.delete(data.prop)
|
baseTableQuery.sortBy.delete(data.prop)
|
||||||
}
|
}
|
||||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||||
search()
|
search()
|
||||||
}
|
}
|
||||||
const getCurrentRow = (row) => {
|
const getCurrentRow = (row) => {
|
||||||
dbsId = row.dbsId
|
dbsId = row.dbsId
|
||||||
}
|
}
|
||||||
const exportExcel = () => {
|
const exportExcel = () => {
|
||||||
const params = {
|
const params = {
|
||||||
workOrder: dbsQueryFormEntity.workOrder,
|
workOrder: dbsQueryFormEntity.workOrder,
|
||||||
productId: dbsQueryFormEntity.productId,
|
productId: dbsQueryFormEntity.productId,
|
||||||
dbsStatus: dbsQueryFormEntity.dbsStatus == -99 ? null : dbsQueryFormEntity.dbsStatus,
|
dbsStatus: dbsQueryFormEntity.dbsStatus == -99 ? null : dbsQueryFormEntity.dbsStatus,
|
||||||
planStartDate: dateFormatter(dbsQueryFormEntity.planStartDate)
|
planStartDate: dateFormatter(dbsQueryFormEntity.planStartDate)
|
||||||
}
|
}
|
||||||
exportDbsWithExcel(params).then(res => {
|
exportDbsWithExcel(params).then(res => {
|
||||||
const link = document.createElement('a');//创建a标签
|
const link = document.createElement('a');//创建a标签
|
||||||
try {
|
try {
|
||||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||||
let _fileName = 'DBS计划' + dateFormatter(new Date) + '.xlsx'
|
let _fileName = 'DBS计划' + dateFormatter(new Date) + '.xlsx'
|
||||||
link.style.display = 'none'//隐藏
|
link.style.display = 'none'//隐藏
|
||||||
|
|
||||||
// 兼容不同浏览器的URL对象
|
// 兼容不同浏览器的URL对象
|
||||||
const url = window.URL || window.webkitURL || window.moxURL
|
const url = window.URL || window.webkitURL || window.moxURL
|
||||||
link.href = url.createObjectURL(blob)
|
link.href = url.createObjectURL(blob)
|
||||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||||
document.body.appendChild(link)
|
document.body.appendChild(link)
|
||||||
link.click()
|
link.click()
|
||||||
document.body.removeChild(link)
|
document.body.removeChild(link)
|
||||||
url.revokeObjectURL(link.href)//移除url对象
|
url.revokeObjectURL(link.href)//移除url对象
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
ElMessage.error('下载文件失败')
|
ElMessage.error('下载文件失败')
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
ElMessage.error('导出失败')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const editCurrentRowStock = (row) => {
|
|
||||||
this.stockFormEntity = {
|
|
||||||
stockId: row.stockId,
|
|
||||||
locationId: row.locationId,
|
|
||||||
vehicleId: row.vehicleId,
|
|
||||||
stockStatus: row.stockStatus,
|
|
||||||
createTime: row.createTime,
|
|
||||||
lastUpdateTime: row.lastUpdateTime,
|
|
||||||
lastUpdateUser: row.lastUpdateUser,
|
|
||||||
isInventory: row.isInventory,
|
|
||||||
inventoryTaskId: row.inventoryTaskId,
|
|
||||||
noUseDays: row.noUseDays,
|
|
||||||
goodsId: row.goodsId,
|
|
||||||
goodsName: row.goodsName,
|
|
||||||
goodsStatus: row.goodsStatus,
|
|
||||||
remainNum: row.remainNum,
|
|
||||||
totalNum: row.totalNum
|
|
||||||
}
|
}
|
||||||
this.dialogVisible = true
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('导出失败')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
const submitStockInfo = () => {
|
// 删除当前行dbs
|
||||||
|
const deleteCurrentRow = (row) => {
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
'当前操作涉及删除工单计划。\n是否确认',
|
||||||
|
'警告',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
const request = {
|
const request = {
|
||||||
stockId: this.stockFormEntity.stockId,
|
dbsId: row.dbsId,
|
||||||
locationId: this.stockFormEntity.locationId,
|
userName: USER_NAME,
|
||||||
vehicleId: this.stockFormEntity.vehicleId,
|
standId: STAND_ID
|
||||||
stockStatus: this.stockFormEntity.stockStatus,
|
|
||||||
goodsId: this.stockFormEntity.goodsId,
|
|
||||||
goodsStatus: this.stockFormEntity.goodsStatus,
|
|
||||||
remainNum: this.stockFormEntity.remainNum,
|
|
||||||
userName: store.getters.getUserName
|
|
||||||
}
|
}
|
||||||
updateStockInfo(request).then(res => {
|
loading.open('删除中...')
|
||||||
if (res.data.code == 0) {
|
deleteDbsPlan(request).then(res => {
|
||||||
this.dialogVisible = false
|
const response = res.data
|
||||||
ElMessage.success('更新库存成功')
|
if (response.code == 0) {
|
||||||
this.search()
|
ElMessage.success(response.message)
|
||||||
} else {
|
} else {
|
||||||
errorBox(res.data.message)
|
ElMessage.error(response.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
errorBox('更新库存失败')
|
ElMessage.error('删除异常')
|
||||||
|
}).finally(() => {
|
||||||
|
search()
|
||||||
|
loading.close()
|
||||||
})
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
ElMessage.info('操作取消')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
const openUploadDialog = () => {
|
const openUploadDialog = () => {
|
||||||
showDbsUploadDialog.value = true
|
showDbsUploadDialog.value = true
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.content {
|
.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.work-area {
|
.work-area {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
/* padding: 5px; */
|
/* padding: 5px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-area {
|
.search-area {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
min-height: fit-content;
|
min-height: fit-content;
|
||||||
max-height: 40%;
|
max-height: 40%;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
min-width: inherit;
|
min-width: inherit;
|
||||||
border: solid 1px;
|
border: solid 1px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-area {
|
.table-area {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
min-height: fit-content;
|
min-height: fit-content;
|
||||||
max-height: 60%;
|
max-height: 60%;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
min-width: inherit;
|
min-width: inherit;
|
||||||
border: solid 1px;
|
border: solid 1px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item {
|
.el-form-item {
|
||||||
margin: 5px 5px 5px 5px;
|
margin: 5px 5px 5px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item .el-input {
|
.el-form-item .el-input {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item .el-select-v2 {
|
.el-form-item .el-select-v2 {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-class {
|
.table-class {
|
||||||
margin: 5px 5px 5px 5px;
|
margin: 5px 5px 5px 5px;
|
||||||
width: inherit;
|
width: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-pagination {
|
.el-pagination {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li {
|
.my-autocomplete li {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
padding: 7px;
|
padding: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .name {
|
.my-autocomplete li .name {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .addr {
|
.my-autocomplete li .addr {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #b4b4b4;
|
color: #b4b4b4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .highlighted .addr {
|
.my-autocomplete li .highlighted .addr {
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .goods_id {
|
.my-autocomplete li .goods_id {
|
||||||
color: brown;
|
color: brown;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .goods_name {
|
.my-autocomplete li .goods_name {
|
||||||
color: cornflowerblue;
|
color: cornflowerblue;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-search {
|
.btn-search {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
width: 80px;
|
width: 80px;
|
||||||
margin: auto 5px 5px auto;
|
margin: auto 5px 5px auto;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,470 +0,0 @@
|
||||||
<template>
|
|
||||||
<el-config-provider :locale="zhCn">
|
|
||||||
<el-container class="content">
|
|
||||||
<fieldset class="input-area">
|
|
||||||
<legend style="font-size: 25px;">入库界面</legend>
|
|
||||||
<el-form ref="taskInRequestRef" :model="taskInRequestEntity" :label-position="labelPosition"
|
|
||||||
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="22" :offset="1">
|
|
||||||
<el-form-item label="是否入空托" prop="isEmpty">
|
|
||||||
<el-select-v2 v-model="taskInRequestEntity.isEmpty" placeholder="请选择入库类型"
|
|
||||||
:options="stockTypeOptions"
|
|
||||||
@change="autoCompleteEmptyInfo(taskInRequestEntity)"></el-select-v2>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="22" :offset="1">
|
|
||||||
<el-form-item label="箱号" prop="vehicleNo">
|
|
||||||
<el-input v-model="taskInRequestEntity.vehicleNo" ref="vehicleNo" clearable
|
|
||||||
v-on:keyup.tab="detectEndInputVehicleNo(taskInRequestEntity)" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="22" :offset="1">
|
|
||||||
<el-form-item label="零件号" prop="goodsId">
|
|
||||||
<el-input v-model="taskInRequestEntity.goodsId" ref="goodsId" clearable
|
|
||||||
:disabled="disabledEmpty" @blur="queryAndAutoComplete(taskInRequestEntity)" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="22" :offset="1">
|
|
||||||
<el-form-item label="零件名称" prop="goodsName">
|
|
||||||
<el-input v-model="taskInRequestEntity.goodsName" clearable :disabled="disabledEmpty" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="22" :offset="1">
|
|
||||||
<el-form-item label="零件数量" prop="goodsNum">
|
|
||||||
<el-input-number v-model.number="taskInRequestEntity.goodsNum" ref="goodsNum" clearable
|
|
||||||
:disabled="disabledEmpty" controls-position="right" :min="1"
|
|
||||||
@blur="detectEndInputNum(taskInRequestEntity)"></el-input-number>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="22" :offset="1">
|
|
||||||
<el-form-item label="零件重量(千克)" prop="weight">
|
|
||||||
<el-input v-model="taskInRequestEntity.weight" clearable :disabled="disabledEmpty" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="22" :offset="1" v-show="disPlayDateFlag">
|
|
||||||
<el-form-item label="有效期(年)" prop="shelfLife">
|
|
||||||
<!-- // TODO 日期 -->
|
|
||||||
<el-input v-model="taskInRequestEntity.shelfLife" clearable :disabled="disabledEmpty" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="22" :offset="1" v-show="disPlayDateFlag">
|
|
||||||
<el-form-item label="生产日期" prop="productionDate">
|
|
||||||
<el-date-picker v-model="taskInRequestEntity.productionDate" ref="productionDate"
|
|
||||||
:disabled="disabledEmpty" style="width: 100%;height: 75px;" type="date"
|
|
||||||
placeholder="请选择生产日期" :editable="false" size="large" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="11" :offset="1">
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" round
|
|
||||||
@click="addTempTasks(taskInRequestRef, taskInRequestEntity)">绑定信息</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="warning" round
|
|
||||||
@click="callEmptyVehicles(taskInRequestEntity)">请求空箱</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</fieldset>
|
|
||||||
<div ref="btnArea"></div>
|
|
||||||
<fieldset class="display-area">
|
|
||||||
<legend style="font-size: 25px;">
|
|
||||||
入库暂存信息
|
|
||||||
</legend>
|
|
||||||
<el-table :data="tempTasks" stripe border class="table-class" max-height="684px"
|
|
||||||
:header-cell-style="{ 'text-align': 'center', 'height': '100px' }"
|
|
||||||
:cell-style="{ 'text-align': 'center' }">
|
|
||||||
<el-table-column prop="vehicleNo" label="箱号" fixed="left" min-width="1rem" />
|
|
||||||
<el-table-column prop="goodsId" label="零件号" fixed="left" min-width="1rem" />
|
|
||||||
<el-table-column prop="goodsNum" label="数量" min-width="1rem" />
|
|
||||||
<el-table-column prop="goodsName" label="零件名称" min-width="1rem" />
|
|
||||||
<el-table-column prop="weight" label="重量" min-width="1rem" />
|
|
||||||
<el-table-column fixed="right" label="操作" min-width="1rem">
|
|
||||||
<template #default>
|
|
||||||
<el-button style="width: 1rem;" plain type="primary"
|
|
||||||
@click="deleteRowTask(row)">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<br />
|
|
||||||
<el-row :gutter="4">
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="success" round
|
|
||||||
@click="submitGoodsInTask(taskInRequestEntity)">下发任务</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</fieldset>
|
|
||||||
</el-container>
|
|
||||||
</el-config-provider>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import store from '@/store'
|
|
||||||
import { sendGoodsInTask, callEmptyVehicle } from '@/api/task'
|
|
||||||
import { queryPartInfoByPartNo } from '@/api/goods'
|
|
||||||
import { reactive, ref } from 'vue'
|
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
import { errorBox } from '@/utils/myMessageBox.js'
|
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
|
||||||
import UploadExcelPart from '@/excel/UploadExcelPart.vue'
|
|
||||||
const taskInRequestRef = ref()
|
|
||||||
const taskInRequestEntity = reactive({
|
|
||||||
vehicleNo: '',// 载具号
|
|
||||||
goodsId: '',// 零件号
|
|
||||||
goodsName: '',// 零件名称
|
|
||||||
goodsNum: 1,// 零件数量
|
|
||||||
weight: 0,// 零件重量
|
|
||||||
shelfLife: 0,// 有效期
|
|
||||||
productionDate: '',// 生产日期
|
|
||||||
isEmpty: '1',
|
|
||||||
userName: store.getters.getUserName// 用户名
|
|
||||||
})
|
|
||||||
const rules = reactive({
|
|
||||||
vehicleNo: [
|
|
||||||
{ required: true, message: '请输入载具编号' }
|
|
||||||
],
|
|
||||||
goodsId: [
|
|
||||||
{ required: true, message: '请输入物料编号' }
|
|
||||||
],
|
|
||||||
goodsNum: [
|
|
||||||
{ required: true, message: '请输入数量' },
|
|
||||||
{ type: 'number', message: '请输入数字' }
|
|
||||||
]
|
|
||||||
})
|
|
||||||
const labelPosition = "top"
|
|
||||||
const displayWidth = window.screen.width
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'goodsInPda',
|
|
||||||
components: {
|
|
||||||
UploadExcelPart
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
tempTasks: [],
|
|
||||||
tempVehicleNo: '',
|
|
||||||
disPlayDateFlag: false,
|
|
||||||
currentPartInfo: {},
|
|
||||||
stockTypeOptions: [
|
|
||||||
{
|
|
||||||
value: '0',
|
|
||||||
label: '空箱入库'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: '1',
|
|
||||||
label: '带料入库'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
disabledEmpty: false,
|
|
||||||
totalWeight: 0,
|
|
||||||
isOverWeight: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$refs.vehicleNo.focus()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 查询
|
|
||||||
queryAndAutoComplete(taskInRequestEntity) {
|
|
||||||
this.loading = true
|
|
||||||
const param = { material: taskInRequestEntity.goodsId }
|
|
||||||
queryPartInfoByPartNo(param).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
if (res.data.code == 0) {
|
|
||||||
this.currentPartInfo = res.data.returnData
|
|
||||||
taskInRequestEntity.goodsName = this.currentPartInfo.itemDesc
|
|
||||||
this.calWeight(taskInRequestEntity)
|
|
||||||
if (this.currentPartInfo.SLED > 0) {// 判断生产日期区域显示与否
|
|
||||||
this.disPlayDateFlag = true
|
|
||||||
taskInRequestEntity.shelfLife = this.currentPartInfo.SLED
|
|
||||||
} else {
|
|
||||||
this.disPlayDateFlag = false
|
|
||||||
taskInRequestEntity.shelfLife = 0
|
|
||||||
taskInRequestEntity.productionDate = ''
|
|
||||||
}
|
|
||||||
taskInRequestEntity.goodsNum = ''
|
|
||||||
this.$refs.goodsNum.focus()
|
|
||||||
} else {
|
|
||||||
taskInRequestEntity.goodsName = ''
|
|
||||||
taskInRequestEntity.goodsNum = ''
|
|
||||||
taskInRequestEntity.weight = 0
|
|
||||||
this.disPlayDateFlag = false
|
|
||||||
taskInRequestEntity.shelfLife = 0
|
|
||||||
taskInRequestEntity.productionDate = ''
|
|
||||||
ElMessage.error(res.data.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
taskInRequestEntity.goodsName = ''
|
|
||||||
taskInRequestEntity.goodsNum = ''
|
|
||||||
taskInRequestEntity.weight = 0
|
|
||||||
this.disPlayDateFlag = false
|
|
||||||
taskInRequestEntity.shelfLife = 0
|
|
||||||
taskInRequestEntity.productionDate = ''
|
|
||||||
ElMessage.error('查询物料信息错误' + err.message)
|
|
||||||
})
|
|
||||||
this.loading = false
|
|
||||||
},
|
|
||||||
calWeight(taskInRequestEntity) {
|
|
||||||
taskInRequestEntity.weight = this.currentPartInfo.partWeight * taskInRequestEntity.goodsNum
|
|
||||||
this.totalWeight = this.totalWeight + taskInRequestEntity.weight
|
|
||||||
if (this.totalWeight > 30) {
|
|
||||||
this.isOverWeight = true
|
|
||||||
ElMessage({
|
|
||||||
message: '箱子重量超过30kg',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
autoCompleteEmptyInfo(taskInRequestEntity) {// 自动补全空托入库信息
|
|
||||||
if (taskInRequestEntity.isEmpty == '0') {// 空托入库
|
|
||||||
taskInRequestEntity.goodsId = '000000000'
|
|
||||||
taskInRequestEntity.batchNo = '000000000'
|
|
||||||
taskInRequestEntity.goodsNum = 1
|
|
||||||
taskInRequestEntity.weight = 0
|
|
||||||
taskInRequestEntity.shelfLife = 0
|
|
||||||
taskInRequestEntity.productionDate = ''
|
|
||||||
taskInRequestEntity.goodsName = '空箱'
|
|
||||||
this.currentPartInfo = {}
|
|
||||||
this.disabledEmpty = true
|
|
||||||
this.disPlayDateFlag = false
|
|
||||||
} else {
|
|
||||||
taskInRequestEntity.goodsId = ''
|
|
||||||
taskInRequestEntity.batchNo = ''
|
|
||||||
taskInRequestEntity.goodsNum = 1
|
|
||||||
this.disabledEmpty = false
|
|
||||||
}
|
|
||||||
this.$refs.vehicleNo.focus()
|
|
||||||
|
|
||||||
},
|
|
||||||
addTempTasks(formEl, formData) {// 生成入库任务
|
|
||||||
if (!formEl) return
|
|
||||||
formEl.validate((valid) => {
|
|
||||||
if (!valid) {
|
|
||||||
ElMessage({
|
|
||||||
message: '请输入必须的入库信息!',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (this.tempVehicleNo !== '' && this.tempVehicleNo !== formData.vehicleNo) {
|
|
||||||
ElMessage({
|
|
||||||
message: '载具编号不一致,请确认后重新输入!',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (this.tempVehicleNo != '' && formData.isEmpty == '0') {
|
|
||||||
ElMessage({
|
|
||||||
message: '此箱子已经绑定过,请下发。',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (this.isOverWeight) {
|
|
||||||
ElMessage({
|
|
||||||
message: '已超重,不可继续绑定,请移除此物料,并下发任务',
|
|
||||||
type: 'error',
|
|
||||||
showClose: true
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.tempVehicleNo = formData.vehicleNo
|
|
||||||
formData.userName = store.getters.getUserName
|
|
||||||
const sameIndex = this.tempTasks.findIndex(task => task.goodsId == formData.goodsId)
|
|
||||||
if (sameIndex != -1) {// 绑定过相同物料
|
|
||||||
var sameGoods = this.tempTasks[sameIndex]
|
|
||||||
sameGoods.goodsNum = sameGoods.goodsNum + formData.goodsNum
|
|
||||||
sameGoods.weight = sameGoods.weight + formData.weight
|
|
||||||
} else {
|
|
||||||
this.tempTasks.push(Object.assign({}, formData))
|
|
||||||
}
|
|
||||||
this.resetFields(formData)
|
|
||||||
formData.vehicleNo = this.tempVehicleNo
|
|
||||||
ElMessage({
|
|
||||||
message: '绑定成功!',
|
|
||||||
type: 'success',
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
submitGoodsInTask(taskInRequestEntity) {// 下发入库任务
|
|
||||||
if (this.tempTasks.length == 0) {
|
|
||||||
ElMessage.error("未绑定任何信息")
|
|
||||||
}
|
|
||||||
sendGoodsInTask(this.tempTasks).then(res => {
|
|
||||||
if (res.data.code == 0) {
|
|
||||||
this.tempTasks = []
|
|
||||||
this.tempVehicleNo = ''
|
|
||||||
this.resetFields(taskInRequestEntity)
|
|
||||||
this.totalWeight = 0
|
|
||||||
this.isOverWeight = false
|
|
||||||
ElMessage({
|
|
||||||
message: '下发任务成功,剩余库位可用数量: ' + res.data.returnData,
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
this.$refs.vehicleNo.focus()
|
|
||||||
} else {
|
|
||||||
ElMessage.error(res.data.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
ElMessage.error('创建入库任务错误!' + err.message)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
resetFields(taskInRequestEntity) {
|
|
||||||
taskInRequestEntity.vehicleNo = ''
|
|
||||||
if (taskInRequestEntity.isEmpty != '0') {// 不是空托入库
|
|
||||||
taskInRequestEntity.goodsId = ''
|
|
||||||
taskInRequestEntity.goodsName = ''
|
|
||||||
taskInRequestEntity.goodsNum = 1
|
|
||||||
taskInRequestEntity.weight = 0
|
|
||||||
taskInRequestEntity.shelfLife = 0
|
|
||||||
taskInRequestEntity.productionDate = ''
|
|
||||||
}
|
|
||||||
this.disPlayDateFlag = false
|
|
||||||
this.currentPartInfo = {}
|
|
||||||
},
|
|
||||||
callEmptyVehicles(taskInRequestEntity) {
|
|
||||||
callEmptyVehicle(taskInRequestEntity).then(res => {
|
|
||||||
if (res.data.code == 0) {
|
|
||||||
ElMessage({
|
|
||||||
message: res.data.message,
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
ElMessage.error(res.data.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
ElMessage.error('呼叫空箱错误' + err.message)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
deleteRowTask(row) {// 删除当前行的入库任务
|
|
||||||
this.tempTasks.splice(this.tempTasks.indexOf(row), 1)
|
|
||||||
if (this.tempTasks.length == 0) {
|
|
||||||
this.tempVehicleNo = ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
detectEndInputVehicleNo(taskInRequestEntity) {
|
|
||||||
if (taskInRequestEntity.isEmpty == '0') {// 空托入库
|
|
||||||
this.$refs.btnArea.scrollIntoView();
|
|
||||||
// this.$refs.vehicleNo.blur()
|
|
||||||
} else {
|
|
||||||
this.$refs.goodsId.focus()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
detectEndInputNum(taskInRequestEntity) {
|
|
||||||
this.calWeight(taskInRequestEntity)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.content {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
width: v-bind(displayWidth);
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-row {
|
|
||||||
margin: 20px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-form-item__label) {
|
|
||||||
font-size: 25px;
|
|
||||||
/* margin: 10px; */
|
|
||||||
padding: 10px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-select-v2__placeholder) {
|
|
||||||
font-size: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-select-v2__wrapper) {
|
|
||||||
height: 80px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-form-item .el-input) {
|
|
||||||
height: 80px;
|
|
||||||
font-size: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-form-item .el-input-number) {
|
|
||||||
height: 80px;
|
|
||||||
font-size: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-table .cell) {
|
|
||||||
line-height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-row .el-form-item {
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-row .el-form-item .el-select {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-row .el-form-item .el-select-v2 {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-row .el-form-item .el-input-number {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-row .el-form-item .el-button {
|
|
||||||
width: 180px;
|
|
||||||
height: 60px;
|
|
||||||
margin: auto;
|
|
||||||
font-size: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input-area {
|
|
||||||
margin: 10px;
|
|
||||||
width: v-bind(displayWidth) - 20px;
|
|
||||||
/* height: 730px; */
|
|
||||||
border: solid 1px;
|
|
||||||
border-radius: 10px;
|
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.display-area {
|
|
||||||
margin: 10px;
|
|
||||||
width: v-bind(displayWidth) - 20px;
|
|
||||||
/* height: auto; */
|
|
||||||
border: solid 1px;
|
|
||||||
border-radius: 10px;
|
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-class {
|
|
||||||
width: 100%;
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,388 +0,0 @@
|
||||||
<template>
|
|
||||||
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
|
||||||
<el-config-provider :locale="zhCn">
|
|
||||||
<div style="display: flex;justify-content: space-between;">
|
|
||||||
<el-row>
|
|
||||||
<el-input v-model="workOrderQuery" style="width: 256px; margin-right: 10px;" placeholder="工单"
|
|
||||||
:suffix-icon="Search" />
|
|
||||||
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号"
|
|
||||||
:suffix-icon="Search" />
|
|
||||||
<el-input v-model="smallBoxQuery" style="width: 256px; margin-right: 10px;" placeholder="小工位"
|
|
||||||
:suffix-icon="Search" />
|
|
||||||
<el-button type="primary" @click="search()">搜索</el-button>
|
|
||||||
<el-button type="warning" @click="reset()">重置</el-button>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-button style="background-color: #00CED1; color: #000;"
|
|
||||||
@click="openUploadDialog()">导入</el-button>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
|
||||||
<br />
|
|
||||||
<el-table :data="ordersList" 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.orderId" v-model="orderId"> </el-radio>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="orderId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="workOrder" label="工单" fixed="left" min-width="120px" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="goodsId" label="料号" min-width="120px" />
|
|
||||||
<el-table-column prop="supplyArea" label="小工位" fixed="left" min-width="120px" />
|
|
||||||
<el-table-column prop="item" label="Item" min-width="120px" />
|
|
||||||
<el-table-column prop="description" label="描述" min-width="120px" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="sLoc" label="SLoc" min-width="120px" />
|
|
||||||
<el-table-column prop="type" label="Type" min-width="120px" />
|
|
||||||
<el-table-column prop="originStatus" label="Status" min-width="120px" />
|
|
||||||
<el-table-column prop="sortString" label="SortStrng" min-width="120px" />
|
|
||||||
<el-table-column prop="requirementQuantity" label="需求数量" sortable min-width="120px" />
|
|
||||||
<el-table-column prop="goodsUnit" label="单位" min-width="120px" />
|
|
||||||
<el-table-column prop="orderStatus" label="状态" min-width="120px" />
|
|
||||||
<el-table-column prop="lackQuantity" label="缺少数量" min-width="120px" />
|
|
||||||
<el-table-column prop="pickedQuantity" label="已拣数量" min-width="120px" />
|
|
||||||
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="userName" label="操作人员" min-width="120px" />
|
|
||||||
<el-table-column fixed="right" label="操作" width="240px">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<el-button plain type="primary" @click="editCurrentRowOrders(scope.row)">编辑</el-button>
|
|
||||||
<el-button plain type="danger" @click="deleteCurrentRowOrders(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="ordersFormRef" :model="ordersFormEntity" :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="orderId">
|
|
||||||
<el-input v-model="ordersFormEntity.orderId" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="工单" prop="workOrder">
|
|
||||||
<el-input v-model="ordersFormEntity.workOrder" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="小工位" prop="supplyArea">
|
|
||||||
<el-input v-model="ordersFormEntity.supplyArea" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="料号" prop="goodsId">
|
|
||||||
<el-input v-model="ordersFormEntity.goodsId" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="需求数量" prop="requirementQuantity">
|
|
||||||
<el-input-number v-model.number="ordersFormEntity.requirementQuantity"
|
|
||||||
controls-position="right" :min="0" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="状态" prop="orderStatus">
|
|
||||||
<el-input-number v-model.number="ordersFormEntity.orderStatus"
|
|
||||||
controls-position="right" :min="0" :max="4" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="缺少数量" prop="lackQuantity">
|
|
||||||
<el-input-number v-model.number="ordersFormEntity.lackQuantity"
|
|
||||||
controls-position="right" :min="0" :max="ordersFormEntity.requirementQuantity" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="已拣数量" prop="pickedQuantity">
|
|
||||||
<el-input-number v-model.number="ordersFormEntity.pickedQuantity"
|
|
||||||
controls-position="right" :min="0" :max="ordersFormEntity.requirementQuantity" 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="submitOrdersInfo(ordersFormEntity)">
|
|
||||||
确定
|
|
||||||
</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
<el-dialog v-model="uploadDialogVisible" title="工单" width="40%" draggable :show-close="true">
|
|
||||||
<fieldset class="title-area">
|
|
||||||
<legend>上次更新</legend>
|
|
||||||
<div style="padding: 5px;">
|
|
||||||
<div style="display: flex; margin-bottom: 10px;">
|
|
||||||
<div style="display: flex; width: 100%;">
|
|
||||||
<div style="width: 30%; align-content: center;">时间:</div>
|
|
||||||
<el-input v-model="uploadRecord.uploadTime" readonly />
|
|
||||||
</div>
|
|
||||||
<div style="display: flex; width: 100%; margin-left: 5px;">
|
|
||||||
<div style="width: 30%; align-content: center;">人员:</div>
|
|
||||||
<el-input v-model="uploadRecord.uploadUser" readonly />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="display: flex; width: 100%;">
|
|
||||||
<div style="width: 13%; align-content: center;">文件名:</div>
|
|
||||||
<el-input type="textarea" :rows="1" v-model="uploadRecord.fileName" :maxlength="-1"
|
|
||||||
:show-word-limit="false" :autosize="{ minRows: 1, maxRows: 4 }" readonly>
|
|
||||||
</el-input>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
<fieldset class="title-area">
|
|
||||||
<legend>再次更新</legend>
|
|
||||||
<UploadExcelOrders></UploadExcelOrders>
|
|
||||||
</fieldset>
|
|
||||||
</el-dialog>
|
|
||||||
</el-config-provider>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import store from '@/store'
|
|
||||||
import { getOrders, deleteOrders, updateOrders } from '@/api/kateWork.js'
|
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
|
||||||
import { errorBox } from '@/utils/myMessageBox.js'
|
|
||||||
import { ref, reactive } from 'vue'
|
|
||||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
|
||||||
import { queryUploadRecord } from '@/api/excel.js'
|
|
||||||
import { Search } from '@element-plus/icons-vue'
|
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'kateOrders',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
ordersList: [],
|
|
||||||
currentPage: 1,
|
|
||||||
uploadRecord: reactive({
|
|
||||||
fileName: '',
|
|
||||||
uploadTime: '',
|
|
||||||
uploadUser: ''
|
|
||||||
}),
|
|
||||||
pageSize: 10,
|
|
||||||
total: 0,
|
|
||||||
workOrderQuery: '',
|
|
||||||
goodsIdQuery: '',
|
|
||||||
smallBoxQuery: '',
|
|
||||||
loading: true,
|
|
||||||
dialogVisible: false,
|
|
||||||
uploadDialogVisible: false,
|
|
||||||
orderId: '',
|
|
||||||
ordersFormEntity: reactive({}),
|
|
||||||
labelPosition: 'top',
|
|
||||||
ordersFormRef: ref(),
|
|
||||||
rules: reactive({})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.search()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
search() {
|
|
||||||
this.loading = true
|
|
||||||
const request = {
|
|
||||||
pageNo: this.currentPage,
|
|
||||||
pageSize: this.pageSize,
|
|
||||||
workOrder: this.workOrderQuery.trim(),
|
|
||||||
goodsId: this.goodsIdQuery.trim(),
|
|
||||||
supplyArea: this.smallBoxQuery.trim(),
|
|
||||||
userName: store.getters.getUserName
|
|
||||||
}
|
|
||||||
getOrders(request).then(res => {
|
|
||||||
const tableResponse = res.data
|
|
||||||
if (tableResponse.code == 0) {
|
|
||||||
this.ordersList = 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)
|
|
||||||
},
|
|
||||||
reset() {
|
|
||||||
this.workOrderQuery = ''
|
|
||||||
this.goodsIdQuery = ''
|
|
||||||
this.smallBoxQuery = ''
|
|
||||||
this.search()
|
|
||||||
},
|
|
||||||
editCurrentRowOrders(row) {
|
|
||||||
this.orderId = row.orderId
|
|
||||||
this.ordersFormEntity = {
|
|
||||||
orderId: row.orderId,
|
|
||||||
workOrder: row.workOrder,
|
|
||||||
goodsId: row.goodsId,
|
|
||||||
supplyArea: row.supplyArea,
|
|
||||||
requirementQuantity: row.requirementQuantity,
|
|
||||||
orderStatus: row.orderStatus,
|
|
||||||
lackQuantity: row.lackQuantity,
|
|
||||||
pickedQuantity: row.pickedQuantity
|
|
||||||
}
|
|
||||||
this.dialogVisible = true
|
|
||||||
},
|
|
||||||
deleteCurrentRowOrders(row) {
|
|
||||||
this.orderId = row.orderId
|
|
||||||
ElMessageBox.confirm(
|
|
||||||
'该操作会删除选择的工单数据。\n是否继续',
|
|
||||||
'警告',
|
|
||||||
{
|
|
||||||
confirmButtonText: '确认',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
}
|
|
||||||
).then(() => {
|
|
||||||
const params = {
|
|
||||||
orderId: this.orderId,
|
|
||||||
userName: store.getters.getUserName
|
|
||||||
}
|
|
||||||
deleteOrders(params).then(res => {
|
|
||||||
if (res.data.code == 0) {
|
|
||||||
ElMessage.success('删除工单信息成功。')
|
|
||||||
this.search()
|
|
||||||
} else {
|
|
||||||
errorBox(res.data.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
errorBox('删除工单信息成功')
|
|
||||||
})
|
|
||||||
}).catch(() => {
|
|
||||||
ElMessage.info('操作取消')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
submitOrdersInfo(formData) {
|
|
||||||
const params = {
|
|
||||||
orderId: formData.orderId,
|
|
||||||
workOrder: formData.workOrder,
|
|
||||||
goodsId: formData.goodsId,
|
|
||||||
supplyArea: formData.supplyArea,
|
|
||||||
requirementQuantity: formData.requirementQuantity,
|
|
||||||
orderStatus: formData.orderStatus,
|
|
||||||
lackQuantity: formData.lackQuantity,
|
|
||||||
pickedQuantity: formData.pickedQuantity,
|
|
||||||
userName: store.getters.getUserName
|
|
||||||
}
|
|
||||||
updateOrders(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.orderId = row.orderId
|
|
||||||
},
|
|
||||||
openUploadDialog() {
|
|
||||||
// 请求上传记录
|
|
||||||
const param = {
|
|
||||||
userName: store.getters.getUserName,
|
|
||||||
fileDescription: 'ORDERS',
|
|
||||||
isAsc: false,
|
|
||||||
sortBy: 'upload_time'
|
|
||||||
}
|
|
||||||
queryUploadRecord(param).then(res => {
|
|
||||||
if (res.data.code == 0) {
|
|
||||||
if (res.data.returnData.total > 0) {
|
|
||||||
this.uploadRecord = res.data.returnData.lists[0]
|
|
||||||
} else {
|
|
||||||
this.uploadRecord = reactive({
|
|
||||||
fileName: '',
|
|
||||||
uploadTime: '',
|
|
||||||
uploadUser: ''
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.uploadRecord = reactive({
|
|
||||||
fileName: '',
|
|
||||||
uploadTime: '',
|
|
||||||
uploadUser: ''
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
errorBox('发生异常')
|
|
||||||
})
|
|
||||||
this.uploadDialogVisible = true
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.el-pagination {
|
|
||||||
padding-left: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-row .el-button {
|
|
||||||
width: 72px;
|
|
||||||
margin-left: 0px;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-class {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-row .el-form-item {
|
|
||||||
width: 10% inherit;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-row .el-form-item .el-select-v2 {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-row .el-form-item .el-input-number {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-row .el-form-item .el-button {
|
|
||||||
margin: 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;
|
|
||||||
flex-direction: column;
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,293 +1,282 @@
|
||||||
<template>
|
<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;">
|
<div style="display: flex;justify-content: space-between;">
|
||||||
|
<el-row>
|
||||||
|
<el-form-item label="任务状态">
|
||||||
|
<el-select-v2 v-model="searchQueryFormEntity.pickStatus" placeholder="任务状态"
|
||||||
|
:options="addAllOptionOfOptions(pickingTaskStatusOptions)"
|
||||||
|
@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.pickStand" @keyup.enter="search()" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
<div style="align-content: center;">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-input v-model="vehicleIdQuery" style="width: 158px; margin-right: 10px;" placeholder="箱号"
|
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||||
:suffix-icon="Search" />
|
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||||
<el-input v-model="standQuery" style="width: 158px; margin-right: 10px;" placeholder="工站"
|
|
||||||
:suffix-icon="Search" />
|
|
||||||
<el-select-v2 v-model="pickStatusQuery" style="width: 158px; margin-right: 10px;"
|
|
||||||
placeholder="请选择状态" :options="pickStatusOptions" @change="search()"></el-select-v2>
|
|
||||||
<el-button type="primary" @click="search()">搜索</el-button>
|
|
||||||
<el-button type="warning" @click="reset()">重置</el-button>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
</el-form>
|
||||||
<el-table :data="pickTaskList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
</fieldset>
|
||||||
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
<div class="table-area">
|
||||||
:cell-style="{ 'text-align': 'center' }">
|
<el-table :data="tableData" stripe border v-loading="tableLoading" class="table-class"
|
||||||
<el-table-column width="65px" fixed="left">
|
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||||
<template v-slot="scope">
|
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||||
<el-radio :label="scope.row.pickTaskId" v-model="pickTaskId"> </el-radio>
|
@sort-change="handleSortChange">
|
||||||
</template>
|
<el-table-column width="65px" fixed="left">
|
||||||
</el-table-column>
|
<template v-slot="scope">
|
||||||
<el-table-column prop="pickTaskId" label="id" fixed="left" min-width="120px" show-overflow-tooltip />
|
<el-radio :label="scope.row.pickId" v-model="pickId"> </el-radio>
|
||||||
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" />
|
</template>
|
||||||
<el-table-column prop="standId" label="站台号" fixed="left" min-width="120px" />
|
</el-table-column>
|
||||||
<el-table-column prop="pickStatus" label="拣选状态" :formatter="pickStatusFormat" min-width="120px" />
|
<el-table-column prop="pickId" label="任务号" fixed="left" min-width="120px" sortable="custom"
|
||||||
<el-table-column prop="lastUpdateTime" label="最近更新时间" :formatter="timeFormat" show-overflow-tooltip
|
show-overflow-tooltip />
|
||||||
min-width="120px" />
|
<el-table-column prop="pickStatus" label="任务状态" :formatter="pickStatusFormat" fixed="right" min-width="120px" sortable="custom"
|
||||||
<el-table-column fixed="right" label="操作" width="120px">
|
show-overflow-tooltip />
|
||||||
<template v-slot="scope">
|
<el-table-column prop="pickStand" label="目标站台" min-width="120px" sortable="custom"
|
||||||
<el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
|
show-overflow-tooltip />
|
||||||
</template>
|
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" sortable="custom"
|
||||||
</el-table-column>
|
show-overflow-tooltip />
|
||||||
</el-table>
|
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px" sortable="custom"
|
||||||
<br />
|
show-overflow-tooltip />
|
||||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
<el-table-column prop="sendTime" label="发送时间" :formatter="timeFormat" min-width="120px" sortable="custom"
|
||||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
show-overflow-tooltip />
|
||||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
<el-table-column prop="arriveTime" label="到达时间" :formatter="timeFormat" min-width="120px" sortable="custom"
|
||||||
@current-change="search" />
|
show-overflow-tooltip />
|
||||||
<el-dialog v-model="dialogVisible" title="拣选任务详细信息" width="40%" draggable :show-close="false">
|
<el-table-column prop="leaveTime" label="离开时间" :formatter="timeFormat" min-width="120px" sortable="custom"
|
||||||
<div
|
show-overflow-tooltip />
|
||||||
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
<!-- <el-table-column fixed="right" label="操作" width="170px">
|
||||||
<el-form ref="pickTaskFormRef" :model="pickTaskFormEntity" :label-position="labelPosition"
|
<template v-slot="scope">
|
||||||
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
<div style="display: inline-block; align-content: center;">
|
||||||
<el-row :gutter="16">
|
<el-button type="primary"
|
||||||
<el-col :span="12" :offset="0">
|
@click="editCurrentRowFormEntity(scope.row)">编辑</el-button>
|
||||||
<el-form-item label="id" prop="pickTaskId">
|
</div>
|
||||||
<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>
|
</template>
|
||||||
</el-dialog>
|
</el-table-column> -->
|
||||||
</el-config-provider>
|
</el-table>
|
||||||
</div>
|
<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>
|
||||||
|
</div>
|
||||||
|
</el-container>
|
||||||
|
</el-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { getPickTasksByPage, updatePickTaskInfo } from '@/api/taskOperation.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'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
</script>
|
import { queryPickTasksByPage } from '@/api/taskQuery.js'
|
||||||
<script>
|
import { timeFormatter, pickTaskStatusFormatter } from '@/utils/formatter.js'
|
||||||
export default {
|
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
||||||
name: 'pickTaskMonitor',
|
import { ElMessage } from 'element-plus'
|
||||||
data() {
|
import { genTableRequest } from '@/utils/generator.js'
|
||||||
return {
|
import { labelPosition } from '@/constant/form.js'
|
||||||
pickTaskList: [],
|
import {pickingTaskStatusOptions} from '@/constant/options.js'
|
||||||
currentPage: 1,
|
import { addAllOptionOfOptions } from '@/utils/generator.js'
|
||||||
pageSize: 10,
|
import { loading } from '@/utils/loading'
|
||||||
total: 0,
|
/**
|
||||||
vehicleIdQuery: '',
|
* 常量定义
|
||||||
standQuery: '',
|
*/
|
||||||
pickStatusQuery: -99,
|
const STAND_ID = store.getters.getStandId
|
||||||
loading: true,
|
const USER_NAME = store.getters.getUserName
|
||||||
dialogVisible: false,
|
/**
|
||||||
pickTaskId: '',
|
* 变量定义
|
||||||
pickTaskFormEntity: reactive({}),
|
*/
|
||||||
pickTaskFormRef: ref(),
|
let maxHeight = ref(window.innerHeight * 0.55)
|
||||||
labelPosition: 'top',
|
let tableLoading = ref(false)
|
||||||
rules: reactive({}),
|
let tableData = ref([])
|
||||||
taskStatusOptions: [
|
let baseTableQuery = reactive({
|
||||||
{
|
currentPage: 1,
|
||||||
value: -1,
|
pageSize: 10,
|
||||||
label: '暂存'
|
total: 0,
|
||||||
},
|
sortBy: new Map([['createTime', true]]),// 按照成品号顺序排序
|
||||||
{
|
standId: STAND_ID,
|
||||||
value: 0,
|
userName: USER_NAME
|
||||||
label: '待下发'
|
})
|
||||||
},
|
let searchQueryFormEntity = reactive({
|
||||||
{
|
vehicleId: '',
|
||||||
value: 1,
|
pickStand: '',
|
||||||
label: '已下发'
|
pickStatus: -99
|
||||||
},
|
})
|
||||||
{
|
let searchQueryFormRef = ref()
|
||||||
value: 2,
|
let pickId = ''
|
||||||
label: '已到达'
|
/**
|
||||||
}
|
* 系统方法
|
||||||
],
|
*/
|
||||||
pickStatusOptions: [
|
onMounted(() => {
|
||||||
{
|
nextTick(() => {
|
||||||
value: -99,
|
window.addEventListener('resize', resizeHeight)
|
||||||
label: '全部'
|
search()
|
||||||
},
|
})
|
||||||
{
|
})
|
||||||
value: -1,
|
onBeforeUnmount(() => {
|
||||||
label: '暂存'
|
nextTick(() => {
|
||||||
},
|
window.removeEventListener('resize', resizeHeight)
|
||||||
{
|
})
|
||||||
value: 0,
|
})
|
||||||
label: '待下发'
|
const resizeHeight = () => {
|
||||||
},
|
maxHeight.value = window.innerHeight * 0.55
|
||||||
{
|
}
|
||||||
value: 1,
|
/**
|
||||||
label: '已下发'
|
* 自定义方法
|
||||||
},
|
*/
|
||||||
{
|
// 查询
|
||||||
value: 2,
|
const search = () => {
|
||||||
label: '已到达'
|
tableLoading.value = true
|
||||||
}
|
let request = genTableRequest(baseTableQuery)
|
||||||
],
|
// 设定查询参数
|
||||||
}
|
request.vehicleId = searchQueryFormEntity.vehicleId.trim()
|
||||||
},
|
request.pickStand = searchQueryFormEntity.pickStand.trim()
|
||||||
mounted() {
|
request.pickStatus = searchQueryFormEntity.pickStatus === -99 ? null : searchQueryFormEntity.pickStatus
|
||||||
this.search()
|
queryPickTasksByPage(request).then((res) => {
|
||||||
},
|
const response = res.data
|
||||||
methods: {
|
if (response.code === 0) {
|
||||||
search() {
|
const data = response.data
|
||||||
this.loading = true
|
if (data != null) {
|
||||||
const request = {
|
tableData.value = data.lists
|
||||||
pageNo: this.currentPage,
|
baseTableQuery.total = data.total
|
||||||
pageSize: this.pageSize,
|
} else {
|
||||||
vehicleId: this.vehicleIdQuery.trim(),
|
tableData.value = []
|
||||||
standId: this.standQuery.trim(),
|
baseTableQuery.total = 0
|
||||||
pickStatus: this.pickStatusQuery == -99 ? null : this.pickStatusQuery,
|
}
|
||||||
userName: store.getters.getUserName
|
} else {
|
||||||
}
|
ElMessage.error(response.message)
|
||||||
getPickTasksByPage(request).then(res => {
|
}
|
||||||
const tableResponse = res.data
|
}).catch(err => {
|
||||||
if (tableResponse.code == 0) {
|
console.log(err)
|
||||||
this.pickTaskList = tableResponse.returnData.lists
|
ElMessage.error('查询数据异常。')
|
||||||
this.total = tableResponse.returnData.total
|
}).finally(() => {
|
||||||
} else {
|
tableLoading.value = false
|
||||||
errorBox(tableResponse.message)
|
})
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
const clearQuery = () => {
|
||||||
console.log(err)
|
searchQueryFormEntity.vehicleId = ''
|
||||||
errorBox('查询拣选任务错误')
|
searchQueryFormEntity.goodsId = ''
|
||||||
})
|
}
|
||||||
this.loading = false
|
const handleSortChange = (data) => {
|
||||||
},
|
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||||
dateFormat: (row, column, cellValue, index) => {
|
baseTableQuery.sortBy.delete(data.prop)
|
||||||
return dateFormatter(cellValue)
|
}
|
||||||
},
|
baseTableQuery.sortBy.set(data.prop, data.order.toLowerCase() === 'ascending')
|
||||||
timeFormat: (row, column, cellValue, index) => {
|
search()
|
||||||
return timeFormatter(cellValue)
|
}
|
||||||
},
|
const getCurrentRow = (row) => {
|
||||||
pickStatusFormat: (row, column, cellValue, index) => {
|
pickId = row.pickId
|
||||||
switch (cellValue) {
|
}
|
||||||
case -1:
|
const timeFormat = (row, column, cellValue, index) => {
|
||||||
return '暂存'
|
return timeFormatter(cellValue)
|
||||||
case 0:
|
}
|
||||||
return '待下发'
|
const pickStatusFormat = (row, column, cellValue, index) => {
|
||||||
case 1:
|
return pickTaskStatusFormatter(cellValue)
|
||||||
return '已下发'
|
|
||||||
case 2:
|
|
||||||
return '已到达'
|
|
||||||
default:
|
|
||||||
return '未知'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
reset() {
|
|
||||||
this.vehicleIdQuery = ''
|
|
||||||
this.standQuery = ''
|
|
||||||
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.success('更新拣选任务成功。')
|
|
||||||
this.search()
|
|
||||||
} else {
|
|
||||||
errorBox(res.data.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
errorBox('更新拣选任务失败。')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getCurrentRow(row) {
|
|
||||||
this.pickTaskId = row.pickTaskId
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.el-pagination {
|
.content {
|
||||||
padding-left: 5px;
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-button {
|
.work-area {
|
||||||
width: 72px;
|
width: 100%;
|
||||||
margin-left: 0px;
|
/* padding: 5px; */
|
||||||
margin-right: 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 {
|
.table-class {
|
||||||
width: 100%;
|
margin: 5px 5px 5px 5px;
|
||||||
|
width: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item {
|
.el-pagination {
|
||||||
width: 10% inherit;
|
padding-left: 5px;
|
||||||
justify-content: center;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item .el-select-v2 {
|
.my-autocomplete li {
|
||||||
width: 100% !important;
|
width: 196px;
|
||||||
|
line-height: normal;
|
||||||
|
padding: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item .el-input-number {
|
.my-autocomplete li .name {
|
||||||
width: 100% !important;
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item .el-button {
|
.my-autocomplete li .addr {
|
||||||
margin: auto;
|
font-size: 12px;
|
||||||
|
color: #b4b4b4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title-area {
|
.my-autocomplete li .highlighted .addr {
|
||||||
display: flex;
|
color: #ddd;
|
||||||
/* min-height: 10%; */
|
}
|
||||||
max-height: max-content;
|
|
||||||
margin-bottom: 10px;
|
.my-autocomplete li .goods_id {
|
||||||
min-width: inherit;
|
color: brown;
|
||||||
border: solid 1px;
|
}
|
||||||
border-radius: 10px;
|
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
.my-autocomplete li .goods_name {
|
||||||
overflow: auto;
|
color: cornflowerblue;
|
||||||
flex-direction: column;
|
}
|
||||||
padding: 10px;
|
|
||||||
|
.btn-search {
|
||||||
|
height: 30px;
|
||||||
|
width: 80px;
|
||||||
|
margin: auto 5px 5px auto;
|
||||||
|
color: black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,200 +1,248 @@
|
||||||
<template>
|
<template>
|
||||||
<el-config-provider :locale="zhCn">
|
<el-config-provider :locale="zhCn">
|
||||||
<el-container class="content">
|
<el-container class="content">
|
||||||
<div class="work-area">
|
<div class="work-area">
|
||||||
<fieldset class="search-area">
|
<fieldset class="search-area">
|
||||||
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
||||||
label-width="158px" style="max-width: 100%" status-icon>
|
label-width="158px" style="max-width: 100%" status-icon>
|
||||||
<div style="display: flex;justify-content: space-between;">
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-form-item label="任务类型">
|
<el-form-item label="任务类型">
|
||||||
<el-select-v2 v-model="searchQueryFormEntity.taskType" placeholder="任务类型"
|
<el-select-v2 v-model="searchQueryFormEntity.taskType" placeholder="任务类型"
|
||||||
:options="addAllOptionOfOptions(taskTypeOptions)"
|
:options="addAllOptionOfOptions(taskTypeOptions)"
|
||||||
@change="search()"></el-select-v2>
|
@change="search()"></el-select-v2>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="任务状态">
|
<el-form-item label="任务状态">
|
||||||
<el-select-v2 v-model="searchQueryFormEntity.taskStatus" placeholder="任务状态"
|
<el-select-v2 v-model="searchQueryFormEntity.taskStatus" placeholder="任务状态"
|
||||||
:options="addAllOptionOfOptions(wmsTaskStatusOptions)"
|
:options="addAllOptionOfOptions(wmsTaskStatusOptions)"
|
||||||
@change="search()"></el-select-v2>
|
@change="search()"></el-select-v2>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="箱号">
|
<el-form-item label="箱号">
|
||||||
<el-input v-model="searchQueryFormEntity.vehicleId" @keyup.enter="search()" clearable />
|
<el-input v-model="searchQueryFormEntity.vehicleId" @keyup.enter="search()" clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="料号">
|
<el-form-item label="料号">
|
||||||
<el-input v-model="searchQueryFormEntity.goodsId" @keyup.enter="search()" clearable />
|
<el-input v-model="searchQueryFormEntity.goodsId" @keyup.enter="search()" clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div style="align-content: center;">
|
<div style="align-content: center;">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-button type="primary" class="btn-search" @click="search()">查询</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-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</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>
|
|
||||||
<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>
|
</div>
|
||||||
</el-container>
|
</el-form>
|
||||||
</el-config-provider>
|
</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="callStand" 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 fixed="right" label="操作" width="170px">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<div style="display: inline-block; align-content: center;">
|
||||||
|
<el-button type="primary"
|
||||||
|
@click="editCurrentRowTask(scope.row)">编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button type="danger"
|
||||||
|
@click="deleteCurrentRowTask(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="rowEditFormEntity" :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="rowEditFormEntity.taskId" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="任务类型">
|
||||||
|
<el-select-v2 v-model="rowEditFormEntity.taskType" placeholder="请选择任务类型"
|
||||||
|
:options="taskTypeOptions" 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="任务状态">
|
||||||
|
<el-select-v2 v-model="rowEditFormEntity.taskStatus" placeholder="请选择任务状态"
|
||||||
|
:options="wmsTaskStatusOptions"></el-select-v2>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="优先级">
|
||||||
|
<el-input-number v-model.number="rowEditFormEntity.taskPriority" controls-position="right"
|
||||||
|
:min="0" :max="9"/>
|
||||||
|
</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="rowEditFormEntity.vehicleId" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="料号">
|
||||||
|
<el-input v-model="rowEditFormEntity.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 v-model="rowEditFormEntity.goodsDesc" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="wcs任务号">
|
||||||
|
<el-input v-model="rowEditFormEntity.wcsTaskId" 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="rowEditFormEntity.opNum" controls-position="right"
|
||||||
|
:min="0" clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="库存数量">
|
||||||
|
<el-input-number v-model.number="rowEditFormEntity.stockNum" controls-position="right" 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="rowEditFormEntity.origin" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="终点">
|
||||||
|
<el-input v-model="rowEditFormEntity.destination" clearable/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="创建时间">
|
||||||
|
<el-input type="text" v-model="rowEditFormEntity.createTime" :formatter="timeFormatter" disabled>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="完成时间">
|
||||||
|
<el-input type="text" v-model="rowEditFormEntity.finishTime" :formatter="timeFormatter" disabled>
|
||||||
|
</el-input>
|
||||||
|
</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="rowEditFormEntity.opUser" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="呼叫站台">
|
||||||
|
<el-input v-model="rowEditFormEntity.callStand" disabled/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input type="textarea" style="width: 196px" v-model="rowEditFormEntity.remark" maxlength="1024"
|
||||||
|
:autosize="{minRows: 1, maxRows: 4}"></el-input>
|
||||||
|
</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(rowEditFormEntity)">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</el-container>
|
||||||
|
</el-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import { queryTasksByPage } from '@/api/taskQuery.js'
|
import {queryTasksByPage} from '@/api/taskQuery.js'
|
||||||
import { timeFormatter, wmsTaskTypeFormatter, wmsTaskStatusFormatter } from '@/utils/formatter.js'
|
import {deleteWmsTask, updateWmsTask} from '@/api/taskOperation'
|
||||||
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
import {timeFormatter, wmsTaskTypeFormatter, wmsTaskStatusFormatter} from '@/utils/formatter.js'
|
||||||
import { ElMessage } from 'element-plus'
|
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||||
import { genTableRequest } from '@/utils/generator.js'
|
import {ElMessage, ElMessageBox} from 'element-plus'
|
||||||
import { labelPosition } from '@/constant/form.js'
|
import {genTableRequest} from '@/utils/generator.js'
|
||||||
import { taskTypeOptions, wmsTaskStatusOptions } from '@/constant/options.js'
|
import {labelPosition} from '@/constant/form.js'
|
||||||
import { addAllOptionOfOptions } from '@/utils/generator.js'
|
import {taskTypeOptions, wmsTaskStatusOptions} from '@/constant/options.js'
|
||||||
import { loading } from '@/utils/loading'
|
import {addAllOptionOfOptions} from '@/utils/generator.js'
|
||||||
|
import {loading} from '@/utils/loading'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 常量定义
|
* 常量定义
|
||||||
*/
|
*/
|
||||||
|
|
@ -207,259 +255,301 @@ let maxHeight = ref(window.innerHeight * 0.55)
|
||||||
let tableLoading = ref(false)
|
let tableLoading = ref(false)
|
||||||
let tableData = ref([])
|
let tableData = ref([])
|
||||||
let baseTableQuery = reactive({
|
let baseTableQuery = reactive({
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
sortBy: new Map([['createTime', true]]),// 按照成品号顺序排序
|
sortBy: new Map([['createTime', true]]),// 按照成品号顺序排序
|
||||||
standId: STAND_ID,
|
standId: STAND_ID,
|
||||||
userName: USER_NAME
|
userName: USER_NAME
|
||||||
})
|
})
|
||||||
let searchQueryFormEntity = reactive({
|
let searchQueryFormEntity = reactive({
|
||||||
vehicleId: '',
|
vehicleId: '',
|
||||||
goodsId: '',
|
goodsId: '',
|
||||||
taskType: -99,
|
taskType: -99,
|
||||||
taskStatus: -99
|
taskStatus: -99
|
||||||
})
|
})
|
||||||
let searchQueryFormRef = ref()
|
let searchQueryFormRef = ref()
|
||||||
let rowEditFlag = ref(false)
|
let rowEditFlag = ref(false)
|
||||||
let taskId = ''
|
let taskId = ''
|
||||||
let rowEditFormRef = ref()
|
let rowEditFormRef = ref()
|
||||||
let rowFormEntity = reactive({})
|
let rowEditFormEntity = reactive({
|
||||||
|
taskId: '',
|
||||||
|
taskType: null,
|
||||||
|
taskStatus: null,
|
||||||
|
taskPriority: null,
|
||||||
|
vehicleId: '',
|
||||||
|
origin: '',
|
||||||
|
destination: '',
|
||||||
|
wcsTaskId: '',
|
||||||
|
createTime: null,
|
||||||
|
finishTime: null,
|
||||||
|
goodsId: '',
|
||||||
|
opNum: null,
|
||||||
|
stockNum: null,
|
||||||
|
opUser: '',
|
||||||
|
remark: '',
|
||||||
|
callStand: '',
|
||||||
|
goodsDesc: ''
|
||||||
|
})
|
||||||
/**
|
/**
|
||||||
* 系统方法
|
* 系统方法
|
||||||
*/
|
*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
window.addEventListener('resize', resizeHeight)
|
window.addEventListener('resize', resizeHeight)
|
||||||
search()
|
search()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
window.removeEventListener('resize', resizeHeight)
|
window.removeEventListener('resize', resizeHeight)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
const resizeHeight = () => {
|
const resizeHeight = () => {
|
||||||
maxHeight.value = window.innerHeight * 0.55
|
maxHeight.value = window.innerHeight * 0.55
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 自定义方法
|
* 自定义方法
|
||||||
*/
|
*/
|
||||||
// 查询
|
// 查询
|
||||||
const search = () => {
|
const search = () => {
|
||||||
tableLoading.value = true
|
tableLoading.value = true
|
||||||
let request = genTableRequest(baseTableQuery)
|
let request = genTableRequest(baseTableQuery)
|
||||||
// 设定查询参数
|
// 设定查询参数
|
||||||
request.vehicleId = searchQueryFormEntity.vehicleId.trim()
|
request.vehicleId = searchQueryFormEntity.vehicleId.trim()
|
||||||
request.goodsId = searchQueryFormEntity.goodsId.trim()
|
request.goodsId = searchQueryFormEntity.goodsId.trim()
|
||||||
request.taskType = searchQueryFormEntity.taskType == -99 ? null : searchQueryFormEntity.taskType
|
request.taskType = searchQueryFormEntity.taskType === -99 ? null : searchQueryFormEntity.taskType
|
||||||
request.taskStatus = searchQueryFormEntity.taskStatus == -99 ? null : searchQueryFormEntity.taskStatus
|
request.taskStatus = searchQueryFormEntity.taskStatus === -99 ? null : searchQueryFormEntity.taskStatus
|
||||||
queryTasksByPage(request).then((res) => {
|
queryTasksByPage(request).then((res) => {
|
||||||
const response = res.data
|
const response = res.data
|
||||||
if (response.code == 0) {
|
if (response.code === 0) {
|
||||||
const data = response.data
|
const data = response.data
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
tableData.value = data.lists
|
tableData.value = data.lists
|
||||||
baseTableQuery.total = data.total
|
baseTableQuery.total = data.total
|
||||||
} else {
|
} else {
|
||||||
tableData.value = []
|
tableData.value = []
|
||||||
baseTableQuery.total = 0
|
baseTableQuery.total = 0
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(response.message)
|
ElMessage.error(response.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
ElMessage.error('查询数据异常。')
|
ElMessage.error('查询数据异常。')
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
tableLoading.value = false
|
tableLoading.value = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const clearQuery = () => {
|
const clearQuery = () => {
|
||||||
searchQueryFormEntity.vehicleId = ''
|
searchQueryFormEntity.vehicleId = ''
|
||||||
searchQueryFormEntity.goodsId = ''
|
searchQueryFormEntity.goodsId = ''
|
||||||
}
|
}
|
||||||
const handleSortChange = (data) => {
|
const handleSortChange = (data) => {
|
||||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||||
baseTableQuery.sortBy.delete(data.prop)
|
baseTableQuery.sortBy.delete(data.prop)
|
||||||
}
|
}
|
||||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
baseTableQuery.sortBy.set(data.prop, data.order.toLowerCase() === 'ascending')
|
||||||
search()
|
search()
|
||||||
}
|
}
|
||||||
const getCurrentRow = (row) => {
|
const getCurrentRow = (row) => {
|
||||||
taskId = row.taskId
|
taskId = row.taskId
|
||||||
}
|
}
|
||||||
const timeFormat = (row, column, cellValue, index) => {
|
const timeFormat = (row, column, cellValue, index) => {
|
||||||
return timeFormatter(cellValue)
|
return timeFormatter(cellValue)
|
||||||
}
|
}
|
||||||
const taskTypeFormat = (row, column, cellValue, index) => {
|
const taskTypeFormat = (row, column, cellValue, index) => {
|
||||||
return wmsTaskTypeFormatter(cellValue)
|
return wmsTaskTypeFormatter(cellValue)
|
||||||
}
|
}
|
||||||
const taskStatusFormat = (row, column, cellValue, index) => {
|
const taskStatusFormat = (row, column, cellValue, index) => {
|
||||||
return wmsTaskStatusFormatter(cellValue)
|
return wmsTaskStatusFormatter(cellValue)
|
||||||
}
|
}
|
||||||
// 编辑弹框
|
// 编辑弹框
|
||||||
const editCurrentRowFormEntity = (row) => {
|
const editCurrentRowTask = (row) => {
|
||||||
// 设置form值
|
// 设置form值
|
||||||
rowFormEntity.workIndex = row.workIndex
|
rowEditFormEntity.taskId = row.taskId
|
||||||
rowFormEntity.workOrder = row.workOrder
|
rowEditFormEntity.taskType = row.taskType
|
||||||
rowFormEntity.productId = row.productId
|
rowEditFormEntity.taskStatus = row.taskStatus
|
||||||
rowFormEntity.singleProductId = row.singleProductId
|
rowEditFormEntity.taskPriority = row.taskPriority
|
||||||
rowFormEntity.boxNo = row.boxNo
|
rowEditFormEntity.vehicleId = row.vehicleId
|
||||||
rowFormEntity.goodsId = row.goodsId
|
rowEditFormEntity.origin = row.origin
|
||||||
rowFormEntity.needNum = row.needNum
|
rowEditFormEntity.destination = row.destination
|
||||||
rowFormEntity.distributeNum = row.distributeNum
|
rowEditFormEntity.wcsTaskId = row.wcsTaskId
|
||||||
rowFormEntity.finishNum = row.finishNum
|
rowEditFormEntity.createTime = row.createTime
|
||||||
rowFormEntity.workStatus = row.workStatus
|
rowEditFormEntity.finishTime = row.finishTime
|
||||||
rowFormEntity.lackStatus = row.lackStatus
|
rowEditFormEntity.goodsId = row.goodsId
|
||||||
// 弹出框
|
rowEditFormEntity.opNum = row.opNum
|
||||||
rowEditFlag.value = true
|
rowEditFormEntity.stockNum = row.stockNum
|
||||||
|
rowEditFormEntity.opUser = row.opUser
|
||||||
|
rowEditFormEntity.remark = row.remark
|
||||||
|
rowEditFormEntity.callStand = row.callStand
|
||||||
|
rowEditFormEntity.goodsDesc = row.goodsDesc
|
||||||
|
// 弹出框
|
||||||
|
rowEditFlag.value = true
|
||||||
}
|
}
|
||||||
// 关闭当前缺料工作
|
// 删除当前任务行
|
||||||
const closeLackWork = (row) => {
|
const deleteCurrentRowTask = (row) => {
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
'当前操作仅涉及删除当前任务行。\n是否确认',
|
||||||
|
'警告',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
const request = {
|
const request = {
|
||||||
workIndex: row.workIndex,
|
taskId: row.taskId,
|
||||||
standId: STAND_ID,
|
userName: USER_NAME,
|
||||||
userName: USER_NAME
|
standId: STAND_ID
|
||||||
}
|
}
|
||||||
loading.open('关闭中...')
|
loading.open('删除中...')
|
||||||
closeCurrentWorks(request).then(res => {
|
deleteWmsTask(request).then(res => {
|
||||||
const response = res.data
|
const response = res.data
|
||||||
if (response.code == 0) {
|
if (response.code === 0) {
|
||||||
ElMessage.success(response.message)
|
ElMessage.success(response.message)
|
||||||
search()
|
} else {
|
||||||
} else {
|
ElMessage.error(response.message)
|
||||||
ElMessage.error(response.message)
|
}
|
||||||
}
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
ElMessage.error('请求异常。')
|
ElMessage.error('删除异常')
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
loading.close()
|
search()
|
||||||
|
loading.close()
|
||||||
})
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
ElMessage.info('操作取消')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
// 更新当前行数据
|
// 更新当前行数据
|
||||||
const submitUpdateRow = (rowFormEntity) => {
|
const submitUpdateRow = (rowFormEntity) => {
|
||||||
const request = {
|
const request = {
|
||||||
workIndex: rowFormEntity.workIndex,
|
taskId: rowFormEntity.taskId,
|
||||||
distributeNum: rowFormEntity.distributeNum,
|
taskStatus: rowFormEntity.taskStatus,
|
||||||
finishNum: rowFormEntity.finishNum,
|
taskPriority: rowFormEntity.taskPriority,
|
||||||
workStatus: rowFormEntity.workStatus,
|
opNum: rowFormEntity.opNum,
|
||||||
lackStatus: rowFormEntity.lackStatus,
|
destination: rowFormEntity.destination,
|
||||||
standId: STAND_ID,
|
remark: rowFormEntity.remark,
|
||||||
userName: USER_NAME
|
standId: STAND_ID,
|
||||||
|
userName: USER_NAME
|
||||||
|
}
|
||||||
|
loading.open('更新中...')
|
||||||
|
updateWmsTask(request).then(res => {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
ElMessage.success('更新数据成功。')
|
||||||
|
rowEditFlag.value = false
|
||||||
|
search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error('更新数据失败。')
|
||||||
}
|
}
|
||||||
loading.open('更新中...')
|
}).catch(err => {
|
||||||
updateKateWorks(request).then(res => {
|
console.log(err)
|
||||||
if (res.data.code == 0) {
|
ElMessage.error('更新数据异常。')
|
||||||
ElMessage.success('更新数据成功。')
|
}).finally(() => {
|
||||||
rowEditFlag.value = false
|
loading.close()
|
||||||
search()
|
})
|
||||||
} else {
|
|
||||||
ElMessage.error('更新数据失败。')
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
ElMessage.error('更新数据异常。')
|
|
||||||
}).finally(() => {
|
|
||||||
loading.close()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.content {
|
.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.work-area {
|
.work-area {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
/* padding: 5px; */
|
/* padding: 5px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-area {
|
.search-area {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
min-height: fit-content;
|
min-height: fit-content;
|
||||||
max-height: 40%;
|
max-height: 40%;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
min-width: inherit;
|
min-width: inherit;
|
||||||
border: solid 1px;
|
border: solid 1px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-area {
|
.table-area {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
min-height: fit-content;
|
min-height: fit-content;
|
||||||
max-height: 60%;
|
max-height: 60%;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
min-width: inherit;
|
min-width: inherit;
|
||||||
border: solid 1px;
|
border: solid 1px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item {
|
.el-form-item {
|
||||||
margin: 5px 5px 5px 5px;
|
margin: 5px 5px 5px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item .el-input {
|
.el-form-item .el-input {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item .el-input-number {
|
.el-form-item .el-input-number {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item .el-select-v2 {
|
.el-form-item .el-select-v2 {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-class {
|
.table-class {
|
||||||
margin: 5px 5px 5px 5px;
|
margin: 5px 5px 5px 5px;
|
||||||
width: inherit;
|
width: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-pagination {
|
.el-pagination {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li {
|
.my-autocomplete li {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
padding: 7px;
|
padding: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .name {
|
.my-autocomplete li .name {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .addr {
|
.my-autocomplete li .addr {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #b4b4b4;
|
color: #b4b4b4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .highlighted .addr {
|
.my-autocomplete li .highlighted .addr {
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .goods_id {
|
.my-autocomplete li .goods_id {
|
||||||
color: brown;
|
color: brown;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .goods_name {
|
.my-autocomplete li .goods_name {
|
||||||
color: cornflowerblue;
|
color: cornflowerblue;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-search {
|
.btn-search {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
width: 80px;
|
width: 80px;
|
||||||
margin: auto 5px 5px auto;
|
margin: auto 5px 5px auto;
|
||||||
color: black;
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dialog-footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,127 +1,142 @@
|
||||||
<template>
|
<template>
|
||||||
<el-config-provider :locale="zhCn">
|
<el-config-provider :locale="zhCn">
|
||||||
<el-container class="content">
|
<el-container class="content">
|
||||||
<div class="work-area">
|
<div class="work-area">
|
||||||
<fieldset class="search-area">
|
<fieldset class="search-area">
|
||||||
<el-form ref="dbsQueryFormRef" :model="dbsQueryFormEntity" :label-position="labelPosition"
|
<el-form ref="configQueryFormRef" :model="configQueryFormEntity" :label-position="labelPosition"
|
||||||
label-width="158px" style="max-width: 100%" status-icon>
|
label-width="158px" style="max-width: 100%" status-icon>
|
||||||
<div style="display: flex;justify-content: space-between;">
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-form-item label="工单号">
|
<el-form-item label="配置键">
|
||||||
<el-input v-model="dbsQueryFormEntity.workOrder" clearable />
|
<el-input v-model="configQueryFormEntity.configKey" clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="零件号">
|
<el-form-item label="配置名">
|
||||||
<el-input v-model="dbsQueryFormEntity.productId" clearable />
|
<el-input v-model="configQueryFormEntity.configName" clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div style="align-content: center;">
|
<div style="align-content: center;">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-button type="primary" class="btn-search" @click="search()">查询</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-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<div class="table-area">
|
<div class="table-area">
|
||||||
<el-table :data="displayDbs" stripe border v-loading="tableLoading" class="table-class"
|
<el-table :data="displayConfigs" stripe border v-loading="tableLoading" class="table-class"
|
||||||
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||||
: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">
|
@sort-change="handleSortChange">
|
||||||
<el-table-column width="65px" fixed="left">
|
<el-table-column width="65px" fixed="left">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-radio :label="scope.row.configId" v-model="configId"> </el-radio>
|
<el-radio :label="scope.row.configId" v-model="configId"> </el-radio>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="configId" label="配置id" fixed="left" min-width="80px"
|
<el-table-column prop="configId" label="配置id" fixed="left" min-width="80px"
|
||||||
show-overflow-tooltip />
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="configName" label="配置名称" fixed="left" min-width="120px"
|
<el-table-column prop="configName" label="配置名称" fixed="left" min-width="120px"
|
||||||
show-overflow-tooltip />
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="configKey" label="配置键" show-overflow-tooltip min-width="120px" />
|
<el-table-column prop="configKey" label="配置键" show-overflow-tooltip min-width="120px"/>
|
||||||
<el-table-column prop="configValue" label="配置值" show-overflow-tooltip min-width="140px" />
|
<el-table-column prop="configValue" label="配置值" show-overflow-tooltip min-width="140px"/>
|
||||||
<el-table-column prop="configType" label="配置类型" :formatter="configTypeFormat" min-width="100px"
|
<el-table-column prop="configType" label="配置类型" :formatter="configTypeFormat" min-width="100px"
|
||||||
show-overflow-tooltip />
|
show-overflow-tooltip/>
|
||||||
<el-table-column fixed="right" label="操作" width="120px">
|
<el-table-column fixed="right" label="操作" width="120px">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
|
<el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<br />
|
<br/>
|
||||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||||
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
||||||
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
||||||
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||||
:total="baseTableQuery.total" />
|
:total="baseTableQuery.total"/>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog v-model="dialogVisible" title="库存信息" width="40%" draggable :show-close="false">
|
<el-dialog v-model="showConfigEditFlag" title="编辑配置信息" width="40%" draggable :show-close="false">
|
||||||
<el-form ref="configFormRef" :model="configFormEntity" :label-position="labelPosition"
|
<el-form ref="configEditFormRef" :model="configEditFormEntity" :label-position="labelPosition"
|
||||||
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="配置名称" prop="configName">
|
<el-form-item label="配置名称" prop="configName">
|
||||||
<el-input v-model="configFormEntity.configName" disabled />
|
<el-input v-model="configEditFormEntity.configName" disabled/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="配置类型" prop="configType">
|
<el-form-item label="配置类型" prop="configType">
|
||||||
<el-select-v2 v-model="configFormEntity.configType" placeholder="请选择配置类型"
|
<el-select-v2 v-model="configEditFormEntity.configType" placeholder="请选择配置类型"
|
||||||
:options="configTypeOptions" disabled></el-select-v2>
|
:options="configTypeOptions" disabled></el-select-v2>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="配置键" prop="configKey">
|
<el-form-item label="配置键" prop="configKey">
|
||||||
<el-input v-model="configFormEntity.configKey" disabled />
|
<el-input v-model="configFormEntity.configKey" disabled/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="配置值" prop="configValue">
|
<el-form-item label="配置值" prop="configValue">
|
||||||
<el-input v-if="configFormEntity.configType == '1'" type="textarea" :rows="1"
|
<el-input v-if="configFormEntity.configType == '1'" type="textarea" :rows="1"
|
||||||
v-model="configFormEntity.configValue" placeholder="" :maxlength="-1"
|
v-model="configFormEntity.configValue" placeholder="" :maxlength="-1"
|
||||||
:show-word-limit="false" :autosize="{ minRows: 1, maxRows: 4 }">
|
:show-word-limit="false" :autosize="{ minRows: 1, maxRows: 4 }">
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-select v-if="configFormEntity.configType == '2'"
|
<el-select v-if="configFormEntity.configType == '2'"
|
||||||
v-model="configFormEntity.configValue" multiple collapse-tags
|
v-model="configFormEntity.configValue" multiple collapse-tags
|
||||||
collapse-tags-tooltip :placeholder="'请选择' + configFormEntity.configName">
|
collapse-tags-tooltip :placeholder="'请选择' + configFormEntity.configName">
|
||||||
<el-option v-for="(value, index) in mails" :key="index" :label="value"
|
<el-option v-for="(value, index) in mails" :key="index" :label="value"
|
||||||
:value="value" />
|
:value="value"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-switch v-if="configFormEntity.configType == '3'" style="margin-left: 5px;"
|
<el-switch v-if="configFormEntity.configType == '3'" style="margin-left: 5px;"
|
||||||
v-model="configFormEntity.configValue" active-value="1" inactive-value="0" />
|
v-model="configFormEntity.configValue" active-value="1" inactive-value="0"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="submitChange()">
|
<el-button type="primary" @click="submitChange()">
|
||||||
确定
|
确定
|
||||||
</el-button>
|
</el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</el-container>
|
</el-container>
|
||||||
</el-config-provider>
|
</el-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { queryDbsByPage } from '@/api/kateWork.js'
|
import {queryDbsByPage} from '@/api/kateWork.js'
|
||||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
import {dateFormatter, timeFormatter, configTypeFormatter} from '@/utils/formatter.js'
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import {ElMessage} from 'element-plus'
|
||||||
import { genTableRequest, addAllOptionOfOptions } from '@/utils/generator.js'
|
import {genTableRequest, addAllOptionOfOptions} from '@/utils/generator.js'
|
||||||
import { labelPosition, shortcuts } from '@/constant/form'
|
import {labelPosition, shortcuts} from '@/constant/form'
|
||||||
import { dbsStatusOptions } from '@/constant/options'
|
import {dbsStatusOptions} from '@/constant/options'
|
||||||
import { exportDbsWithExcel } from '@/api/excel'
|
import {exportDbsWithExcel} from '@/api/excel'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 常量定义
|
* 常量定义
|
||||||
*/
|
*/
|
||||||
|
const configTypeOptions = [
|
||||||
|
{
|
||||||
|
value: '1',
|
||||||
|
label: '输入框'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '2',
|
||||||
|
label: '下拉多选'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '3',
|
||||||
|
label: '开关'
|
||||||
|
}
|
||||||
|
]
|
||||||
/**
|
/**
|
||||||
* 变量定义
|
* 变量定义
|
||||||
*/
|
*/
|
||||||
|
|
@ -129,16 +144,16 @@ let maxHeight = ref(window.innerHeight * 0.55)
|
||||||
let tableLoading = ref(false)
|
let tableLoading = ref(false)
|
||||||
let displayConfigs = ref([])
|
let displayConfigs = ref([])
|
||||||
let baseTableQuery = reactive({
|
let baseTableQuery = reactive({
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
sortBy: new Map([['configId', true]]),// 按照工单顺序排序
|
sortBy: new Map([['configId', true]]),// 按照工单顺序排序
|
||||||
standId: store.getters.getStandId,
|
standId: store.getters.getStandId,
|
||||||
userName: store.getters.getUserName
|
userName: store.getters.getUserName
|
||||||
})
|
})
|
||||||
let configQueryFormEntity = reactive({
|
let configQueryFormEntity = reactive({
|
||||||
configKey: '',
|
configKey: '',
|
||||||
configName: ''
|
configName: ''
|
||||||
})
|
})
|
||||||
let configQueryFormRef = ref()
|
let configQueryFormRef = ref()
|
||||||
let showConfigEditFlag = ref(false)
|
let showConfigEditFlag = ref(false)
|
||||||
|
|
@ -149,239 +164,224 @@ let configEditFormEntity = reactive({})
|
||||||
* 系统方法
|
* 系统方法
|
||||||
*/
|
*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
window.addEventListener('resize', resizeHeight)
|
window.addEventListener('resize', resizeHeight)
|
||||||
search()
|
search()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
window.removeEventListener('resize', resizeHeight)
|
window.removeEventListener('resize', resizeHeight)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
const resizeHeight = () => {
|
const resizeHeight = () => {
|
||||||
maxHeight.value = window.innerHeight * 0.55
|
maxHeight.value = window.innerHeight * 0.55
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 自定义方法
|
* 自定义方法
|
||||||
*/
|
*/
|
||||||
// 查询
|
// 查询
|
||||||
const search = () => {
|
const search = () => {
|
||||||
tableLoading.value = true
|
tableLoading.value = true
|
||||||
let request = genTableRequest(baseTableQuery)
|
let request = genTableRequest(baseTableQuery)
|
||||||
// 设定查询参数
|
// 设定查询参数
|
||||||
request.workOrder = dbsQueryFormEntity.workOrder
|
request.configKey = configQueryFormEntity.configKey
|
||||||
request.productId = dbsQueryFormEntity.productId
|
request.configName = configQueryFormEntity.configName
|
||||||
request.dbsStatus = dbsQueryFormEntity.dbsStatus == -99 ? null : dbsQueryFormEntity.dbsStatus
|
queryDbsByPage(request).then((res) => {
|
||||||
request.planStartDate = dateFormatter(dbsQueryFormEntity.planStartDate)
|
const response = res.data
|
||||||
queryDbsByPage(request).then((res) => {
|
if (response.code == 0) {
|
||||||
const response = res.data
|
const data = response.data
|
||||||
if (response.code == 0) {
|
if (data != null) {
|
||||||
const data = response.data
|
displayConfigs.value = data.lists
|
||||||
if (data != null) {
|
baseTableQuery.total = data.total
|
||||||
displayDbs.value = data.lists
|
} else {
|
||||||
baseTableQuery.total = data.total
|
displayDbs.value = []
|
||||||
} else {
|
baseTableQuery.total = 0
|
||||||
displayDbs.value = []
|
}
|
||||||
baseTableQuery.total = 0
|
} else {
|
||||||
}
|
ElMessage.error(response.message)
|
||||||
} else {
|
}
|
||||||
ElMessage.error(response.message)
|
}).catch(err => {
|
||||||
}
|
console.log(err)
|
||||||
}).catch(err => {
|
ElMessage.error('查询DBS数据异常。')
|
||||||
console.log(err)
|
}).finally(() => {
|
||||||
ElMessage.error('查询DBS数据异常。')
|
tableLoading.value = false
|
||||||
}).finally(() => {
|
})
|
||||||
tableLoading.value = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
const clearQuery = () => {
|
const clearQuery = () => {
|
||||||
dbsQueryFormEntity.workOrder = ''
|
dbsQueryFormEntity.workOrder = ''
|
||||||
dbsQueryFormEntity.productId = ''
|
dbsQueryFormEntity.productId = ''
|
||||||
dbsQueryFormEntity.dbsStatus = -99
|
dbsQueryFormEntity.dbsStatus = -99
|
||||||
dbsQueryFormEntity.planStartDate = null
|
dbsQueryFormEntity.planStartDate = null
|
||||||
}
|
}
|
||||||
const handleSortChange = (data) => {
|
const handleSortChange = (data) => {
|
||||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||||
baseTableQuery.sortBy.delete(data.prop)
|
baseTableQuery.sortBy.delete(data.prop)
|
||||||
}
|
}
|
||||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||||
search()
|
search()
|
||||||
}
|
}
|
||||||
const getCurrentRow = (row) => {
|
const getCurrentRow = (row) => {
|
||||||
dbsId = row.dbsId
|
configId = row.configId
|
||||||
|
}
|
||||||
|
const configTypeFormat = (row, column, cellValue, index) => {
|
||||||
|
return configTypeFormatter(cellValue)
|
||||||
}
|
}
|
||||||
const exportExcel = () => {
|
const exportExcel = () => {
|
||||||
const params = {
|
const params = {
|
||||||
workOrder: dbsQueryFormEntity.workOrder,
|
workOrder: dbsQueryFormEntity.workOrder,
|
||||||
productId: dbsQueryFormEntity.productId,
|
productId: dbsQueryFormEntity.productId,
|
||||||
dbsStatus: dbsQueryFormEntity.dbsStatus == -99 ? null : dbsQueryFormEntity.dbsStatus,
|
dbsStatus: dbsQueryFormEntity.dbsStatus == -99 ? null : dbsQueryFormEntity.dbsStatus,
|
||||||
planStartDate: dateFormatter(dbsQueryFormEntity.planStartDate)
|
planStartDate: dateFormatter(dbsQueryFormEntity.planStartDate)
|
||||||
}
|
}
|
||||||
exportDbsWithExcel(params).then(res => {
|
exportDbsWithExcel(params).then(res => {
|
||||||
const link = document.createElement('a');//创建a标签
|
const link = document.createElement('a');//创建a标签
|
||||||
try {
|
try {
|
||||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||||
let _fileName = 'DBS计划' + dateFormatter(new Date) + '.xlsx'
|
let _fileName = 'DBS计划' + dateFormatter(new Date) + '.xlsx'
|
||||||
link.style.display = 'none'//隐藏
|
link.style.display = 'none'//隐藏
|
||||||
|
|
||||||
// 兼容不同浏览器的URL对象
|
// 兼容不同浏览器的URL对象
|
||||||
const url = window.URL || window.webkitURL || window.moxURL
|
const url = window.URL || window.webkitURL || window.moxURL
|
||||||
link.href = url.createObjectURL(blob)
|
link.href = url.createObjectURL(blob)
|
||||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||||
document.body.appendChild(link)
|
document.body.appendChild(link)
|
||||||
link.click()
|
link.click()
|
||||||
document.body.removeChild(link)
|
document.body.removeChild(link)
|
||||||
url.revokeObjectURL(link.href)//移除url对象
|
url.revokeObjectURL(link.href)//移除url对象
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
ElMessage.error('下载文件失败')
|
ElMessage.error('下载文件失败')
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
ElMessage.error('导出失败')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const editCurrentRowStock = (row) => {
|
|
||||||
this.stockFormEntity = {
|
|
||||||
stockId: row.stockId,
|
|
||||||
locationId: row.locationId,
|
|
||||||
vehicleId: row.vehicleId,
|
|
||||||
stockStatus: row.stockStatus,
|
|
||||||
createTime: row.createTime,
|
|
||||||
lastUpdateTime: row.lastUpdateTime,
|
|
||||||
lastUpdateUser: row.lastUpdateUser,
|
|
||||||
isInventory: row.isInventory,
|
|
||||||
inventoryTaskId: row.inventoryTaskId,
|
|
||||||
noUseDays: row.noUseDays,
|
|
||||||
goodsId: row.goodsId,
|
|
||||||
goodsName: row.goodsName,
|
|
||||||
goodsStatus: row.goodsStatus,
|
|
||||||
remainNum: row.remainNum,
|
|
||||||
totalNum: row.totalNum
|
|
||||||
}
|
}
|
||||||
this.dialogVisible = true
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('导出失败')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const editCurrentRow = (row) => {
|
||||||
|
|
||||||
|
showConfigEditFlag.value = true
|
||||||
}
|
}
|
||||||
const submitStockInfo = () => {
|
const submitStockInfo = () => {
|
||||||
const request = {
|
const request = {
|
||||||
stockId: this.stockFormEntity.stockId,
|
stockId: this.stockFormEntity.stockId,
|
||||||
locationId: this.stockFormEntity.locationId,
|
locationId: this.stockFormEntity.locationId,
|
||||||
vehicleId: this.stockFormEntity.vehicleId,
|
vehicleId: this.stockFormEntity.vehicleId,
|
||||||
stockStatus: this.stockFormEntity.stockStatus,
|
stockStatus: this.stockFormEntity.stockStatus,
|
||||||
goodsId: this.stockFormEntity.goodsId,
|
goodsId: this.stockFormEntity.goodsId,
|
||||||
goodsStatus: this.stockFormEntity.goodsStatus,
|
goodsStatus: this.stockFormEntity.goodsStatus,
|
||||||
remainNum: this.stockFormEntity.remainNum,
|
remainNum: this.stockFormEntity.remainNum,
|
||||||
userName: store.getters.getUserName
|
userName: store.getters.getUserName
|
||||||
|
}
|
||||||
|
updateStockInfo(request).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
this.dialogVisible = false
|
||||||
|
ElMessage.success('更新库存成功')
|
||||||
|
this.search()
|
||||||
|
} else {
|
||||||
|
errorBox(res.data.message)
|
||||||
}
|
}
|
||||||
updateStockInfo(request).then(res => {
|
}).catch(err => {
|
||||||
if (res.data.code == 0) {
|
console.log(err)
|
||||||
this.dialogVisible = false
|
errorBox('更新库存失败')
|
||||||
ElMessage.success('更新库存成功')
|
})
|
||||||
this.search()
|
|
||||||
} else {
|
|
||||||
errorBox(res.data.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
errorBox('更新库存失败')
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
const openUploadDialog = () => {
|
const openUploadDialog = () => {
|
||||||
showDbsUploadDialog.value = true
|
showDbsUploadDialog.value = true
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.content {
|
.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.work-area {
|
.work-area {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
/* padding: 5px; */
|
/* padding: 5px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-area {
|
.search-area {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
min-height: fit-content;
|
min-height: fit-content;
|
||||||
max-height: 40%;
|
max-height: 40%;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
min-width: inherit;
|
min-width: inherit;
|
||||||
border: solid 1px;
|
border: solid 1px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-area {
|
.table-area {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
min-height: fit-content;
|
min-height: fit-content;
|
||||||
max-height: 60%;
|
max-height: 60%;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
min-width: inherit;
|
min-width: inherit;
|
||||||
border: solid 1px;
|
border: solid 1px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item {
|
.el-form-item {
|
||||||
margin: 5px 5px 5px 5px;
|
margin: 5px 5px 5px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item .el-input {
|
.el-form-item .el-input {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item .el-select-v2 {
|
.el-form-item .el-select-v2 {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-class {
|
.table-class {
|
||||||
margin: 5px 5px 5px 5px;
|
margin: 5px 5px 5px 5px;
|
||||||
width: inherit;
|
width: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-pagination {
|
.el-pagination {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li {
|
.my-autocomplete li {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
padding: 7px;
|
padding: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .name {
|
.my-autocomplete li .name {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .addr {
|
.my-autocomplete li .addr {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #b4b4b4;
|
color: #b4b4b4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .highlighted .addr {
|
.my-autocomplete li .highlighted .addr {
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .goods_id {
|
.my-autocomplete li .goods_id {
|
||||||
color: brown;
|
color: brown;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .goods_name {
|
.my-autocomplete li .goods_name {
|
||||||
color: cornflowerblue;
|
color: cornflowerblue;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-search {
|
.btn-search {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
width: 80px;
|
width: 80px;
|
||||||
margin: auto 5px 5px auto;
|
margin: auto 5px 5px auto;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -793,4 +793,9 @@ const getPrintTabs = (boxSummary) => {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dialog-footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -27,6 +27,7 @@ const routes = [
|
||||||
{ path: '/wmsLog', component: () => import('@/layout/wmsLog.vue') },// 日志
|
{ path: '/wmsLog', component: () => import('@/layout/wmsLog.vue') },// 日志
|
||||||
{ path: '/workSummary', component: () => import('@/layout/workSummary.vue') },// 工作总结
|
{ path: '/workSummary', component: () => import('@/layout/workSummary.vue') },// 工作总结
|
||||||
{ path: '/pickTask', component: () => import('@/layout/pickTaskMonitor.vue') },// 拣选任务
|
{ path: '/pickTask', component: () => import('@/layout/pickTaskMonitor.vue') },// 拣选任务
|
||||||
|
{ path: '/outsMonitor', component: () => import('@/layout/OutsMonitor.vue') },// 任务表单
|
||||||
{ path: '/clcKanban', component: () => import('@/layout/clcKanban.vue') },// 需求看板
|
{ path: '/clcKanban', component: () => import('@/layout/clcKanban.vue') },// 需求看板
|
||||||
{ path: '/stockUpdateRecord', component: () => import('@/layout/stockUpdateRecord.vue') },// 库存更新记录
|
{ path: '/stockUpdateRecord', component: () => import('@/layout/stockUpdateRecord.vue') },// 库存更新记录
|
||||||
{ path: '/roleUser', component: () => import('@/layout/role_user.vue') },// 角色——用户列表
|
{ path: '/roleUser', component: () => import('@/layout/role_user.vue') },// 角色——用户列表
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import moment from "moment";
|
||||||
import { revertSeconds } from '@/utils/dateUtils'
|
import { revertSeconds } from '@/utils/dateUtils'
|
||||||
// 时间格式化
|
// 时间格式化
|
||||||
export const timeFormatter = (date) => {
|
export const timeFormatter = (date) => {
|
||||||
if (date === null || date === undefined) {
|
if (date === null || date === undefined || date === '') {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
return moment(date).format('yyyy-MM-DD HH:mm:ss');
|
return moment(date).format('yyyy-MM-DD HH:mm:ss');
|
||||||
|
|
@ -24,13 +24,13 @@ export const dueFormatter = (date) => {
|
||||||
|
|
||||||
// 库位格式化
|
// 库位格式化
|
||||||
export const locationFormatter = (locationId) => {
|
export const locationFormatter = (locationId) => {
|
||||||
if (locationId === null || locationId == undefined) {
|
if (locationId === null || locationId === undefined || locationId === '') {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
const locationArray = locationId.split('-')
|
const locationArray = locationId.split('-')
|
||||||
if (locationArray.length == 3) {
|
if (locationArray.length === 3) {
|
||||||
return locationArray[0] + '排' + locationArray[1] + '列' + locationArray[2] + '层'
|
return locationArray[0] + '排' + locationArray[1] + '列' + locationArray[2] + '层'
|
||||||
} else if (locationArray.length == 4) {
|
} else if (locationArray.length === 4) {
|
||||||
return locationArray[0] + '排' + locationArray[1] + '列' + locationArray[2] + '层' + locationArray[3] + '深度'
|
return locationArray[0] + '排' + locationArray[1] + '列' + locationArray[2] + '层' + locationArray[3] + '深度'
|
||||||
} else {
|
} else {
|
||||||
return ''
|
return ''
|
||||||
|
|
@ -104,11 +104,11 @@ export const replaceEnglishAndNumberIGAI = (value) => {
|
||||||
}
|
}
|
||||||
// 是否格式化
|
// 是否格式化
|
||||||
export const yesOrNoFormatter = (value) => {
|
export const yesOrNoFormatter = (value) => {
|
||||||
return value == 1 ? '是' : '否'
|
return value === 1 ? '是' : '否'
|
||||||
}
|
}
|
||||||
// 反转是否格式化
|
// 反转是否格式化
|
||||||
export const converseYesOrNoFormatter = (value) => {
|
export const converseYesOrNoFormatter = (value) => {
|
||||||
return value == 0 ? '是' : '否'
|
return value === 0 ? '是' : '否'
|
||||||
}
|
}
|
||||||
// 任务类型格式化
|
// 任务类型格式化
|
||||||
export const wmsTaskTypeFormatter = (value) => {
|
export const wmsTaskTypeFormatter = (value) => {
|
||||||
|
|
@ -160,4 +160,44 @@ export const vehicleStatusFormatter = (value) => {
|
||||||
default:
|
default:
|
||||||
return '未知状态'
|
return '未知状态'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// 拣选任务状态
|
||||||
|
export const pickTaskStatusFormatter = (value) => {
|
||||||
|
switch (value) {
|
||||||
|
case -2:
|
||||||
|
return '入库用'
|
||||||
|
case -1:
|
||||||
|
return '暂存中'
|
||||||
|
case 0:
|
||||||
|
return '待下发'
|
||||||
|
case 1:
|
||||||
|
return '已下发'
|
||||||
|
case 2:
|
||||||
|
return '执行中'
|
||||||
|
case 3:
|
||||||
|
return '已到达'
|
||||||
|
case 4:
|
||||||
|
return '已离开'
|
||||||
|
case 5:
|
||||||
|
return '拣选取消'
|
||||||
|
default:
|
||||||
|
return '已取消'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 出库单类型格式化
|
||||||
|
export const outTaskTypeFormatter = (value) => {
|
||||||
|
switch (value) {
|
||||||
|
case 1:
|
||||||
|
return '空箱出库'
|
||||||
|
case 2:
|
||||||
|
return '普通出库'
|
||||||
|
case 4:
|
||||||
|
return '完整出库'
|
||||||
|
case 5:
|
||||||
|
return '入库使用'
|
||||||
|
case 9:
|
||||||
|
return '紧急出库'
|
||||||
|
default:
|
||||||
|
return '未知类型'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,13 +1,40 @@
|
||||||
package com.wms_main;
|
package com.wms_main;
|
||||||
|
|
||||||
|
import org.springframework.boot.ApplicationArguments;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统启动类
|
||||||
|
*/
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class WmsMainApplication {
|
public class WmsMainApplication {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于重启程序的上下文
|
||||||
|
*/
|
||||||
|
private static ConfigurableApplicationContext context;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主函数,程序的入口
|
||||||
|
*
|
||||||
|
* @param args 命令行参数,以字符串数组形式传入
|
||||||
|
*/
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(WmsMainApplication.class, args);
|
context = SpringApplication.run(WmsMainApplication.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重启程序
|
||||||
|
*/
|
||||||
|
public static void restart() {
|
||||||
|
ApplicationArguments args = context.getBean(ApplicationArguments.class);
|
||||||
|
Thread thread = new Thread(() -> {
|
||||||
|
context.close();
|
||||||
|
context = SpringApplication.run(WmsMainApplication.class, args.getSourceArgs());
|
||||||
|
});
|
||||||
|
thread.setDaemon(false);
|
||||||
|
thread.start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -202,4 +202,14 @@ public class KateWorkController {
|
||||||
WmsApiResponse<BoxSummary> requestPrintBoxTags(@RequestBody KateWorksQuery kateWorksQuery) {
|
WmsApiResponse<BoxSummary> requestPrintBoxTags(@RequestBody KateWorksQuery kateWorksQuery) {
|
||||||
return kateWorkControllerService.requestPrintBoxTags(kateWorksQuery);
|
return kateWorkControllerService.requestPrintBoxTags(kateWorksQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除当前dbs工单计划
|
||||||
|
* @param dbsRequest 关闭请求
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/deleteDbsPlan")
|
||||||
|
public BaseWmsApiResponse deleteDbsPlan(@RequestBody DbsRequest dbsRequest) {
|
||||||
|
return kateWorkControllerService.deleteDbsPlan(dbsRequest);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package com.wms_main.controller.wms;
|
package com.wms_main.controller.wms;
|
||||||
|
|
||||||
|
import com.wms_main.model.dto.request.wms.WmsTaskRequest;
|
||||||
|
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
||||||
|
import com.wms_main.service.controller.ITaskOperationControllerService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务操作控制类
|
* 任务操作控制类
|
||||||
|
|
@ -16,4 +16,25 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RequestMapping("/wms/taskOperation")
|
@RequestMapping("/wms/taskOperation")
|
||||||
public class TaskOperationController {
|
public class TaskOperationController {
|
||||||
|
private final ITaskOperationControllerService taskOperationControllerService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除任务
|
||||||
|
* @param wmsTaskRequest 请求
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/deleteWmsTask")
|
||||||
|
public BaseWmsApiResponse deleteWmsTask(@RequestBody WmsTaskRequest wmsTaskRequest) {
|
||||||
|
return taskOperationControllerService.deleteWmsTask(wmsTaskRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新任务
|
||||||
|
* @param wmsTaskRequest 请求
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/updateWmsTask")
|
||||||
|
public BaseWmsApiResponse updateWmsTask(@RequestBody WmsTaskRequest wmsTaskRequest) {
|
||||||
|
return taskOperationControllerService.updateWmsTask(wmsTaskRequest);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package com.wms_main.controller.wms;
|
package com.wms_main.controller.wms;
|
||||||
|
|
||||||
|
import com.wms_main.model.dto.query.OutsQuery;
|
||||||
|
import com.wms_main.model.dto.query.PickTaskQuery;
|
||||||
import com.wms_main.model.dto.query.WmsTaskQuery;
|
import com.wms_main.model.dto.query.WmsTaskQuery;
|
||||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
import com.wms_main.model.vo.wms.PageVo;
|
import com.wms_main.model.vo.wms.*;
|
||||||
import com.wms_main.model.vo.wms.TaskRecordVo;
|
|
||||||
import com.wms_main.model.vo.wms.TaskVo;
|
|
||||||
import com.wms_main.service.controller.ITaskQueryControllerService;
|
import com.wms_main.service.controller.ITaskQueryControllerService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
@ -53,4 +53,26 @@ public class TaskQueryController {
|
||||||
{
|
{
|
||||||
return taskQueryControllerService.queryOutTaskRecordByPage(wmsTaskQuery);
|
return taskQueryControllerService.queryOutTaskRecordByPage(wmsTaskQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wms拣选任务分页查询
|
||||||
|
* @param pickTaskQuery 查询参数
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/queryPickTasksByPage")
|
||||||
|
public WmsApiResponse<PageVo<PickTaskVo>> queryPickTasksByPage(@RequestBody PickTaskQuery pickTaskQuery)
|
||||||
|
{
|
||||||
|
return taskQueryControllerService.queryPickTasksByPage(pickTaskQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库单分页查询
|
||||||
|
* @param outsQuery 查询参数
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/queryOutsByPage")
|
||||||
|
public WmsApiResponse<PageVo<OutsVo>> queryOutsByPage(@RequestBody OutsQuery outsQuery)
|
||||||
|
{
|
||||||
|
return taskQueryControllerService.queryOutsByPage(outsQuery);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.wms_main.model.dto.query;
|
package com.wms_main.model.dto.query;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
@ -21,59 +22,72 @@ public class DbsQuery extends PageQuery {
|
||||||
/**
|
/**
|
||||||
* 主键id
|
* 主键id
|
||||||
*/
|
*/
|
||||||
|
@JsonProperty("dbsId")
|
||||||
private String dbsId;
|
private String dbsId;
|
||||||
/**
|
/**
|
||||||
* 工单
|
* 工单
|
||||||
*/
|
*/
|
||||||
|
@JsonProperty("workOrder")
|
||||||
private String workOrder;
|
private String workOrder;
|
||||||
/**
|
/**
|
||||||
* dbs原始未处理的零件号,成品号
|
* dbs原始未处理的零件号,成品号
|
||||||
*/
|
*/
|
||||||
|
@JsonProperty("productIdOrigin")
|
||||||
private String productIdOrigin;
|
private String productIdOrigin;
|
||||||
/**
|
/**
|
||||||
* 零件号,成品号
|
* 零件号,成品号
|
||||||
*/
|
*/
|
||||||
|
@JsonProperty("productId")
|
||||||
private String productId;
|
private String productId;
|
||||||
/**
|
/**
|
||||||
* 计划开始时间
|
* 计划开始时间
|
||||||
*/
|
*/
|
||||||
|
@JsonProperty("planStartDate")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
private LocalDate planStartDate;
|
private LocalDate planStartDate;
|
||||||
/**
|
/**
|
||||||
* 计划产量/套
|
* 计划产量/套
|
||||||
*/
|
*/
|
||||||
|
@JsonProperty("planProduction")
|
||||||
private Integer planProduction;
|
private Integer planProduction;
|
||||||
/**
|
/**
|
||||||
* Family
|
* Family
|
||||||
*/
|
*/
|
||||||
|
@JsonProperty("family")
|
||||||
private String family;
|
private String family;
|
||||||
/**
|
/**
|
||||||
* Test No#
|
* Test No#
|
||||||
*/
|
*/
|
||||||
|
@JsonProperty("testNo")
|
||||||
private String testNo;
|
private String testNo;
|
||||||
/**
|
/**
|
||||||
* 状态
|
* 状态
|
||||||
*/
|
*/
|
||||||
|
@JsonProperty("dbsStatus")
|
||||||
private Integer dbsStatus;
|
private Integer dbsStatus;
|
||||||
/**
|
/**
|
||||||
* 工作站台
|
* 工作站台
|
||||||
*/
|
*/
|
||||||
|
@JsonProperty("workStand")
|
||||||
private String workStand;
|
private String workStand;
|
||||||
/**
|
/**
|
||||||
* 实际工作日期
|
* 实际工作日期
|
||||||
*/
|
*/
|
||||||
|
@JsonProperty("realWorkDate")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
private LocalDate realWorkDate;
|
private LocalDate realWorkDate;
|
||||||
/**
|
/**
|
||||||
* 完成时间
|
* 完成时间
|
||||||
*/
|
*/
|
||||||
|
@JsonProperty("finishTime")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
|
||||||
private LocalDateTime finishTime;
|
private LocalDateTime finishTime;
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
@JsonProperty("remark")
|
||||||
private String remark;
|
private String remark;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
package com.wms_main.model.dto.query;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库单查询
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class OutsQuery extends PageQuery {
|
||||||
|
/**
|
||||||
|
* 任务号
|
||||||
|
*/
|
||||||
|
@JsonProperty("taskId")
|
||||||
|
private String taskId;
|
||||||
|
/**
|
||||||
|
* 料号
|
||||||
|
*/
|
||||||
|
@JsonProperty("goodsId")
|
||||||
|
private String goodsId;
|
||||||
|
/**
|
||||||
|
* 载具号
|
||||||
|
*/
|
||||||
|
@JsonProperty("vehicleId")
|
||||||
|
private String vehicleId;
|
||||||
|
/**
|
||||||
|
* 需求数量
|
||||||
|
*/
|
||||||
|
@JsonProperty("needNum")
|
||||||
|
private Integer needNum;
|
||||||
|
/**
|
||||||
|
* 已分发数量
|
||||||
|
*/
|
||||||
|
@JsonProperty("distributeNum")
|
||||||
|
private Integer distributeNum;
|
||||||
|
/**
|
||||||
|
* 已拣选数量
|
||||||
|
*/
|
||||||
|
@JsonProperty("pickNum")
|
||||||
|
private Integer pickNum;
|
||||||
|
/**
|
||||||
|
* 出库类型
|
||||||
|
*/
|
||||||
|
@JsonProperty("outType")
|
||||||
|
private Integer outType;
|
||||||
|
/**
|
||||||
|
* 目的地
|
||||||
|
*/
|
||||||
|
@JsonProperty("destination")
|
||||||
|
private String destination;
|
||||||
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
|
@JsonProperty("userName")
|
||||||
|
private String userName;
|
||||||
|
/**
|
||||||
|
* 出库理由
|
||||||
|
* 紧急出库必填
|
||||||
|
*/
|
||||||
|
@JsonProperty("reason")
|
||||||
|
private String reason;
|
||||||
|
/**
|
||||||
|
* 请求时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("requestTime")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime requestTime;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
package com.wms_main.model.dto.query;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拣选任务查询参数
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class PickTaskQuery extends PageQuery {
|
||||||
|
/**
|
||||||
|
* 任务id
|
||||||
|
*/
|
||||||
|
@JsonProperty("pickId")
|
||||||
|
private String pickId;
|
||||||
|
/**
|
||||||
|
* 拣选站台
|
||||||
|
*/
|
||||||
|
@JsonProperty("pickStand")
|
||||||
|
private String pickStand;
|
||||||
|
/**
|
||||||
|
* 载具号
|
||||||
|
*/
|
||||||
|
@JsonProperty("vehicleId")
|
||||||
|
private String vehicleId;
|
||||||
|
/**
|
||||||
|
* 任务状态
|
||||||
|
*/
|
||||||
|
@JsonProperty("pickStatus")
|
||||||
|
private Integer pickStatus;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("createTime")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
/**
|
||||||
|
* 发送时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("sendTime")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime sendTime;
|
||||||
|
/**
|
||||||
|
* 到达时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("arriveTime")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime arriveTime;
|
||||||
|
/**
|
||||||
|
* 离开时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("leaveTime")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime leaveTime;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
package com.wms_main.model.dto.request.wms;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dbs请求
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class DbsRequest extends BaseWmsRequest {
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
private String dbsId;
|
||||||
|
/**
|
||||||
|
* 工单
|
||||||
|
*/
|
||||||
|
private String workOrder;
|
||||||
|
/**
|
||||||
|
* dbs原始未处理的零件号,成品号
|
||||||
|
*/
|
||||||
|
private String productIdOrigin;
|
||||||
|
/**
|
||||||
|
* 零件号,成品号
|
||||||
|
*/
|
||||||
|
private String productId;
|
||||||
|
/**
|
||||||
|
* 计划开始时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate planStartDate;
|
||||||
|
/**
|
||||||
|
* 计划产量/套
|
||||||
|
*/
|
||||||
|
private Integer planProduction;
|
||||||
|
/**
|
||||||
|
* Family
|
||||||
|
*/
|
||||||
|
private String family;
|
||||||
|
/**
|
||||||
|
* Test No#
|
||||||
|
*/
|
||||||
|
private String testNo;
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private Integer dbsStatus;
|
||||||
|
/**
|
||||||
|
* 工作站台
|
||||||
|
*/
|
||||||
|
private String workStand;
|
||||||
|
/**
|
||||||
|
* 实际工作日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate realWorkDate;
|
||||||
|
/**
|
||||||
|
* 完成时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
|
||||||
|
private LocalDateTime finishTime;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,110 @@
|
||||||
|
package com.wms_main.model.dto.request.wms;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wms任务请求
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class WmsTaskRequest extends BaseWmsRequest {
|
||||||
|
/**
|
||||||
|
* 任务ID
|
||||||
|
*/
|
||||||
|
@JsonProperty("taskId")
|
||||||
|
private String taskId;
|
||||||
|
/**
|
||||||
|
* 任务类型
|
||||||
|
*/
|
||||||
|
@JsonProperty("taskType")
|
||||||
|
private Integer taskType;
|
||||||
|
/**
|
||||||
|
* 任务状态
|
||||||
|
*/
|
||||||
|
@JsonProperty("taskStatus")
|
||||||
|
private Integer taskStatus;
|
||||||
|
/**
|
||||||
|
* 任务优先级
|
||||||
|
*/
|
||||||
|
@JsonProperty("taskPriority")
|
||||||
|
private Integer taskPriority;
|
||||||
|
/**
|
||||||
|
* 载具号
|
||||||
|
*/
|
||||||
|
@JsonProperty("vehicleId")
|
||||||
|
private String vehicleId;
|
||||||
|
/**
|
||||||
|
* 起点
|
||||||
|
*/
|
||||||
|
@JsonProperty("origin")
|
||||||
|
private String origin;
|
||||||
|
/**
|
||||||
|
* 终点
|
||||||
|
*/
|
||||||
|
@JsonProperty("destination")
|
||||||
|
private String destination;
|
||||||
|
/**
|
||||||
|
* wcs任务id
|
||||||
|
*/
|
||||||
|
@JsonProperty("wcsTaskId")
|
||||||
|
private String wcsTaskId;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("createTime")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
/**
|
||||||
|
* 完成时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("finishTime")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime finishTime;
|
||||||
|
/**
|
||||||
|
* 料号
|
||||||
|
*/
|
||||||
|
@JsonProperty("goodsId")
|
||||||
|
private String goodsId;
|
||||||
|
/**
|
||||||
|
* 操作数量
|
||||||
|
*/
|
||||||
|
@JsonProperty("opNum")
|
||||||
|
private Integer opNum;
|
||||||
|
/**
|
||||||
|
* 库存数量
|
||||||
|
*/
|
||||||
|
@JsonProperty("stockNum")
|
||||||
|
private Integer stockNum;
|
||||||
|
/**
|
||||||
|
* 操纵用户
|
||||||
|
*/
|
||||||
|
@JsonProperty("opUser")
|
||||||
|
private String opUser;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@JsonProperty("remark")
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 申请出库的站台
|
||||||
|
*/
|
||||||
|
@JsonProperty("callStand")
|
||||||
|
private String callStand;
|
||||||
|
/**
|
||||||
|
* 物料描述
|
||||||
|
*/
|
||||||
|
@JsonProperty("goodsDesc")
|
||||||
|
private String goodsDesc;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,102 @@
|
||||||
|
package com.wms_main.model.vo.wms;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.wms_main.model.po.TAppOuts;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库单Vo
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class OutsVo {
|
||||||
|
/**
|
||||||
|
* 任务号
|
||||||
|
*/
|
||||||
|
@JsonProperty("taskId")
|
||||||
|
private String taskId;
|
||||||
|
/**
|
||||||
|
* 料号
|
||||||
|
*/
|
||||||
|
@JsonProperty("goodsId")
|
||||||
|
private String goodsId;
|
||||||
|
/**
|
||||||
|
* 载具号
|
||||||
|
*/
|
||||||
|
@JsonProperty("vehicleId")
|
||||||
|
private String vehicleId;
|
||||||
|
/**
|
||||||
|
* 需求数量
|
||||||
|
*/
|
||||||
|
@JsonProperty("needNum")
|
||||||
|
private Integer needNum;
|
||||||
|
/**
|
||||||
|
* 已分发数量
|
||||||
|
*/
|
||||||
|
@JsonProperty("distributeNum")
|
||||||
|
private Integer distributeNum;
|
||||||
|
/**
|
||||||
|
* 已拣选数量
|
||||||
|
*/
|
||||||
|
@JsonProperty("pickNum")
|
||||||
|
private Integer pickNum;
|
||||||
|
/**
|
||||||
|
* 出库类型
|
||||||
|
*/
|
||||||
|
@JsonProperty("outType")
|
||||||
|
private Integer outType;
|
||||||
|
/**
|
||||||
|
* 目的地
|
||||||
|
*/
|
||||||
|
@JsonProperty("destination")
|
||||||
|
private String destination;
|
||||||
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
|
@JsonProperty("userName")
|
||||||
|
private String userName;
|
||||||
|
/**
|
||||||
|
* 出库理由
|
||||||
|
* 紧急出库必填
|
||||||
|
*/
|
||||||
|
@JsonProperty("reason")
|
||||||
|
private String reason;
|
||||||
|
/**
|
||||||
|
* 请求时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("requestTime")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime requestTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将po转换为vo
|
||||||
|
* @param po 数据库实体
|
||||||
|
* @return 转化结果
|
||||||
|
*/
|
||||||
|
public static OutsVo of(TAppOuts po) {
|
||||||
|
if (po == null) {
|
||||||
|
return new OutsVo();
|
||||||
|
}
|
||||||
|
return new OutsVo(
|
||||||
|
po.getTaskId(),
|
||||||
|
po.getGoodsId(),
|
||||||
|
po.getVehicleId(),
|
||||||
|
po.getNeedNum(),
|
||||||
|
po.getDistributeNum(),
|
||||||
|
po.getPickNum(),
|
||||||
|
po.getOutType(),
|
||||||
|
po.getDestination(),
|
||||||
|
po.getUserName(),
|
||||||
|
po.getReason(),
|
||||||
|
po.getRequestTime()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,89 @@
|
||||||
|
package com.wms_main.model.vo.wms;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.wms_main.model.po.TAppPickTask;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拣选任务Vo
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class PickTaskVo {
|
||||||
|
/**
|
||||||
|
* 任务id
|
||||||
|
*/
|
||||||
|
@JsonProperty("pickId")
|
||||||
|
private String pickId;
|
||||||
|
/**
|
||||||
|
* 拣选站台
|
||||||
|
*/
|
||||||
|
@JsonProperty("pickStand")
|
||||||
|
private String pickStand;
|
||||||
|
/**
|
||||||
|
* 载具号
|
||||||
|
*/
|
||||||
|
@JsonProperty("vehicleId")
|
||||||
|
private String vehicleId;
|
||||||
|
/**
|
||||||
|
* 任务状态
|
||||||
|
*/
|
||||||
|
@JsonProperty("pickStatus")
|
||||||
|
private Integer pickStatus;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("createTime")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
/**
|
||||||
|
* 发送时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("sendTime")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime sendTime;
|
||||||
|
/**
|
||||||
|
* 到达时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("arriveTime")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime arriveTime;
|
||||||
|
/**
|
||||||
|
* 离开时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("leaveTime")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime leaveTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将Po转化为Vo
|
||||||
|
* @param po 数据库实体
|
||||||
|
* @return 转化结果
|
||||||
|
*/
|
||||||
|
public static PickTaskVo of(TAppPickTask po) {
|
||||||
|
if (po == null) {
|
||||||
|
return new PickTaskVo();
|
||||||
|
}
|
||||||
|
return new PickTaskVo(
|
||||||
|
po.getPickId(),
|
||||||
|
po.getPickStand(),
|
||||||
|
po.getVehicleId(),
|
||||||
|
po.getPickStatus(),
|
||||||
|
po.getCreateTime(),
|
||||||
|
po.getSendTime(),
|
||||||
|
po.getArriveTime(),
|
||||||
|
po.getLeaveTime()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -105,7 +105,7 @@ public class TaskVo {
|
||||||
* 物料描述
|
* 物料描述
|
||||||
*/
|
*/
|
||||||
@JsonProperty("goodsDesc")
|
@JsonProperty("goodsDesc")
|
||||||
private String goodsDesc;
|
private String goodsDesc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将po转换为vo
|
* 将po转换为vo
|
||||||
|
|
|
||||||
|
|
@ -138,4 +138,11 @@ public interface IKateWorkControllerService {
|
||||||
* @return 需要打印的料盒标签
|
* @return 需要打印的料盒标签
|
||||||
*/
|
*/
|
||||||
WmsApiResponse<BoxSummary> requestPrintBoxTags(KateWorksQuery kateWorksQuery);
|
WmsApiResponse<BoxSummary> requestPrintBoxTags(KateWorksQuery kateWorksQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除dbs计划
|
||||||
|
* @param dbsRequest 删除请求
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
BaseWmsApiResponse deleteDbsPlan(DbsRequest dbsRequest);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,23 @@
|
||||||
package com.wms_main.service.controller;
|
package com.wms_main.service.controller;
|
||||||
|
|
||||||
|
import com.wms_main.model.dto.request.wms.WmsTaskRequest;
|
||||||
|
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务操作控制类 服务接口
|
* 任务操作控制类 服务接口
|
||||||
*/
|
*/
|
||||||
public interface ITaskOperationControllerService {
|
public interface ITaskOperationControllerService {
|
||||||
|
/**
|
||||||
|
* 删除Wms任务
|
||||||
|
* @param wmsTaskRequest 请求参数
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
BaseWmsApiResponse deleteWmsTask(WmsTaskRequest wmsTaskRequest);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新Wms任务
|
||||||
|
* @param wmsTaskRequest 请求参数
|
||||||
|
* @return 更新结果
|
||||||
|
*/
|
||||||
|
BaseWmsApiResponse updateWmsTask(WmsTaskRequest wmsTaskRequest);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package com.wms_main.service.controller;
|
package com.wms_main.service.controller;
|
||||||
|
|
||||||
|
import com.wms_main.model.dto.query.OutsQuery;
|
||||||
|
import com.wms_main.model.dto.query.PickTaskQuery;
|
||||||
import com.wms_main.model.dto.query.WmsTaskQuery;
|
import com.wms_main.model.dto.query.WmsTaskQuery;
|
||||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
import com.wms_main.model.vo.wms.PageVo;
|
import com.wms_main.model.vo.wms.*;
|
||||||
import com.wms_main.model.vo.wms.TaskRecordVo;
|
|
||||||
import com.wms_main.model.vo.wms.TaskVo;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务查询控制类 服务接口
|
* 任务查询控制类 服务接口
|
||||||
|
|
@ -30,4 +30,18 @@ public interface ITaskQueryControllerService {
|
||||||
* @return 查询结果---分页
|
* @return 查询结果---分页
|
||||||
*/
|
*/
|
||||||
WmsApiResponse<PageVo<TaskRecordVo>> queryOutTaskRecordByPage(WmsTaskQuery wmsTaskQuery);
|
WmsApiResponse<PageVo<TaskRecordVo>> queryOutTaskRecordByPage(WmsTaskQuery wmsTaskQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询拣选任务信息---分页
|
||||||
|
* @param pickTaskQuery 查询参数
|
||||||
|
* @return 查询结果---分页
|
||||||
|
*/
|
||||||
|
WmsApiResponse<PageVo<PickTaskVo>> queryPickTasksByPage(PickTaskQuery pickTaskQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询出库单信息---分页
|
||||||
|
* @param outsQuery 查询参数
|
||||||
|
* @return 查询结果---分页
|
||||||
|
*/
|
||||||
|
WmsApiResponse<PageVo<OutsVo>> queryOutsByPage(OutsQuery outsQuery);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1192,6 +1192,38 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
||||||
return WmsApiResponse.success("获取料盒标签数据成功。", boxSummary);
|
return WmsApiResponse.success("获取料盒标签数据成功。", boxSummary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除dbs计划---实现
|
||||||
|
* @param dbsRequest 删除请求
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public BaseWmsApiResponse deleteDbsPlan(DbsRequest dbsRequest) {
|
||||||
|
if (dbsRequest == null) {
|
||||||
|
// 请求为空
|
||||||
|
return BaseWmsApiResponse.error("请求为空。");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(dbsRequest.getDbsId()) && StringUtils.isEmpty(dbsRequest.getWorkOrder())) {
|
||||||
|
return BaseWmsApiResponse.error("dbsId、工单号必须输入一个。");
|
||||||
|
}
|
||||||
|
// 查询对应的dbs信息
|
||||||
|
List<TAppDbs> targetDbsList = appDbsService.list(new LambdaQueryWrapper<TAppDbs>()
|
||||||
|
.eq(StringUtils.isNotEmpty(dbsRequest.getDbsId()), TAppDbs::getDbsId, dbsRequest.getDbsId())
|
||||||
|
.eq(StringUtils.isNotEmpty(dbsRequest.getWorkOrder()), TAppDbs::getWorkOrder, dbsRequest.getWorkOrder()));
|
||||||
|
if (targetDbsList == null || targetDbsList.isEmpty()) {
|
||||||
|
// 未查询到对应的dbs信息
|
||||||
|
return BaseWmsApiResponse.error("未查询到对应的dbs信息。");
|
||||||
|
}
|
||||||
|
TAppDbs targetDbs = targetDbsList.getFirst();
|
||||||
|
if (!Objects.equals(targetDbs.getDbsStatus(), DbsStatusEnums.NEW.getValue())) {
|
||||||
|
// 当前dbs状态为关闭
|
||||||
|
return BaseWmsApiResponse.error("当前DBS已经在做,无法删除。");
|
||||||
|
}
|
||||||
|
// 删除dbs
|
||||||
|
return appDbsService.removeById(targetDbs.getDbsId()) ? BaseWmsApiResponse.success("删除DBS成功。") : BaseWmsApiResponse.error("删除DBS失败。");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取服务件成品号的物料需求
|
* 获取服务件成品号的物料需求
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,28 @@
|
||||||
package com.wms_main.service.controller.serviceImpl;
|
package com.wms_main.service.controller.serviceImpl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.wms_main.constant.enums.wcs.WcsStackerTaskStatusEnums;
|
||||||
|
import com.wms_main.constant.enums.wms.WmsStackerTaskStatusEnums;
|
||||||
|
import com.wms_main.dao.ITAppTaskBakService;
|
||||||
|
import com.wms_main.dao.ITAppTaskService;
|
||||||
|
import com.wms_main.dao.ITAppWcsTaskBakService;
|
||||||
|
import com.wms_main.dao.ITAppWcsTaskService;
|
||||||
|
import com.wms_main.model.dto.request.wms.WmsTaskRequest;
|
||||||
|
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
||||||
|
import com.wms_main.model.po.TAppTask;
|
||||||
|
import com.wms_main.model.po.TAppTaskBak;
|
||||||
|
import com.wms_main.model.po.TAppWcsTask;
|
||||||
|
import com.wms_main.model.po.TAppWcsTaskBak;
|
||||||
|
import com.wms_main.repository.utils.ConvertUtils;
|
||||||
|
import com.wms_main.repository.utils.StringUtils;
|
||||||
import com.wms_main.service.controller.ITaskOperationControllerService;
|
import com.wms_main.service.controller.ITaskOperationControllerService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务操作控制类 服务实现
|
* 任务操作控制类 服务实现
|
||||||
|
|
@ -10,5 +30,170 @@ import org.springframework.stereotype.Service;
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class TaskOperationControllerServiceImpl implements ITaskOperationControllerService {
|
public class TaskOperationControllerServiceImpl implements ITaskOperationControllerService {
|
||||||
|
private final ITAppTaskService appTaskService;// wms任务服务
|
||||||
|
private final ITAppTaskBakService appTaskBakService;// wms任务记录服务
|
||||||
|
private final ITAppWcsTaskService appWcsTaskService;// wcs任务服务
|
||||||
|
private final ITAppWcsTaskBakService appWcsTaskBakService;// wcs任务记录服务
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除wms任务
|
||||||
|
* @param wmsTaskRequest 请求参数
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BaseWmsApiResponse deleteWmsTask(WmsTaskRequest wmsTaskRequest) {
|
||||||
|
if (wmsTaskRequest == null) {
|
||||||
|
return BaseWmsApiResponse.error("请求参数不能为NULL");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(wmsTaskRequest.getTaskId())) {
|
||||||
|
return BaseWmsApiResponse.error("请求参数不完整,缺少taskId。");
|
||||||
|
}
|
||||||
|
// 查询对应的任务
|
||||||
|
List<TAppTask> tasks = appTaskService.list(new LambdaQueryWrapper<TAppTask>()
|
||||||
|
.eq(TAppTask::getTaskId, wmsTaskRequest.getTaskId()));
|
||||||
|
if (tasks == null || tasks.isEmpty()) {
|
||||||
|
return BaseWmsApiResponse.error("未查询到对应的任务");
|
||||||
|
}
|
||||||
|
TAppTask targetTask = tasks.getFirst();
|
||||||
|
return appTaskService.removeById(targetTask.getTaskId()) ? BaseWmsApiResponse.success("删除任务成功。") : BaseWmsApiResponse.error("删除任务失败。");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新wms任务
|
||||||
|
* @param wmsTaskRequest 请求参数
|
||||||
|
* @return 更新结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public BaseWmsApiResponse updateWmsTask(WmsTaskRequest wmsTaskRequest) {
|
||||||
|
if (wmsTaskRequest == null) {
|
||||||
|
return BaseWmsApiResponse.error("请求参数不能为NULL");
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty(wmsTaskRequest.getTaskId())) {
|
||||||
|
return BaseWmsApiResponse.error("请求参数不完整,缺少taskId。");
|
||||||
|
}
|
||||||
|
// 查询对应的任务
|
||||||
|
List<TAppTask> tasks = appTaskService.list(new LambdaQueryWrapper<TAppTask>()
|
||||||
|
.eq(TAppTask::getTaskId, wmsTaskRequest.getTaskId()));
|
||||||
|
if (tasks == null || tasks.isEmpty()) {
|
||||||
|
return BaseWmsApiResponse.error("未查询到对应的任务");
|
||||||
|
}
|
||||||
|
TAppTask targetTask = tasks.getFirst();
|
||||||
|
// 更新除任务状态之外的其他信息
|
||||||
|
updateDetailInfoExceptStatus(targetTask, wmsTaskRequest);
|
||||||
|
// 判断任务状态是否变更
|
||||||
|
if (!Objects.equals(targetTask.getTaskStatus(), wmsTaskRequest.getTaskStatus())) {
|
||||||
|
// 如果是取消任务
|
||||||
|
if (Objects.equals(wmsTaskRequest.getTaskStatus(), WmsStackerTaskStatusEnums.CANCEL.getCode())) {
|
||||||
|
// 判断当前任务状态是已发送、正在执行、已完成状态,那么不允许修改状态
|
||||||
|
if (!Objects.equals(targetTask.getTaskStatus(), WmsStackerTaskStatusEnums.TEMP.getCode()) &&
|
||||||
|
!Objects.equals(targetTask.getTaskStatus(), WmsStackerTaskStatusEnums.WAIT.getCode())) {
|
||||||
|
return BaseWmsApiResponse.error("当前任务已生成wcs任务,如需取消,请先取消对应的wcs任务。");
|
||||||
|
}
|
||||||
|
// 将这个载具的任务删除,并存进备份表
|
||||||
|
List<TAppTask> thisVehicleTasks = appTaskService.list(new LambdaQueryWrapper<TAppTask>()
|
||||||
|
.eq(TAppTask::getVehicleId, targetTask.getVehicleId())
|
||||||
|
.eq(TAppTask::getTaskType, targetTask.getTaskType()));
|
||||||
|
List<TAppTaskBak> thisVehicleTasksBak = thisVehicleTasks.stream()
|
||||||
|
.map(task -> new TAppTaskBak(
|
||||||
|
task.getTaskId(),
|
||||||
|
task.getTaskType(),
|
||||||
|
WmsStackerTaskStatusEnums.CANCEL.getCode(),
|
||||||
|
task.getTaskPriority(),
|
||||||
|
task.getVehicleId(),
|
||||||
|
task.getOrigin(),
|
||||||
|
task.getDestination(),
|
||||||
|
task.getWcsTaskId(),
|
||||||
|
task.getCreateTime(),
|
||||||
|
task.getFinishTime(),
|
||||||
|
task.getGoodsId(),
|
||||||
|
task.getOpNum(),
|
||||||
|
task.getStockNum(),
|
||||||
|
task.getOpUser(),
|
||||||
|
task.getRemark(),
|
||||||
|
task.getCallStand(),
|
||||||
|
task.getGoodsDesc()
|
||||||
|
)).toList();
|
||||||
|
if (appTaskService.removeByIds(thisVehicleTasks.stream().map(TAppTask::getTaskId).toList())) {
|
||||||
|
return appTaskBakService.saveBatch(thisVehicleTasksBak) ? BaseWmsApiResponse.success("取消任务成功。") : BaseWmsApiResponse.error("取消任务失败,添加任务记录失败。");
|
||||||
|
} else {
|
||||||
|
return BaseWmsApiResponse.error("取消任务失败,删除任务失败。");
|
||||||
|
}
|
||||||
|
} else if (Objects.equals(wmsTaskRequest.getTaskStatus(), WmsStackerTaskStatusEnums.FINISH.getCode())) {
|
||||||
|
// 将对应的wcs任务完成,并存进备份表
|
||||||
|
List<TAppWcsTask> wcsTasks = appWcsTaskService.list(new LambdaQueryWrapper<TAppWcsTask>()
|
||||||
|
.eq(TAppWcsTask::getWcsTaskId, targetTask.getWcsTaskId()));
|
||||||
|
if (wcsTasks != null && !wcsTasks.isEmpty()) {
|
||||||
|
TAppWcsTask wcsTask = wcsTasks.getFirst();
|
||||||
|
// 移除wcs任务,并向wcs备份表添加记录
|
||||||
|
TAppWcsTaskBak wcsTaskBak = new TAppWcsTaskBak(
|
||||||
|
wcsTask.getWcsTaskId(),
|
||||||
|
WcsStackerTaskStatusEnums.FINISH.getCode(),
|
||||||
|
wcsTask.getWcsTaskType(),
|
||||||
|
wcsTask.getTaskPriority(),
|
||||||
|
wcsTask.getVehicleId(),
|
||||||
|
wcsTask.getOrigin(),
|
||||||
|
wcsTask.getDestination(),
|
||||||
|
wcsTask.getCreateTime(),
|
||||||
|
wcsTask.getSendTime(),
|
||||||
|
wcsTask.getFinishTime(),
|
||||||
|
wmsTaskRequest.getUserName() + "手动完成"
|
||||||
|
);
|
||||||
|
appWcsTaskService.removeById(wcsTask.getWcsTaskId());
|
||||||
|
appWcsTaskBakService.save(wcsTaskBak);
|
||||||
|
}
|
||||||
|
// 更新这个箱子的任务为完成状态
|
||||||
|
appTaskService.update(
|
||||||
|
new LambdaUpdateWrapper<TAppTask>()
|
||||||
|
.set(TAppTask::getTaskStatus, WmsStackerTaskStatusEnums.FINISH.getCode())
|
||||||
|
.eq(TAppTask::getTaskType, targetTask.getTaskType())
|
||||||
|
.eq(TAppTask::getVehicleId, targetTask.getVehicleId())
|
||||||
|
);
|
||||||
|
return BaseWmsApiResponse.success("完成任务成功。");
|
||||||
|
} else {
|
||||||
|
// 更新任务状态
|
||||||
|
targetTask.setTaskStatus(wmsTaskRequest.getTaskStatus());
|
||||||
|
// 更新任务信息
|
||||||
|
appTaskService.updateById(targetTask);
|
||||||
|
// 更新这个箱子其他任务的状态
|
||||||
|
appTaskService.update(
|
||||||
|
new LambdaUpdateWrapper<TAppTask>()
|
||||||
|
.set(TAppTask::getTaskStatus, wmsTaskRequest.getTaskStatus())
|
||||||
|
.eq(TAppTask::getTaskType, targetTask.getTaskType())
|
||||||
|
.eq(TAppTask::getVehicleId, targetTask.getVehicleId())
|
||||||
|
.ne(TAppTask::getTaskId, targetTask.getTaskId())
|
||||||
|
);
|
||||||
|
// 转化wcs任务状态
|
||||||
|
Integer wcsTaskStatus = ConvertUtils.convertWmsTaskStatusToWcsStackerTaskStatus(wmsTaskRequest.getTaskStatus());
|
||||||
|
appWcsTaskService.update(new LambdaUpdateWrapper<TAppWcsTask>()
|
||||||
|
.set(TAppWcsTask::getWcsTaskStatus, wcsTaskStatus)
|
||||||
|
.eq(TAppWcsTask::getWcsTaskId, targetTask.getWcsTaskId()));
|
||||||
|
return BaseWmsApiResponse.success("更新任务信息成功。");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 只更新数据
|
||||||
|
return appTaskService.updateById(targetTask) ? BaseWmsApiResponse.success("更新任务信息成功。") : BaseWmsApiResponse.error("更新任务信息失败。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新详情
|
||||||
|
* @param targetTask 目标任务
|
||||||
|
* @param wmsTaskRequest 请求信息
|
||||||
|
*/
|
||||||
|
private void updateDetailInfoExceptStatus(TAppTask targetTask, WmsTaskRequest wmsTaskRequest) {
|
||||||
|
targetTask.setTaskType(wmsTaskRequest.getTaskType());
|
||||||
|
targetTask.setTaskPriority(wmsTaskRequest.getTaskPriority());
|
||||||
|
targetTask.setVehicleId(wmsTaskRequest.getVehicleId());
|
||||||
|
targetTask.setOrigin(wmsTaskRequest.getOrigin());
|
||||||
|
targetTask.setDestination(wmsTaskRequest.getDestination());
|
||||||
|
targetTask.setWcsTaskId(wmsTaskRequest.getWcsTaskId());
|
||||||
|
targetTask.setGoodsId(wmsTaskRequest.getGoodsId());
|
||||||
|
targetTask.setOpNum(wmsTaskRequest.getOpNum());
|
||||||
|
targetTask.setStockNum(wmsTaskRequest.getStockNum());
|
||||||
|
targetTask.setOpUser(wmsTaskRequest.getOpUser());
|
||||||
|
targetTask.setRemark(wmsTaskRequest.getRemark());
|
||||||
|
targetTask.setCallStand(wmsTaskRequest.getCallStand());
|
||||||
|
targetTask.setGoodsDesc(wmsTaskRequest.getGoodsDesc());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,19 @@ package com.wms_main.service.controller.serviceImpl;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.wms_main.constant.enums.wms.WmsTaskTypeEnums;
|
import com.wms_main.constant.enums.wms.WmsTaskTypeEnums;
|
||||||
|
import com.wms_main.dao.ITAppOutsService;
|
||||||
|
import com.wms_main.dao.ITAppPickTaskService;
|
||||||
import com.wms_main.dao.ITAppTaskBakService;
|
import com.wms_main.dao.ITAppTaskBakService;
|
||||||
import com.wms_main.dao.ITAppTaskService;
|
import com.wms_main.dao.ITAppTaskService;
|
||||||
|
import com.wms_main.model.dto.query.OutsQuery;
|
||||||
|
import com.wms_main.model.dto.query.PickTaskQuery;
|
||||||
import com.wms_main.model.dto.query.WmsTaskQuery;
|
import com.wms_main.model.dto.query.WmsTaskQuery;
|
||||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
|
import com.wms_main.model.po.TAppOuts;
|
||||||
|
import com.wms_main.model.po.TAppPickTask;
|
||||||
import com.wms_main.model.po.TAppTask;
|
import com.wms_main.model.po.TAppTask;
|
||||||
import com.wms_main.model.po.TAppTaskBak;
|
import com.wms_main.model.po.TAppTaskBak;
|
||||||
import com.wms_main.model.vo.wms.PageVo;
|
import com.wms_main.model.vo.wms.*;
|
||||||
import com.wms_main.model.vo.wms.TaskRecordVo;
|
|
||||||
import com.wms_main.model.vo.wms.TaskVo;
|
|
||||||
import com.wms_main.repository.utils.StringUtils;
|
import com.wms_main.repository.utils.StringUtils;
|
||||||
import com.wms_main.service.controller.ITaskQueryControllerService;
|
import com.wms_main.service.controller.ITaskQueryControllerService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
@ -25,6 +29,8 @@ import org.springframework.stereotype.Service;
|
||||||
public class TaskQueryControllerServiceImpl implements ITaskQueryControllerService {
|
public class TaskQueryControllerServiceImpl implements ITaskQueryControllerService {
|
||||||
private final ITAppTaskService appTaskService;// 任务服务
|
private final ITAppTaskService appTaskService;// 任务服务
|
||||||
private final ITAppTaskBakService appTaskBakService;// 任务记录服务
|
private final ITAppTaskBakService appTaskBakService;// 任务记录服务
|
||||||
|
private final ITAppPickTaskService appPickTaskService;// 拣选任务服务
|
||||||
|
private final ITAppOutsService appOutsService;// 出库单服务
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询wms任务监控---分页
|
* 查询wms任务监控---分页
|
||||||
|
|
@ -114,4 +120,48 @@ public class TaskQueryControllerServiceImpl implements ITaskQueryControllerServi
|
||||||
PageVo<TaskRecordVo> pageVo = PageVo.of(outTaskRecordsPage, TaskRecordVo::of);
|
PageVo<TaskRecordVo> pageVo = PageVo.of(outTaskRecordsPage, TaskRecordVo::of);
|
||||||
return WmsApiResponse.success("查询出库记录成功。", pageVo);
|
return WmsApiResponse.success("查询出库记录成功。", pageVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询拣选任务---实现
|
||||||
|
* @param pickTaskQuery 查询参数
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WmsApiResponse<PageVo<PickTaskVo>> queryPickTasksByPage(PickTaskQuery pickTaskQuery) {
|
||||||
|
if (pickTaskQuery == null) {
|
||||||
|
return WmsApiResponse.error("查询参数不能为NULL", null);
|
||||||
|
}
|
||||||
|
Page<TAppPickTask> page = pickTaskQuery.toMpPage();
|
||||||
|
LambdaQueryWrapper<TAppPickTask> lambdaQueryWrapper = new LambdaQueryWrapper<TAppPickTask>()
|
||||||
|
.like(StringUtils.isNotEmpty(pickTaskQuery.getPickId()), TAppPickTask::getPickId, pickTaskQuery.getPickId())
|
||||||
|
.like(StringUtils.isNotEmpty(pickTaskQuery.getPickStand()), TAppPickTask::getPickStand, pickTaskQuery.getPickStand())
|
||||||
|
.like(StringUtils.isNotEmpty(pickTaskQuery.getVehicleId()), TAppPickTask::getVehicleId, pickTaskQuery.getVehicleId())
|
||||||
|
.eq(pickTaskQuery.getPickStatus() != null, TAppPickTask::getPickStatus, pickTaskQuery.getPickStatus());
|
||||||
|
Page<TAppPickTask> tasksPage = appPickTaskService.page(page, lambdaQueryWrapper);
|
||||||
|
|
||||||
|
PageVo<PickTaskVo> pageVo = PageVo.of(tasksPage, PickTaskVo::of);
|
||||||
|
return WmsApiResponse.success("查询拣选任务成功。", pageVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询出库单---实现
|
||||||
|
* @param outsQuery 查询参数
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WmsApiResponse<PageVo<OutsVo>> queryOutsByPage(OutsQuery outsQuery) {
|
||||||
|
if (outsQuery == null) {
|
||||||
|
return WmsApiResponse.error("查询参数不能为NULL", null);
|
||||||
|
}
|
||||||
|
Page<TAppOuts> page = outsQuery.toMpPage();
|
||||||
|
LambdaQueryWrapper<TAppOuts> lambdaQueryWrapper = new LambdaQueryWrapper<TAppOuts>()
|
||||||
|
.like(StringUtils.isNotEmpty(outsQuery.getTaskId()), TAppOuts::getTaskId, outsQuery.getTaskId())
|
||||||
|
.like(StringUtils.isNotEmpty(outsQuery.getGoodsId()), TAppOuts::getGoodsId, outsQuery.getGoodsId())
|
||||||
|
.like(StringUtils.isNotEmpty(outsQuery.getVehicleId()), TAppOuts::getVehicleId, outsQuery.getVehicleId())
|
||||||
|
.eq(outsQuery.getOutType() != null, TAppOuts::getOutType, outsQuery.getOutType());
|
||||||
|
Page<TAppOuts> outsPage = appOutsService.page(page, lambdaQueryWrapper);
|
||||||
|
|
||||||
|
PageVo<OutsVo> pageVo = PageVo.of(outsPage, OutsVo::of);
|
||||||
|
return WmsApiResponse.success("查询出库单成功。", pageVo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ public class WmsTaskFinisher implements Job {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void execute(JobExecutionContext jobExecutionContext) {
|
public void execute(JobExecutionContext jobExecutionContext) {
|
||||||
// 获取到所有待下发的任务
|
// 获取到所有已完成的任务
|
||||||
List<TAppTask> waitFinishWmsTaskList = appTaskService.list(
|
List<TAppTask> waitFinishWmsTaskList = appTaskService.list(
|
||||||
new LambdaQueryWrapper<TAppTask>()
|
new LambdaQueryWrapper<TAppTask>()
|
||||||
.eq(TAppTask::getTaskStatus, WmsStackerTaskStatusEnums.FINISH.getCode())
|
.eq(TAppTask::getTaskStatus, WmsStackerTaskStatusEnums.FINISH.getCode())
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.wms_main.service.system;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统服务接口
|
||||||
|
*/
|
||||||
|
public interface ISystemService {
|
||||||
|
/**
|
||||||
|
* 重启系统
|
||||||
|
*/
|
||||||
|
boolean restartSystem();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重新加载配置
|
||||||
|
*/
|
||||||
|
boolean reloadConfig();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.wms_main.service.system.serviceImpl;
|
||||||
|
|
||||||
|
import com.wms_main.WmsMainApplication;
|
||||||
|
import com.wms_main.app.AppCommon;
|
||||||
|
import com.wms_main.dao.ITAppConfigService;
|
||||||
|
import com.wms_main.service.system.ISystemService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统服务接口实现
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class SystemServiceImpl implements ISystemService {
|
||||||
|
/**
|
||||||
|
* 应用共通数据
|
||||||
|
*/
|
||||||
|
private final AppCommon appCommon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重启系统
|
||||||
|
* @return 重启结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean restartSystem() {
|
||||||
|
try {
|
||||||
|
WmsMainApplication.restart();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重载配置
|
||||||
|
* @return 重载结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean reloadConfig() {
|
||||||
|
return appCommon.initConfigMap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -9,13 +9,13 @@ spring:
|
||||||
# username: developer
|
# username: developer
|
||||||
# password: developer
|
# password: developer
|
||||||
# 本地
|
# 本地
|
||||||
# url: jdbc:mysql://localhost:3306/wms_kate_wuxi?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
url: jdbc:mysql://localhost:3306/wms_kate_wuxi?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||||
# username: root
|
username: root
|
||||||
# password: liangzhou
|
password: liangzhou
|
||||||
# 卡特服务器
|
# 卡特服务器
|
||||||
url: jdbc:mysql://10.90.83.37:3306/wms_kate_wuxi?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
# url: jdbc:mysql://10.90.83.37:3306/wms_kate_wuxi?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||||
username: developer
|
# username: developer
|
||||||
password: baokai
|
# password: baokai
|
||||||
|
|
||||||
profiles:
|
profiles:
|
||||||
active: online
|
active: online
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user