forked from BaoKaiWms/202501-Wms-Kate-Wuxi
提交拣选计划表单
This commit is contained in:
parent
31f59121a7
commit
43bd5b65a1
9
dev_wms_client/src/api/pickPlan.js
Normal file
9
dev_wms_client/src/api/pickPlan.js
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
import request from "@/http/request";
|
||||||
|
|
||||||
|
export const queryPickPlansByPage = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/pickPlan/queryPickPlansByPage',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
235
dev_wms_client/src/layout/pickPlan.vue
Normal file
235
dev_wms_client/src/layout/pickPlan.vue
Normal file
|
|
@ -0,0 +1,235 @@
|
||||||
|
<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-input v-model="searchQueryFormEntity.vehicleId" @keyup.enter="search()" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="目标站台">
|
||||||
|
<el-input v-model="searchQueryFormEntity.standId" @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.planId" v-model="planId"> </el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="planId" label="计划号" fixed="left" 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="planPickQty" label="计划拣选数量" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="pickType" label="拣选类型" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="workIndex" label="作业顺序" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="standId" label="目标站台" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
</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 { queryPickPlansByPage } from '@/api/pickPlan.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'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 常量定义
|
||||||
|
*/
|
||||||
|
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([['planId', true]]),
|
||||||
|
standId: STAND_ID,
|
||||||
|
userName: USER_NAME
|
||||||
|
})
|
||||||
|
let searchQueryFormEntity = reactive({
|
||||||
|
vehicleId: '',
|
||||||
|
standId: ''
|
||||||
|
})
|
||||||
|
let searchQueryFormRef = ref()
|
||||||
|
let planId = ref('')
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统方法
|
||||||
|
*/
|
||||||
|
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.standId = searchQueryFormEntity.standId.trim()
|
||||||
|
|
||||||
|
queryPickPlansByPage(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.standId = ''
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleSortChange = (data) => {
|
||||||
|
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||||
|
baseTableQuery.sortBy.delete(data.prop)
|
||||||
|
}
|
||||||
|
baseTableQuery.sortBy.set(data.prop, data.order.toLowerCase() === 'ascending')
|
||||||
|
search()
|
||||||
|
}
|
||||||
|
|
||||||
|
const getCurrentRow = (row) => {
|
||||||
|
planId.value = row.planId
|
||||||
|
}
|
||||||
|
</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;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-class {
|
||||||
|
margin: 5px 5px 5px 5px;
|
||||||
|
width: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-pagination {
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-search {
|
||||||
|
height: 30px;
|
||||||
|
width: 80px;
|
||||||
|
margin: auto 5px 5px auto;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -39,6 +39,7 @@ const routes = [
|
||||||
{path: '/imageTable', component: () => import('@/layout/ImageTable.vue')},
|
{path: '/imageTable', component: () => import('@/layout/ImageTable.vue')},
|
||||||
{path: '/equipment', component: () => import('@/layout/equipment.vue')},
|
{path: '/equipment', component: () => import('@/layout/equipment.vue')},
|
||||||
{path: '/job', component: () => import('@/layout/job.vue')},
|
{path: '/job', component: () => import('@/layout/job.vue')},
|
||||||
|
{path: '/pickPlan', component: () => import('@/layout/pickPlan.vue')},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.wms_main.controller.wms;
|
||||||
|
|
||||||
|
import com.wms_main.model.dto.query.PickPlanQuery;
|
||||||
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
|
import com.wms_main.model.vo.wms.PageVo;
|
||||||
|
import com.wms_main.model.vo.wms.PickPlanVo;
|
||||||
|
import com.wms_main.service.controller.IPickPlanControllerService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡特相关控制类
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@ResponseBody
|
||||||
|
@CrossOrigin
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping("/wms/pickPlan")
|
||||||
|
public class PickPlanController {
|
||||||
|
private final IPickPlanControllerService pickPlanControllerService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询拣选计划
|
||||||
|
* @param pickPlanQuery 查询参数
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/queryPickPlansByPage")
|
||||||
|
public WmsApiResponse<PageVo<PickPlanVo>> queryPickPlansByPage(@RequestBody PickPlanQuery pickPlanQuery) {
|
||||||
|
return pickPlanControllerService.queryPickPlanInfoByPage(pickPlanQuery);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.wms_main.model.dto.query;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class PickPlanQuery extends PageQuery {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@JsonProperty(value = "planId")
|
||||||
|
private String planId;
|
||||||
|
/**
|
||||||
|
* 载具号
|
||||||
|
*/
|
||||||
|
@JsonProperty(value = "vehicleId")
|
||||||
|
private String vehicleId;
|
||||||
|
/**
|
||||||
|
* 料号
|
||||||
|
*/
|
||||||
|
@JsonProperty(value = "goodsId")
|
||||||
|
private String goodsId;
|
||||||
|
/**
|
||||||
|
* 计划拣选数量
|
||||||
|
*/
|
||||||
|
@JsonProperty(value = "planPickQty")
|
||||||
|
private Integer planPickQty;
|
||||||
|
/**
|
||||||
|
* 拣选类型
|
||||||
|
* 1. 工作拣选
|
||||||
|
* 2. 出库单
|
||||||
|
*/
|
||||||
|
@JsonProperty(value = "pickType")
|
||||||
|
private Integer pickType;
|
||||||
|
/**
|
||||||
|
* 工作index/出库单
|
||||||
|
*/
|
||||||
|
@JsonProperty(value = "workIndex")
|
||||||
|
private String workIndex;
|
||||||
|
/**
|
||||||
|
* 工作index/出库单
|
||||||
|
*/
|
||||||
|
@JsonProperty(value = "standId")
|
||||||
|
private String standId;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
package com.wms_main.model.vo.wms;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.wms_main.model.po.TAppPickPlan;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class PickPlanVo {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@JsonProperty(value = "planId")
|
||||||
|
private String planId;
|
||||||
|
/**
|
||||||
|
* 载具号
|
||||||
|
*/
|
||||||
|
@JsonProperty(value = "vehicleId")
|
||||||
|
private String vehicleId;
|
||||||
|
/**
|
||||||
|
* 料号
|
||||||
|
*/
|
||||||
|
@JsonProperty(value = "goodsId")
|
||||||
|
private String goodsId;
|
||||||
|
/**
|
||||||
|
* 计划拣选数量
|
||||||
|
*/
|
||||||
|
@JsonProperty(value = "planPickQty")
|
||||||
|
private Integer planPickQty;
|
||||||
|
/**
|
||||||
|
* 拣选类型
|
||||||
|
* 1. 工作拣选
|
||||||
|
* 2. 出库单
|
||||||
|
*/
|
||||||
|
@JsonProperty(value = "pickType")
|
||||||
|
private Integer pickType;
|
||||||
|
/**
|
||||||
|
* 工作index/出库单
|
||||||
|
*/
|
||||||
|
@JsonProperty(value = "workIndex")
|
||||||
|
private String workIndex;
|
||||||
|
/**
|
||||||
|
* 工作index/出库单
|
||||||
|
*/
|
||||||
|
@JsonProperty(value = "standId")
|
||||||
|
private String standId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将Po转化为Vo
|
||||||
|
* @param po 数据库实体
|
||||||
|
* @return 转化结果
|
||||||
|
*/
|
||||||
|
public static PickPlanVo of(TAppPickPlan po) {
|
||||||
|
if (po == null) {
|
||||||
|
return new PickPlanVo();
|
||||||
|
}
|
||||||
|
return new PickPlanVo(
|
||||||
|
po.getPlanId(),
|
||||||
|
po.getVehicleId(),
|
||||||
|
po.getGoodsId(),
|
||||||
|
po.getPlanPickQty(),
|
||||||
|
po.getPickType(),
|
||||||
|
po.getWorkIndex(),
|
||||||
|
po.getStandId()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.wms_main.service.controller;
|
||||||
|
|
||||||
|
import com.wms_main.model.dto.query.PickPlanQuery;
|
||||||
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
|
import com.wms_main.model.vo.wms.PageVo;
|
||||||
|
import com.wms_main.model.vo.wms.PickPlanVo;
|
||||||
|
|
||||||
|
public interface IPickPlanControllerService {
|
||||||
|
WmsApiResponse<PageVo<PickPlanVo>> queryPickPlanInfoByPage(PickPlanQuery pickPlanQuery);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.wms_main.service.controller.serviceImpl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.wms_main.dao.ITAppPickPlanService;
|
||||||
|
import com.wms_main.model.dto.query.PickPlanQuery;
|
||||||
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
|
import com.wms_main.model.po.TAppPickPlan;
|
||||||
|
import com.wms_main.model.vo.wms.PageVo;
|
||||||
|
import com.wms_main.model.vo.wms.PickPlanVo;
|
||||||
|
import com.wms_main.service.controller.IPickPlanControllerService;
|
||||||
|
import com.wms_main.repository.utils.StringUtils;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class PickPlanControllerServiceImpl implements IPickPlanControllerService {
|
||||||
|
|
||||||
|
private final ITAppPickPlanService pickPlanService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询拣选计划信息(分页)---实现
|
||||||
|
*
|
||||||
|
* @param pickPlanQuery 查询参数
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WmsApiResponse<PageVo<PickPlanVo>> queryPickPlanInfoByPage(PickPlanQuery pickPlanQuery) {
|
||||||
|
if (pickPlanQuery == null) {
|
||||||
|
return WmsApiResponse.error("查询参数不能为NULL", null);
|
||||||
|
}
|
||||||
|
Page<TAppPickPlan> page = pickPlanQuery.toMpPage();
|
||||||
|
LambdaQueryWrapper<TAppPickPlan> lambdaQueryWrapper = new LambdaQueryWrapper<TAppPickPlan>()
|
||||||
|
.eq(StringUtils.isNotEmpty(pickPlanQuery.getVehicleId()), TAppPickPlan::getVehicleId, pickPlanQuery.getVehicleId())
|
||||||
|
.eq(StringUtils.isNotEmpty(pickPlanQuery.getStandId()), TAppPickPlan::getStandId, pickPlanQuery.getStandId());
|
||||||
|
Page<TAppPickPlan> poPage = pickPlanService.page(page, lambdaQueryWrapper);
|
||||||
|
|
||||||
|
PageVo<PickPlanVo> pageVo = PageVo.of(poPage, PickPlanVo::of);
|
||||||
|
return WmsApiResponse.success("查询拣选计划成功", pageVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user