forked from BaoKaiWms/202501-Wms-Kate-Wuxi
1. 格式改动
2. 增加了一些报表界面
This commit is contained in:
parent
279ed25548
commit
2a7eba72c5
|
|
@ -3,59 +3,10 @@ import request from "@/http/request";
|
||||||
/**
|
/**
|
||||||
* 分页查找物料
|
* 分页查找物料
|
||||||
*/
|
*/
|
||||||
const getGoodsInfoByPage = (params) => {
|
export const getGoodsInfoByPage = (params) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/goods/getGoodsInfoByPage',
|
url: '/goods/getGoodsInfoByPage',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新物料信息
|
|
||||||
*/
|
|
||||||
const updateGoodsInfo = (params) => {
|
|
||||||
return request({
|
|
||||||
url: '/goods/updateGoodsInfo',
|
|
||||||
method: 'post',
|
|
||||||
data: params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询所有物料信息
|
|
||||||
*/
|
|
||||||
const getGoodsInfo = (params) => {
|
|
||||||
return request({
|
|
||||||
url: '/goods/getGoodsInfo',
|
|
||||||
method: 'post',
|
|
||||||
data: params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询自动补全时可用的物料信息
|
|
||||||
*/
|
|
||||||
const getGoodsInfoByGoodsId = (params) => {
|
|
||||||
return request({
|
|
||||||
url: '/goods/getGoodsInfoByGoodsId',
|
|
||||||
method: 'post',
|
|
||||||
data: params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const deleteGoodsInfo = (params) => {
|
|
||||||
return request({
|
|
||||||
url: '/goods/deleteGoodsInfo',
|
|
||||||
method: 'post',
|
|
||||||
data: params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export {
|
|
||||||
getGoodsInfoByPage,
|
|
||||||
deleteGoodsInfo,
|
|
||||||
getGoodsInfoByGoodsId,
|
|
||||||
getGoodsInfo,
|
|
||||||
updateGoodsInfo
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +1,9 @@
|
||||||
import request from "@/http/request";
|
import request from "@/http/request";
|
||||||
|
|
||||||
const getAllVehicles = (params) => {
|
export const queryVehicleInfoByPage = (params) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/location/getVehiclesByPage',
|
url: '/vehicle/queryVehicleInfoByPage',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateVehicleInfo = (params) => {
|
|
||||||
return request({
|
|
||||||
url: '/location/updateVehicleInfo',
|
|
||||||
method: 'post',
|
|
||||||
data: params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const deleteCurrentVehicle = (params) => {
|
|
||||||
return request({
|
|
||||||
url: '/location/deleteVehicle',
|
|
||||||
method: 'post',
|
|
||||||
data: params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export {
|
|
||||||
getAllVehicles,
|
|
||||||
updateVehicleInfo,
|
|
||||||
deleteCurrentVehicle
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<el-scrollbar ref="scrollbar" :wrap-style="{ 'align-content': 'center' }" always>
|
<el-scrollbar ref="scrollbar" :wrap-style="{ 'align-content': 'center' }">
|
||||||
<div class="app-tag">
|
<div class="app-tag">
|
||||||
<el-tag closable size="default" v-for="(tag, index) in tags" :key="tag.labelName"
|
<el-tag closable size="default" v-for="(tag, index) in tags" :key="tag.labelName"
|
||||||
:disable-transitions="true" :effect="$route.path === tag.path ? 'dark' : 'plain'"
|
:disable-transitions="true" :effect="$route.path === tag.path ? 'dark' : 'plain'"
|
||||||
|
|
@ -59,7 +59,7 @@ const handleClose = (tag, index) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 点击tags具体标签
|
// 点击tags具体标签
|
||||||
const handleClick = (tag, index) => {
|
const handleClick = (tag) => {
|
||||||
router.push(tag.path)
|
router.push(tag.path)
|
||||||
autoScroll(router.currentRoute.value.path)
|
autoScroll(router.currentRoute.value.path)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { ref } from 'vue'
|
|
||||||
const menuList = store.getters.getMenuList
|
const menuList = store.getters.getMenuList
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
// 点击菜单
|
// 点击菜单
|
||||||
|
|
|
||||||
|
|
@ -211,3 +211,33 @@ export const pickingTaskStatusOptions = [
|
||||||
label: '已取消'
|
label: '已取消'
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
// 是否枚举
|
||||||
|
export const yesOrNoOptions = [
|
||||||
|
{
|
||||||
|
value: 0,
|
||||||
|
label: '否'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: '是'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
// 料箱状态枚举
|
||||||
|
export const vehicleStatusOptions = [
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: '入库中'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 2,
|
||||||
|
label: '在库中'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 3,
|
||||||
|
label: '出库中'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 9,
|
||||||
|
label: '锁定中'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
@ -1,423 +1,439 @@
|
||||||
<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 style="display: flex;justify-content: space-between;">
|
<div class="work-area">
|
||||||
<el-row>
|
<fieldset class="search-area">
|
||||||
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号"
|
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
||||||
:suffix-icon="Search" />
|
label-width="158px" style="max-width: 100%" status-icon>
|
||||||
<el-button type="primary" @click="search()">搜索</el-button>
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<el-button type="warning" @click="reset()">重置</el-button>
|
<el-row>
|
||||||
</el-row>
|
<el-form-item label="料号">
|
||||||
<el-row>
|
<el-input v-model="searchQueryFormEntity.goodsId" @keyup.enter="search()"
|
||||||
<el-button style="background-color: #00CED1; color: #000;"
|
clearable />
|
||||||
@click="uploadDialogVisible = true">导入</el-button>
|
</el-form-item>
|
||||||
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
<el-form-item label="描述">
|
||||||
</el-row>
|
<el-input v-model="searchQueryFormEntity.goodsDesc" @keyup.enter="search()"
|
||||||
</div>
|
clearable />
|
||||||
<br />
|
</el-form-item>
|
||||||
<el-table :data="goodsList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
</el-row>
|
||||||
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
<div style="align-content: center;">
|
||||||
:cell-style="{ 'text-align': 'center' }">
|
<el-row>
|
||||||
<el-table-column width="65px" fixed="left">
|
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||||
<template v-slot="scope">
|
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||||
<el-radio :label="scope.row.goodsId" v-model="goodsId"> </el-radio>
|
</el-row>
|
||||||
</template>
|
</div>
|
||||||
</el-table-column>
|
</div>
|
||||||
<el-table-column prop="goodsId" label="物料编号" fixed="left" min-width="120px" show-overflow-tooltip />
|
</el-form>
|
||||||
<el-table-column prop="goodsDescription" label="物料描述" min-width="120px" show-overflow-tooltip />
|
</fieldset>
|
||||||
<el-table-column prop="vendorName" label="供应商" min-width="120px" show-overflow-tooltip />
|
<div class="table-area">
|
||||||
<el-table-column prop="putArea" label="优先存放区域" min-width="120px" show-overflow-tooltip />
|
<el-table :data="tableData" stripe border v-loading="tableLoading" class="table-class"
|
||||||
<el-table-column prop="firstImportTime" label="初次导入时间" :formatter="timeFormat" min-width="120px" show-overflow-tooltip />
|
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||||
<el-table-column prop="firstImportUser" label="初次导入用户" min-width="120px" show-overflow-tooltip />
|
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||||
<el-table-column prop="lastUpdateTime" label="最近更新时间" :formatter="timeFormat" min-width="120px" show-overflow-tooltip />
|
@sort-change="handleSortChange">
|
||||||
<el-table-column prop="lastUpdateUser" label="最近更新用户" min-width="120px" show-overflow-tooltip />
|
<el-table-column width="65px" fixed="left">
|
||||||
<el-table-column fixed="right" label="操作" width="240px">
|
<template v-slot="scope">
|
||||||
<template v-slot="scope">
|
<el-radio :label="scope.row.goodsId" v-model="goodsId"> </el-radio>
|
||||||
<el-button plain type="primary" @click="editCurrentRowGoods(scope.row)">编辑</el-button>
|
</template>
|
||||||
<el-button plain type="danger" @click="deleteCurrentRowGoods(scope.row)">删除</el-button>
|
</el-table-column>
|
||||||
</template>
|
<el-table-column prop="goodsId" label="料号" fixed="left" min-width="120px" sortable="custom"
|
||||||
</el-table-column>
|
show-overflow-tooltip />
|
||||||
</el-table>
|
<el-table-column prop="goodsDescription" label="描述" 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="plant" label="工厂" 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="vendorName" label="供应商" 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="isSled" label="SLED管理" 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 prop="sledDays" label="SLED天数" min-width="120px" sortable="custom"
|
||||||
<el-form ref="goodsFormRef" :model="goodsFormEntity" :label-position="labelPosition"
|
show-overflow-tooltip />
|
||||||
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
<el-table-column prop="feedingType" label="补料类型" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="boxQty" label="每盒数量" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="maxBoxNum" label="最大盒数" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="putArea" label="存放区域" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="hotPoint" 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-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="料号" prop="goodsId">
|
<el-form-item label="工作编号">
|
||||||
<el-input v-model="goodsFormEntity.goodsId" disabled />
|
<el-input v-model="rowFormEntity.workIndex" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="描述" prop="goodsName">
|
<el-form-item label="工单号">
|
||||||
<el-input v-model="goodsFormEntity.goodsName" clearable />
|
<el-input v-model="rowFormEntity.workOrder" disabled />
|
||||||
</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="goodsUnit">
|
<el-form-item label="总成号">
|
||||||
<el-input v-model="goodsFormEntity.goodsUnit" clearable />
|
<el-input v-model="rowFormEntity.productId" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="物料分类" prop="goodsType">
|
<el-form-item label="成品号">
|
||||||
<el-input v-model="goodsFormEntity.goodsType" clearable />
|
<el-input v-model="rowFormEntity.singleProductId" disabled />
|
||||||
</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="providerType">
|
<el-form-item label="料盒号">
|
||||||
<el-input v-model="goodsFormEntity.providerType" clearable />
|
<el-input v-model="rowFormEntity.boxNo" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="重量" prop="weight">
|
<el-form-item label="料号">
|
||||||
<el-input-number v-model.number="goodsFormEntity.weight" controls-position="right"
|
<el-input v-model="rowFormEntity.goodsId" disabled />
|
||||||
:precision="3" :step="0.1" :min="0" clearable />
|
|
||||||
</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="weightUnit">
|
<el-form-item label="需求数量">
|
||||||
<el-input v-model="goodsFormEntity.weightUnit" clearable />
|
<el-input-number v-model.number="rowFormEntity.needNum" controls-position="right"
|
||||||
|
:min="0" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="每盒数量" prop="quantityPerBox">
|
<el-form-item label="已完成数量">
|
||||||
<el-input-number v-model.number="goodsFormEntity.quantityPerBox"
|
<el-input-number v-model.number="rowFormEntity.finishNum" controls-position="right"
|
||||||
controls-position="right" :min="0" clearable />
|
:min="0" :max="rowFormEntity.needNum" clearable />
|
||||||
</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="unpackingType">
|
<el-form-item label="已分配数量">
|
||||||
<el-input v-model="goodsFormEntity.unpackingType" clearable />
|
<el-input-number v-model.number="rowFormEntity.distributeNum"
|
||||||
</el-form-item>
|
controls-position="right" :min="0" :max="rowFormEntity.needNum" clearable />
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="料箱类型" prop="vehicleType">
|
|
||||||
<el-input v-model="goodsFormEntity.vehicleType" clearable />
|
|
||||||
</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="heat">
|
<el-form-item label="工作状态">
|
||||||
<el-input v-model="goodsFormEntity.heat" clearable />
|
<el-select-v2 v-model="rowFormEntity.workStatus" placeholder="请选择工作状态"
|
||||||
|
:options="workStatusOptions"></el-select-v2>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="卸货点" prop="releasePoint">
|
<el-form-item label="缺料状态">
|
||||||
<el-input v-model="goodsFormEntity.releasePoint" clearable />
|
<el-select-v2 v-model="rowFormEntity.lackStatus" placeholder="请选择缺料状态"
|
||||||
</el-form-item>
|
:options="lackStatusOptions"></el-select-v2>
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="补料方式" prop="feedingType">
|
|
||||||
<el-input v-model="goodsFormEntity.feedingType" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="补货点" prop="feedingValue">
|
|
||||||
<el-input-number v-model.number="goodsFormEntity.feedingValue"
|
|
||||||
controls-position="right" :min="0" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="料箱类型描述" prop="vehicleTypeDescription">
|
|
||||||
<el-input v-model="goodsFormEntity.vehicleTypeDescription" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="料箱类型2" prop="goodsInVehicleType">
|
|
||||||
<el-input v-model="goodsFormEntity.goodsInVehicleType" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="数据来源" prop="dataSource">
|
|
||||||
<el-input v-model="goodsFormEntity.dataSource" clearable />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
<template #footer>
|
||||||
<template #footer>
|
<span class="dialog-footer">
|
||||||
<span class="dialog-footer">
|
<el-button type="primary" @click="rowEditFlag = false">取消</el-button>
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button type="success" @click="submitUpdateRow(rowFormEntity)">
|
||||||
<el-button type="primary" @click="submitGoodsInfo(goodsFormEntity)">
|
确定
|
||||||
确定
|
</el-button>
|
||||||
</el-button>
|
</span>
|
||||||
</span>
|
</template>
|
||||||
</template>
|
</el-dialog>
|
||||||
</el-dialog>
|
</div>
|
||||||
<el-dialog v-model="uploadDialogVisible" title="导入物料" width="40%" draggable :show-close="true">
|
</el-container>
|
||||||
<fieldset class="title-area">
|
</el-config-provider>
|
||||||
<legend>导入物料基本信息</legend>
|
|
||||||
<UploadExcelBaseGoods></UploadExcelBaseGoods>
|
|
||||||
</fieldset>
|
|
||||||
<fieldset class="title-area">
|
|
||||||
<legend>导入看板</legend>
|
|
||||||
<UploadExcelKanban></UploadExcelKanban>
|
|
||||||
</fieldset>
|
|
||||||
</el-dialog>
|
|
||||||
</el-config-provider>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { getGoodsInfoByPage, deleteGoodsInfo, updateGoodsInfo } from '@/api/goods.js'
|
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
import { getGoodsInfoByPage } from '@/api/goods.js'
|
||||||
import { ref, reactive } from 'vue'
|
import { timeFormatter, wmsTaskTypeFormatter, wmsTaskStatusFormatter } from '@/utils/formatter.js'
|
||||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
||||||
import { errorBox } from '@/utils/myMessageBox.js'
|
import { ElMessage } from 'element-plus'
|
||||||
// import UploadExcelGoods from '@/excel/UploadExcelGoods.vue'
|
import { genTableRequest } from '@/utils/generator.js'
|
||||||
import UploadExcelBaseGoods from '@/excel/UploadExcelBaseGoods.vue'
|
import { labelPosition } from '@/constant/form.js'
|
||||||
import UploadExcelKanban from '@/excel/UploadExcelKanban.vue'
|
import { loading } from '@/utils/loading'
|
||||||
import { downloadGoodsExcel } from '@/api/excel.js'
|
/**
|
||||||
import { Search } from '@element-plus/icons-vue'
|
* 常量定义
|
||||||
</script>
|
*/
|
||||||
<script>
|
const STAND_ID = store.getters.getStandId
|
||||||
export default {
|
const USER_NAME = store.getters.getUserName
|
||||||
name: 'goods',
|
/**
|
||||||
data() {
|
* 变量定义
|
||||||
return {
|
*/
|
||||||
goodsList: [],
|
let maxHeight = ref(window.innerHeight * 0.55)
|
||||||
goodsInfo: {},
|
let tableLoading = ref(false)
|
||||||
currentPage: 1,
|
let tableData = ref([])
|
||||||
pageSize: 10,
|
let baseTableQuery = reactive({
|
||||||
total: 0,
|
currentPage: 1,
|
||||||
goodsIdQuery: '',
|
pageSize: 10,
|
||||||
loading: true,
|
total: 0,
|
||||||
dialogVisible: false,
|
sortBy: new Map([['goodsId', true]]),// 按照料号顺序排序
|
||||||
uploadDialogVisible: false,
|
standId: STAND_ID,
|
||||||
goodsId: '',
|
userName: USER_NAME
|
||||||
goodsFormEntity: reactive({}),
|
})
|
||||||
labelPosition: 'top',
|
let searchQueryFormEntity = reactive({
|
||||||
goodsFormRef: ref(),
|
goodsId: '',
|
||||||
rules: reactive({})
|
goodsDesc: ''
|
||||||
|
})
|
||||||
|
let searchQueryFormRef = ref()
|
||||||
|
let rowEditFlag = ref(false)
|
||||||
|
let goodsId = ''
|
||||||
|
let rowEditFormRef = ref()
|
||||||
|
let rowFormEntity = reactive({})
|
||||||
|
/**
|
||||||
|
* 系统方法
|
||||||
|
*/
|
||||||
|
onMounted(() => {
|
||||||
|
nextTick(() => {
|
||||||
|
window.addEventListener('resize', resizeHeight)
|
||||||
|
search()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
nextTick(() => {
|
||||||
|
window.removeEventListener('resize', resizeHeight)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
const resizeHeight = () => {
|
||||||
|
maxHeight.value = window.innerHeight * 0.55
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 自定义方法
|
||||||
|
*/
|
||||||
|
// 查询
|
||||||
|
const search = () => {
|
||||||
|
tableLoading.value = true
|
||||||
|
let request = genTableRequest(baseTableQuery)
|
||||||
|
// 设定查询参数
|
||||||
|
request.goodsId = searchQueryFormEntity.goodsId.trim()
|
||||||
|
request.goodsDesc = searchQueryFormEntity.goodsDesc.trim()
|
||||||
|
getGoodsInfoByPage(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 => {
|
||||||
mounted() {
|
console.log(err)
|
||||||
this.search()
|
ElMessage.error('查询数据异常。')
|
||||||
},
|
}).finally(() => {
|
||||||
methods: {
|
tableLoading.value = false
|
||||||
search() {
|
})
|
||||||
this.loading = true
|
}
|
||||||
const request = {
|
const clearQuery = () => {
|
||||||
pageNo: this.currentPage,
|
searchQueryFormEntity.goodsId = ''
|
||||||
pageSize: this.pageSize,
|
searchQueryFormEntity.goodsDesc = ''
|
||||||
goodsId: this.goodsIdQuery.trim(),
|
}
|
||||||
userName: store.getters.getUserName
|
const handleSortChange = (data) => {
|
||||||
}
|
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||||
getGoodsInfoByPage(request).then(res => {
|
baseTableQuery.sortBy.delete(data.prop)
|
||||||
console.log(res)
|
}
|
||||||
const tableResponse = res.data
|
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||||
if (tableResponse.code == 0) {
|
search()
|
||||||
this.goodsList = tableResponse.data.lists
|
}
|
||||||
this.total = tableResponse.data.total
|
const getCurrentRow = (row) => {
|
||||||
} else {
|
goodsId = row.goodsId
|
||||||
errorBox(tableResponse.message)
|
}
|
||||||
}
|
const timeFormat = (row, column, cellValue, index) => {
|
||||||
}).catch(err => {
|
return timeFormatter(cellValue)
|
||||||
console.log(err)
|
}
|
||||||
errorBox('查询物料错误')
|
const taskTypeFormat = (row, column, cellValue, index) => {
|
||||||
})
|
return wmsTaskTypeFormatter(cellValue)
|
||||||
this.loading = false
|
}
|
||||||
},
|
const taskStatusFormat = (row, column, cellValue, index) => {
|
||||||
dateFormat: (row, column, cellValue, index) => {
|
return wmsTaskStatusFormatter(cellValue)
|
||||||
return dateFormatter(cellValue)
|
}
|
||||||
},
|
// 编辑弹框
|
||||||
timeFormat: (row, column, cellValue, index) => {
|
const editCurrentRowFormEntity = (row) => {
|
||||||
return timeFormatter(cellValue)
|
// 设置form值
|
||||||
},
|
rowFormEntity.workIndex = row.workIndex
|
||||||
reset() {
|
rowFormEntity.workOrder = row.workOrder
|
||||||
this.goodsIdQuery = ''
|
rowFormEntity.productId = row.productId
|
||||||
this.search()
|
rowFormEntity.singleProductId = row.singleProductId
|
||||||
},
|
rowFormEntity.boxNo = row.boxNo
|
||||||
editCurrentRowGoods(row) {
|
rowFormEntity.goodsId = row.goodsId
|
||||||
this.goodsId = row.goodsId
|
rowFormEntity.needNum = row.needNum
|
||||||
this.goodsFormEntity = {
|
rowFormEntity.distributeNum = row.distributeNum
|
||||||
goodsId: row.goodsId,
|
rowFormEntity.finishNum = row.finishNum
|
||||||
goodsName: row.goodsName,
|
rowFormEntity.workStatus = row.workStatus
|
||||||
goodsUnit: row.goodsUnit,
|
rowFormEntity.lackStatus = row.lackStatus
|
||||||
goodsType: row.goodsType,
|
// 弹出框
|
||||||
providerType: row.providerType,
|
rowEditFlag.value = true
|
||||||
weight: row.weight,
|
}
|
||||||
weightUnit: row.weightUnit,
|
// 关闭当前缺料工作
|
||||||
quantityPerBox: row.quantityPerBox,
|
const closeLackWork = (row) => {
|
||||||
unpackingType: row.unpackingType,
|
const request = {
|
||||||
vehicleType: row.vehicleType,
|
workIndex: row.workIndex,
|
||||||
vehicleTypeDescription: row.vehicleTypeDescription,
|
standId: STAND_ID,
|
||||||
goodsInVehicleType: row.goodsInVehicleType,
|
userName: USER_NAME
|
||||||
feedingType: row.feedingType,
|
}
|
||||||
feedingValue: row.feedingValue,
|
loading.open('关闭中...')
|
||||||
dataSource: row.dataSource,
|
closeCurrentWorks(request).then(res => {
|
||||||
heat: row.heat,
|
const response = res.data
|
||||||
releasePoint: row.releasePoint,
|
if (response.code == 0) {
|
||||||
}
|
ElMessage.success(response.message)
|
||||||
this.dialogVisible = true
|
search()
|
||||||
},
|
} else {
|
||||||
deleteCurrentRowGoods(row) {
|
ElMessage.error(response.message)
|
||||||
this.goodsId = row.goodsId
|
}
|
||||||
ElMessageBox.confirm(
|
}).catch(err => {
|
||||||
'该操作会删除选择的物料数据。\n是否继续',
|
console.log(err)
|
||||||
'警告',
|
ElMessage.error('请求异常。')
|
||||||
{
|
}).finally(() => {
|
||||||
confirmButtonText: '确认',
|
loading.close()
|
||||||
cancelButtonText: '取消',
|
})
|
||||||
type: 'warning',
|
}
|
||||||
}
|
// 更新当前行数据
|
||||||
).then(() => {
|
const submitUpdateRow = (rowFormEntity) => {
|
||||||
const params = {
|
const request = {
|
||||||
goodsId: this.goodsId,
|
workIndex: rowFormEntity.workIndex,
|
||||||
userName: store.getters.getUserName
|
distributeNum: rowFormEntity.distributeNum,
|
||||||
}
|
finishNum: rowFormEntity.finishNum,
|
||||||
deleteGoodsInfo(params).then(res => {
|
workStatus: rowFormEntity.workStatus,
|
||||||
if (res.data.code == 0) {
|
lackStatus: rowFormEntity.lackStatus,
|
||||||
ElMessage.success('删除物料信息成功')
|
standId: STAND_ID,
|
||||||
this.search()
|
userName: USER_NAME
|
||||||
} else {
|
}
|
||||||
errorBox(res.data.message)
|
loading.open('更新中...')
|
||||||
}
|
updateKateWorks(request).then(res => {
|
||||||
}).catch(err => {
|
if (res.data.code == 0) {
|
||||||
console.log(err)
|
ElMessage.success('更新数据成功。')
|
||||||
errorBox('删除物料信息失败')
|
rowEditFlag.value = false
|
||||||
})
|
search()
|
||||||
}).catch(() => {
|
} else {
|
||||||
ElMessage.info('操作取消')
|
ElMessage.error('更新数据失败。')
|
||||||
})
|
}
|
||||||
},
|
}).catch(err => {
|
||||||
submitGoodsInfo(formData) {
|
console.log(err)
|
||||||
const request = {
|
ElMessage.error('更新数据异常。')
|
||||||
goodsId: formData.goodsId,
|
}).finally(() => {
|
||||||
goodsName: formData.goodsName,
|
loading.close()
|
||||||
goodsUnit: formData.goodsUnit,
|
})
|
||||||
goodsType: formData.goodsType,
|
|
||||||
providerType: formData.providerType,
|
|
||||||
weight: formData.weight,
|
|
||||||
weightUnit: formData.weightUnit,
|
|
||||||
quantityPerBox: formData.quantityPerBox,
|
|
||||||
unpackingType: formData.unpackingType,
|
|
||||||
vehicleType: formData.vehicleType,
|
|
||||||
vehicleTypeDescription: formData.vehicleTypeDescription,
|
|
||||||
goodsInVehicleType: formData.goodsInVehicleType,
|
|
||||||
feedingType: formData.feedingType,
|
|
||||||
feedingValue: formData.feedingValue,
|
|
||||||
heat: formData.heat,
|
|
||||||
releasePoint: formData.releasePoint,
|
|
||||||
dataSource: formData.dataSource,
|
|
||||||
userName: store.getters.getUserName
|
|
||||||
}
|
|
||||||
updateGoodsInfo(request).then(res => {
|
|
||||||
if (res.data.code == 0) {
|
|
||||||
this.dialogVisible = false
|
|
||||||
ElMessage.success('更新物料信息成功')
|
|
||||||
this.search()
|
|
||||||
} else {
|
|
||||||
errorBox(res.data.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
errorBox('更新物料信息失败')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getCurrentRow(row) {
|
|
||||||
this.goodsId = row.goodsId
|
|
||||||
},
|
|
||||||
exportExcel() {
|
|
||||||
const params = {
|
|
||||||
goodsId: this.goodsIdQuery.trim(),
|
|
||||||
userName: store.getters.getUserName
|
|
||||||
}
|
|
||||||
downloadGoodsExcel(params).then(res => {
|
|
||||||
const link = document.createElement('a');//创建a标签
|
|
||||||
try {
|
|
||||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
|
||||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
|
||||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
|
||||||
let _fileName = "物料报表" + dateFormatter(new Date) + ".xlsx"
|
|
||||||
link.style.display = 'none'//隐藏
|
|
||||||
|
|
||||||
// 兼容不同浏览器的URL对象
|
|
||||||
const url = window.URL || window.webkitURL || window.moxURL
|
|
||||||
link.href = url.createObjectURL(blob)
|
|
||||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
|
||||||
document.body.appendChild(link)
|
|
||||||
link.click()
|
|
||||||
document.body.removeChild(link)
|
|
||||||
url.revokeObjectURL(link.href)//移除url对象
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e)
|
|
||||||
errorBox('下载文件失败')
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
errorBox('导出失败')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.el-pagination {
|
.content {
|
||||||
padding-left: 5px;
|
display: flex;
|
||||||
}
|
|
||||||
|
|
||||||
.el-row .el-button {
|
|
||||||
width: 72px;
|
|
||||||
margin-left: 0px;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-class {
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item {
|
.work-area {
|
||||||
width: 10% inherit;
|
width: 100%;
|
||||||
justify-content: center;
|
/* padding: 5px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item .el-select-v2 {
|
.search-area {
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-row .el-form-item .el-input-number {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-row .el-form-item .el-button {
|
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
min-height: fit-content;
|
||||||
|
max-height: 40%;
|
||||||
.title-area {
|
|
||||||
display: flex;
|
|
||||||
/* min-height: 10%; */
|
|
||||||
max-height: max-content;
|
|
||||||
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;
|
||||||
flex-direction: column;
|
|
||||||
padding: 10px;
|
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>
|
</style>
|
||||||
|
|
@ -1,345 +1,465 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="margin-bottom: 10px">
|
<el-config-provider :locale="zhCn">
|
||||||
<el-config-provider :locale="zhCn">
|
<el-container class="content">
|
||||||
<div style="display: flex;justify-content: space-between;">
|
<div class="work-area">
|
||||||
<el-row>
|
<fieldset class="search-area">
|
||||||
<el-input v-model="locationIdQuery" style="width: 256px; margin-right: 10px;" placeholder="库位"
|
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
||||||
:suffix-icon="Search" />
|
label-width="158px" style="max-width: 100%" status-icon>
|
||||||
<el-button type="primary" @click="search()">搜索</el-button>
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<el-button type="warning" @click="reset()">重置</el-button>
|
<el-row>
|
||||||
</el-row>
|
<el-form-item label="任务类型">
|
||||||
<el-row>
|
<el-select-v2 v-model="searchQueryFormEntity.taskType" placeholder="任务类型"
|
||||||
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
:options="addAllOptionOfOptions(taskTypeOptions)"
|
||||||
</el-row>
|
@change="search()"></el-select-v2>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="任务状态">
|
||||||
|
<el-select-v2 v-model="searchQueryFormEntity.taskStatus" placeholder="任务状态"
|
||||||
|
:options="addAllOptionOfOptions(wmsTaskStatusOptions)"
|
||||||
|
@change="search()"></el-select-v2>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="箱号">
|
||||||
|
<el-input v-model="searchQueryFormEntity.vehicleId" @keyup.enter="search()" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="料号">
|
||||||
|
<el-input v-model="searchQueryFormEntity.goodsId" @keyup.enter="search()" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
<div style="align-content: center;">
|
||||||
|
<el-row>
|
||||||
|
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||||
|
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
</fieldset>
|
||||||
|
<div class="table-area">
|
||||||
|
<el-table :data="tableData" stripe border v-loading="tableLoading" class="table-class"
|
||||||
|
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||||
|
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||||
|
@sort-change="handleSortChange">
|
||||||
|
<el-table-column width="65px" fixed="left">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-radio :label="scope.row.taskId" v-model="taskId"> </el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="taskId" label="任务号" fixed="left" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="taskType" label="任务类型" fixed="left" :formatter="taskTypeFormat" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="taskStatus" label="任务状态" :formatter="taskStatusFormat" fixed="right" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="taskPriority" label="优先级" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="goodsId" label="料号" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="goodsDesc" label="物料描述"
|
||||||
|
min-width="120px" sortable="custom" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="opNum" label="操作数量" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="stockNum" label="库存数量" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="origin" label="起点" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="destination" label="终点" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="wcsTaskId" label="wcs任务号" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="opUser" label="操作用户" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="remark" label="备注" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="callStand" label="呼叫站台" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip />
|
||||||
|
<!-- <el-table-column fixed="right" label="操作" width="170px">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<div style="display: inline-block; align-content: center;">
|
||||||
|
<el-button type="primary"
|
||||||
|
@click="editCurrentRowFormEntity(scope.row)">编辑</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
</el-table>
|
||||||
|
<br />
|
||||||
|
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||||
|
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
||||||
|
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
||||||
|
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="baseTableQuery.total" />
|
||||||
|
</div>
|
||||||
|
<el-dialog v-model="rowEditFlag" title="工作信息" width="40%" draggable :show-close="false">
|
||||||
|
<el-form ref="rowEditFormRef" :model="rowFormEntity" :label-position="labelPosition"
|
||||||
|
label-width="100px" style="max-width: 100%" status-icon>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="工作编号">
|
||||||
|
<el-input v-model="rowFormEntity.workIndex" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="工单号">
|
||||||
|
<el-input v-model="rowFormEntity.workOrder" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="总成号">
|
||||||
|
<el-input v-model="rowFormEntity.productId" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="成品号">
|
||||||
|
<el-input v-model="rowFormEntity.singleProductId" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="料盒号">
|
||||||
|
<el-input v-model="rowFormEntity.boxNo" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="料号">
|
||||||
|
<el-input v-model="rowFormEntity.goodsId" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="需求数量">
|
||||||
|
<el-input-number v-model.number="rowFormEntity.needNum" controls-position="right"
|
||||||
|
:min="0" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="已完成数量">
|
||||||
|
<el-input-number v-model.number="rowFormEntity.finishNum" controls-position="right"
|
||||||
|
:min="0" :max="rowFormEntity.needNum" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="已分配数量">
|
||||||
|
<el-input-number v-model.number="rowFormEntity.distributeNum"
|
||||||
|
controls-position="right" :min="0" :max="rowFormEntity.needNum" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="工作状态">
|
||||||
|
<el-select-v2 v-model="rowFormEntity.workStatus" placeholder="请选择工作状态"
|
||||||
|
:options="workStatusOptions"></el-select-v2>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="缺料状态">
|
||||||
|
<el-select-v2 v-model="rowFormEntity.lackStatus" placeholder="请选择缺料状态"
|
||||||
|
:options="lackStatusOptions"></el-select-v2>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<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>
|
||||||
<br />
|
</el-container>
|
||||||
<el-table :data="locations" stripe border v-loading="loading" class="table-class" max-height="550px"
|
</el-config-provider>
|
||||||
highlight-current-row @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.locationId" v-model="locationId"> </el-radio>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="locationId" label="库位" fixed="left" :formatter="locationFormat" min-width="180px"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="areaId" label="库区" min-width="120px" />
|
|
||||||
<el-table-column prop="equipmentId" label="设备号" min-width="120px" />
|
|
||||||
<el-table-column prop="locationType" label="库位类型" min-width="120px" />
|
|
||||||
<el-table-column prop="wRow" label="排" min-width="120px" />
|
|
||||||
<el-table-column prop="wCol" label="列" min-width="120px" />
|
|
||||||
<el-table-column prop="wLayer" label="层" min-width="120px" />
|
|
||||||
<el-table-column prop="wDepth" label="深度" min-width="120px" />
|
|
||||||
<el-table-column prop="isLock" label="锁定" :formatter="isLockFormat" min-width="120px" />
|
|
||||||
<el-table-column prop="locationStatus" label="状态" :formatter="locationStatusFormat" min-width="120px" />
|
|
||||||
<el-table-column prop="vehicleId" label="料箱" min-width="120px" show-overflow-tooltip />
|
|
||||||
<el-table-column fixed="right" label="操作" width="120px">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<el-button plain type="primary" @click="editCurrentRowLocation(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">
|
|
||||||
<el-form ref="locationFormRef" :model="locationFormEntity" :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="locationId">
|
|
||||||
<el-input v-model="locationFormEntity.locationId" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="类型" prop="locationType">
|
|
||||||
<el-input v-model="locationFormEntity.locationType" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="库区" prop="areaId">
|
|
||||||
<el-input v-model="locationFormEntity.areaId" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="设备号" prop="equipmentId">
|
|
||||||
<el-input v-model="locationFormEntity.equipmentId" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="排" prop="wRow">
|
|
||||||
<el-input v-model="locationFormEntity.wRow" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="列" prop="wCol">
|
|
||||||
<el-input v-model="locationFormEntity.wCol" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="层" prop="wLayer">
|
|
||||||
<el-input v-model="locationFormEntity.wLayer" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="深度" prop="wDepth">
|
|
||||||
<el-input v-model="locationFormEntity.wDepth" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="锁定" prop="isLock">
|
|
||||||
<el-select-v2 v-model="locationFormEntity.isLock" placeholder="请选择是否锁定"
|
|
||||||
:options="isLockOptions"></el-select-v2>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="状态" prop="locationStatus">
|
|
||||||
<el-select-v2 v-model="locationFormEntity.locationStatus" placeholder="请选择库位状态"
|
|
||||||
:options="locationStatusOptions"></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="vehicleId">
|
|
||||||
<el-input v-model="locationFormEntity.vehicleId" />
|
|
||||||
</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="submitLocationInfo(locationFormEntity)">
|
|
||||||
确定
|
|
||||||
</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</el-config-provider>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { downloadLocationsExcel } from '@/api/excel.js'
|
|
||||||
import { getLocations, updateLocation } from '@/api/location.js'
|
|
||||||
import { Search } from '@element-plus/icons-vue'
|
|
||||||
import { errorBox } from '@/utils/myMessageBox.js'
|
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
import { ref, reactive } from 'vue'
|
|
||||||
import { locationStatusFormatter, locationFormatter } from '@/utils/formatter.js'
|
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
</script>
|
import { queryTasksByPage } from '@/api/taskQuery.js'
|
||||||
<script>
|
import { timeFormatter, wmsTaskTypeFormatter, wmsTaskStatusFormatter } from '@/utils/formatter.js'
|
||||||
export default {
|
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
||||||
name: 'locationsTable',
|
import { ElMessage } from 'element-plus'
|
||||||
data() {
|
import { genTableRequest } from '@/utils/generator.js'
|
||||||
return {
|
import { labelPosition } from '@/constant/form.js'
|
||||||
locations: [],
|
import { taskTypeOptions, wmsTaskStatusOptions } from '@/constant/options.js'
|
||||||
currentPage: 1,
|
import { addAllOptionOfOptions } from '@/utils/generator.js'
|
||||||
pageSize: 10,
|
import { loading } from '@/utils/loading'
|
||||||
total: 0,
|
/**
|
||||||
locationIdQuery: '',
|
* 常量定义
|
||||||
loading: true,
|
*/
|
||||||
dialogVisible: false,
|
const STAND_ID = store.getters.getStandId
|
||||||
locationId: '',
|
const USER_NAME = store.getters.getUserName
|
||||||
locationFormEntity: reactive({}),
|
/**
|
||||||
labelPosition: 'top',
|
* 变量定义
|
||||||
locationFormRef: ref(),
|
*/
|
||||||
rules: reactive({
|
let maxHeight = ref(window.innerHeight * 0.55)
|
||||||
locationId: [
|
let tableLoading = ref(false)
|
||||||
{ required: true, message: '请输入库位号' }
|
let tableData = ref([])
|
||||||
],
|
let baseTableQuery = reactive({
|
||||||
}),
|
currentPage: 1,
|
||||||
// 锁定
|
pageSize: 10,
|
||||||
isLockOptions: [
|
total: 0,
|
||||||
{
|
sortBy: new Map([['createTime', true]]),// 按照成品号顺序排序
|
||||||
value: 0,
|
standId: STAND_ID,
|
||||||
label: '正常'
|
userName: USER_NAME
|
||||||
},
|
})
|
||||||
{
|
let searchQueryFormEntity = reactive({
|
||||||
value: 1,
|
vehicleId: '',
|
||||||
label: '锁定'
|
goodsId: '',
|
||||||
}
|
taskType: -99,
|
||||||
],
|
taskStatus: -99
|
||||||
// 状态
|
})
|
||||||
locationStatusOptions: [
|
let searchQueryFormRef = ref()
|
||||||
{
|
let rowEditFlag = ref(false)
|
||||||
value: 0,
|
let taskId = ''
|
||||||
label: '空闲'
|
let rowEditFormRef = ref()
|
||||||
},
|
let rowFormEntity = reactive({})
|
||||||
{
|
/**
|
||||||
value: 1,
|
* 系统方法
|
||||||
label: '占用'
|
*/
|
||||||
},
|
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.taskType = searchQueryFormEntity.taskType == -99 ? null : searchQueryFormEntity.taskType
|
||||||
|
request.taskStatus = searchQueryFormEntity.taskStatus == -99 ? null : searchQueryFormEntity.taskStatus
|
||||||
|
queryTasksByPage(request).then((res) => {
|
||||||
|
const response = res.data
|
||||||
|
if (response.code == 0) {
|
||||||
|
const data = response.data
|
||||||
|
if (data != null) {
|
||||||
|
tableData.value = data.lists
|
||||||
|
baseTableQuery.total = data.total
|
||||||
|
} else {
|
||||||
|
tableData.value = []
|
||||||
|
baseTableQuery.total = 0
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ElMessage.error(response.message)
|
||||||
}
|
}
|
||||||
},
|
}).catch(err => {
|
||||||
mounted() {
|
console.log(err)
|
||||||
this.search()
|
ElMessage.error('查询数据异常。')
|
||||||
},
|
}).finally(() => {
|
||||||
methods: {
|
tableLoading.value = false
|
||||||
search() {
|
})
|
||||||
this.loading = true
|
}
|
||||||
const tableRequest = {
|
const clearQuery = () => {
|
||||||
pageNo: this.currentPage,
|
searchQueryFormEntity.vehicleId = ''
|
||||||
pageSize: this.pageSize,
|
searchQueryFormEntity.goodsId = ''
|
||||||
locationId: this.locationIdQuery.trim()
|
}
|
||||||
}
|
const handleSortChange = (data) => {
|
||||||
getLocations(tableRequest).then(res => {
|
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||||
const tableResponse = res.data
|
baseTableQuery.sortBy.delete(data.prop)
|
||||||
if (tableResponse.code == 0) {
|
|
||||||
this.locations = tableResponse.returnData.lists
|
|
||||||
this.total = tableResponse.returnData.total
|
|
||||||
} else {
|
|
||||||
errorBox(tableResponse.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
errorBox('查询库位信息错误')
|
|
||||||
})
|
|
||||||
this.loading = false
|
|
||||||
},
|
|
||||||
locationStatusFormat: (row, column, cellValue, index) => {
|
|
||||||
return locationStatusFormatter(cellValue)
|
|
||||||
},
|
|
||||||
locationFormat: (row, column, cellValue, index) => {
|
|
||||||
return locationFormatter(cellValue)
|
|
||||||
},
|
|
||||||
isLockFormat: (row, column, cellValue, index) => {
|
|
||||||
if (cellValue == 0) {
|
|
||||||
return '正常'
|
|
||||||
}
|
|
||||||
if (cellValue == 1) {
|
|
||||||
return '锁定'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
reset() {
|
|
||||||
this.locationIdQuery = ''
|
|
||||||
this.search()
|
|
||||||
},
|
|
||||||
editCurrentRowLocation(row) {
|
|
||||||
this.locationFormEntity = {
|
|
||||||
locationId: row.locationId,
|
|
||||||
areaId: row.areaId,
|
|
||||||
equipmentId: row.equipmentId,
|
|
||||||
locationType: row.locationType,
|
|
||||||
wRow: row.wRow,
|
|
||||||
wCol: row.wCol,
|
|
||||||
wLayer: row.wLayer,
|
|
||||||
wDepth: row.wDepth,
|
|
||||||
isLock: row.isLock,
|
|
||||||
locationStatus: row.locationStatus,
|
|
||||||
vehicleId: row.vehicleId
|
|
||||||
}
|
|
||||||
this.dialogVisible = true
|
|
||||||
},
|
|
||||||
submitLocationInfo(formData) {
|
|
||||||
const request = {
|
|
||||||
locationId: formData.locationId,
|
|
||||||
areaId: formData.areaId,
|
|
||||||
equipmentId: formData.equipmentId,
|
|
||||||
locationType: formData.locationType,
|
|
||||||
wRow: formData.wRow,
|
|
||||||
wCol: formData.wCol,
|
|
||||||
wLayer: formData.wLayer,
|
|
||||||
wDepth: formData.wDepth,
|
|
||||||
isLock: formData.isLock,
|
|
||||||
locationStatus: formData.locationStatus,
|
|
||||||
vehicleId: formData.vehicleId
|
|
||||||
}
|
|
||||||
updateLocation(request).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.locationId = row.locationId
|
|
||||||
},
|
|
||||||
exportExcel() {
|
|
||||||
const params = {
|
|
||||||
locationId: this.locationIdQuery.trim(),
|
|
||||||
userName: store.getters.getUserName
|
|
||||||
}
|
|
||||||
downloadLocationsExcel(params).then(res => {
|
|
||||||
const link = document.createElement('a');//创建a标签
|
|
||||||
try {
|
|
||||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
|
||||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
|
||||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
|
||||||
let _fileName = "库位报表" + dateFormatter(new Date) + ".xlsx"
|
|
||||||
link.style.display = 'none'//隐藏
|
|
||||||
|
|
||||||
// 兼容不同浏览器的URL对象
|
|
||||||
const url = window.URL || window.webkitURL || window.moxURL
|
|
||||||
link.href = url.createObjectURL(blob)
|
|
||||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
|
||||||
document.body.appendChild(link)
|
|
||||||
link.click()
|
|
||||||
document.body.removeChild(link)
|
|
||||||
url.revokeObjectURL(link.href)//移除url对象
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e)
|
|
||||||
errorBox('下载文件失败')
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
errorBox('导出失败')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
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 taskTypeFormat = (row, column, cellValue, index) => {
|
||||||
|
return wmsTaskTypeFormatter(cellValue)
|
||||||
|
}
|
||||||
|
const taskStatusFormat = (row, column, cellValue, index) => {
|
||||||
|
return wmsTaskStatusFormatter(cellValue)
|
||||||
|
}
|
||||||
|
// 编辑弹框
|
||||||
|
const editCurrentRowFormEntity = (row) => {
|
||||||
|
// 设置form值
|
||||||
|
rowFormEntity.workIndex = row.workIndex
|
||||||
|
rowFormEntity.workOrder = row.workOrder
|
||||||
|
rowFormEntity.productId = row.productId
|
||||||
|
rowFormEntity.singleProductId = row.singleProductId
|
||||||
|
rowFormEntity.boxNo = row.boxNo
|
||||||
|
rowFormEntity.goodsId = row.goodsId
|
||||||
|
rowFormEntity.needNum = row.needNum
|
||||||
|
rowFormEntity.distributeNum = row.distributeNum
|
||||||
|
rowFormEntity.finishNum = row.finishNum
|
||||||
|
rowFormEntity.workStatus = row.workStatus
|
||||||
|
rowFormEntity.lackStatus = row.lackStatus
|
||||||
|
// 弹出框
|
||||||
|
rowEditFlag.value = true
|
||||||
|
}
|
||||||
|
// 关闭当前缺料工作
|
||||||
|
const closeLackWork = (row) => {
|
||||||
|
const request = {
|
||||||
|
workIndex: row.workIndex,
|
||||||
|
standId: STAND_ID,
|
||||||
|
userName: USER_NAME
|
||||||
|
}
|
||||||
|
loading.open('关闭中...')
|
||||||
|
closeCurrentWorks(request).then(res => {
|
||||||
|
const response = res.data
|
||||||
|
if (response.code == 0) {
|
||||||
|
ElMessage.success(response.message)
|
||||||
|
search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error(response.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('请求异常。')
|
||||||
|
}).finally(() => {
|
||||||
|
loading.close()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 更新当前行数据
|
||||||
|
const submitUpdateRow = (rowFormEntity) => {
|
||||||
|
const request = {
|
||||||
|
workIndex: rowFormEntity.workIndex,
|
||||||
|
distributeNum: rowFormEntity.distributeNum,
|
||||||
|
finishNum: rowFormEntity.finishNum,
|
||||||
|
workStatus: rowFormEntity.workStatus,
|
||||||
|
lackStatus: rowFormEntity.lackStatus,
|
||||||
|
standId: STAND_ID,
|
||||||
|
userName: USER_NAME
|
||||||
|
}
|
||||||
|
loading.open('更新中...')
|
||||||
|
updateKateWorks(request).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
ElMessage.success('更新数据成功。')
|
||||||
|
rowEditFlag.value = false
|
||||||
|
search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error('更新数据失败。')
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('更新数据异常。')
|
||||||
|
}).finally(() => {
|
||||||
|
loading.close()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<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 {
|
.el-pagination {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-button {
|
.my-autocomplete li {
|
||||||
width: 72px;
|
width: 196px;
|
||||||
margin-left: 0px;
|
line-height: normal;
|
||||||
margin-right: 5px;
|
padding: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-class {
|
.my-autocomplete li .name {
|
||||||
width: 100%;
|
text-overflow: ellipsis;
|
||||||
/* font-size: 5px; */
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item {
|
.my-autocomplete li .addr {
|
||||||
width: 10% inherit;
|
font-size: 12px;
|
||||||
justify-content: center;
|
color: #b4b4b4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item .el-select-v2 {
|
.my-autocomplete li .highlighted .addr {
|
||||||
width: 100% !important;
|
color: #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item .el-input-number {
|
.my-autocomplete li .goods_id {
|
||||||
width: 100% !important;
|
color: brown;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item .el-button {
|
.my-autocomplete li .goods_name {
|
||||||
margin: auto;
|
color: cornflowerblue;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-search {
|
||||||
|
height: 30px;
|
||||||
|
width: 80px;
|
||||||
|
margin: auto 5px 5px auto;
|
||||||
|
color: black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -77,15 +77,14 @@
|
||||||
sortable="custom" show-overflow-tooltip />
|
sortable="custom" show-overflow-tooltip />
|
||||||
<el-table-column prop="callStand" label="呼叫站台" min-width="120px"
|
<el-table-column prop="callStand" label="呼叫站台" min-width="120px"
|
||||||
sortable="custom" show-overflow-tooltip />
|
sortable="custom" show-overflow-tooltip />
|
||||||
<el-table-column fixed="right" label="操作" width="170px"
|
<!-- <el-table-column fixed="right" label="操作" width="170px">
|
||||||
v-if="searchQueryFormEntity.summaryType == 1">
|
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div style="display: inline-block; align-content: center;">
|
<div style="display: inline-block; align-content: center;">
|
||||||
<el-button type="primary"
|
<el-button type="primary"
|
||||||
@click="editCurrentRowFormEntity(scope.row)">编辑</el-button>
|
@click="editCurrentRowFormEntity(scope.row)">编辑</el-button>
|
||||||
</div>
|
</div>
|
||||||
</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"
|
||||||
|
|
@ -277,7 +276,8 @@ const search = () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const clearQuery = () => {
|
const clearQuery = () => {
|
||||||
searchQueryFormEntity.workOrder = ''
|
searchQueryFormEntity.vehicleId = ''
|
||||||
|
searchQueryFormEntity.goodsId = ''
|
||||||
}
|
}
|
||||||
const handleSortChange = (data) => {
|
const handleSortChange = (data) => {
|
||||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||||
|
|
|
||||||
|
|
@ -1,331 +1,457 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="margin-bottom: 10px">
|
<el-config-provider :locale="zhCn">
|
||||||
<el-config-provider :locale="zhCn">
|
<el-container class="content">
|
||||||
<div style="display: flex;justify-content: space-between;">
|
<div class="work-area">
|
||||||
<el-row>
|
<fieldset class="search-area">
|
||||||
<el-input v-model="queryKey" style="width: 158px; margin-right: 10px;" placeholder="箱号"
|
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
||||||
:suffix-icon="Search" />
|
label-width="158px" style="max-width: 100%" status-icon>
|
||||||
<el-input v-model="locationQuery" style="width: 158px; margin-right: 10px;" placeholder="位置"
|
<div style="display: flex;justify-content: space-between;">
|
||||||
:suffix-icon="Search" />
|
<el-row>
|
||||||
<el-select-v2 v-model="isEmptyQuery" style="width: 158px; margin-right: 10px;" placeholder="是否空箱"
|
<el-form-item label="空箱">
|
||||||
:options="isEmptyOptions" @change="search()"></el-select-v2>
|
<el-select-v2 v-model="searchQueryFormEntity.isEmpty" placeholder="任务类型"
|
||||||
<el-button type="primary" @click="search()">搜索</el-button>
|
:options="addAllOptionOfOptions(yesOrNoOptions)"
|
||||||
<el-button type="warning" @click="reset()">重置</el-button>
|
@change="search()"></el-select-v2>
|
||||||
</el-row>
|
</el-form-item>
|
||||||
<el-row v-if="selVehicle == null">
|
<el-form-item label="锁定">
|
||||||
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
<el-select-v2 v-model="searchQueryFormEntity.isLock" placeholder="任务状态"
|
||||||
</el-row>
|
:options="addAllOptionOfOptions(yesOrNoOptions)"
|
||||||
|
@change="search()"></el-select-v2>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态">
|
||||||
|
<el-select-v2 v-model="searchQueryFormEntity.vehicleStatus" placeholder="任务状态"
|
||||||
|
:options="addAllOptionOfOptions(vehicleStatusOptions)"
|
||||||
|
@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.locationId" @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.vehicleId" v-model="vehicleId"> </el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip />
|
||||||
|
<el-table-column prop="vehicleStatus" label="状态" :formatter="vehicleStatusFormat" fixed="right"
|
||||||
|
min-width="120px" sortable="custom" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="isEmpty" label="空箱" :formatter="yesOrNoFormat" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip />
|
||||||
|
<!-- <el-table-column prop="vehicleType" label="料箱类型" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip /> -->
|
||||||
|
<el-table-column prop="isLock" label="锁定" :formatter="yesOrNoFormat" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="locationId" label="库位" :formatter="locationFormat" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="lastInTime" 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>
|
||||||
|
<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>
|
||||||
<br />
|
</el-container>
|
||||||
<el-table :data="vehicles" stripe border v-loading="loading" class="table-class" max-height="550px"
|
</el-config-provider>
|
||||||
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.vehicleId" v-model="vehicleId"> </el-radio>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="vehicleId" label="托盘号" fixed="left" min-width="120px" />
|
|
||||||
<el-table-column prop="currentLocation" label="库位" fixed="left" :formatter="locationFormat"
|
|
||||||
min-width="120px" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="vehicleStatus" label="状态" :formatter="vehicleStatusFormat" min-width="120px" />
|
|
||||||
<el-table-column prop="isEmpty" label="空托" :formatter="isEmptyFormat" min-width="120px" />
|
|
||||||
<el-table-column prop="lastInTime" label="最近入库时间" sortable="custom" :formatter="timeFormat" min-width="120px" />
|
|
||||||
<el-table-column fixed="right" label="操作" width="120px" v-if="selVehicle == null">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<el-button plain type="primary" @click="editCurrentRowVehicle(scope.row)">编辑</el-button>
|
|
||||||
</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">
|
|
||||||
<el-form ref="vehicleFormRef" :model="vehicleFormEntity" :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="vehicleId">
|
|
||||||
<el-input v-model="vehicleFormEntity.vehicleId" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="库位" prop="locationId">
|
|
||||||
<el-input v-model="vehicleFormEntity.currentLocation" placeholder="请输入库位号" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="空箱" prop="isEmpty">
|
|
||||||
<el-select-v2 v-model="vehicleFormEntity.isEmpty" placeholder="请选择是否空托"
|
|
||||||
:options="isEmptyOptions"></el-select-v2>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="状态" prop="vehicleStatus">
|
|
||||||
<el-select-v2 v-model="vehicleFormEntity.vehicleStatus" placeholder="请选择料箱状态"
|
|
||||||
:options="vehicleStatusOptions"></el-select-v2>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<span class="dialog-footer">
|
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
|
||||||
<el-button type="primary" @click="submitVehicleInfo(vehicleFormEntity)">
|
|
||||||
确定
|
|
||||||
</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</el-config-provider>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { getAllVehicles, updateVehicleInfo } from '@/api/vehicle'
|
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
|
||||||
import { errorBox } from '@/utils/myMessageBox.js'
|
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
import { Search } from '@element-plus/icons-vue'
|
|
||||||
import { ref, reactive } from 'vue'
|
|
||||||
import { vehicleStatusFormatter, locationFormatter, dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
|
||||||
import { toUnderScoreCase } from '@/utils/stringUtils.js'
|
|
||||||
// import uploadVehicles from '@/excel/uploadVehicles.vue'
|
|
||||||
import { downloadVehicleExcel } from '@/api/excel.js'
|
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
</script>
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
<script>
|
import { queryVehicleInfoByPage } from '@/api/vehicle.js'
|
||||||
export default {
|
import { timeFormatter, locationFormatter, yesOrNoFormatter, vehicleStatusFormatter } from '@/utils/formatter.js'
|
||||||
name: 'vehicle',
|
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
||||||
props: ['selVehicle'],
|
import { ElMessage } from 'element-plus'
|
||||||
emits: ['update:selVehicle'],
|
import { genTableRequest } from '@/utils/generator.js'
|
||||||
data() {
|
import { labelPosition } from '@/constant/form.js'
|
||||||
return {
|
import { yesOrNoOptions, vehicleStatusOptions } from '@/constant/options.js'
|
||||||
vehicles: [],
|
import { addAllOptionOfOptions } from '@/utils/generator.js'
|
||||||
currentPage: 1,
|
import { loading } from '@/utils/loading'
|
||||||
pageSize: 10,
|
/**
|
||||||
total: 0,
|
* 常量定义
|
||||||
sortBy: '',
|
*/
|
||||||
isAsc: true,
|
const STAND_ID = store.getters.getStandId
|
||||||
queryKey: '',
|
const USER_NAME = store.getters.getUserName
|
||||||
locationQuery: '',
|
/**
|
||||||
isEmptyQuery: -99,
|
* 变量定义
|
||||||
loading: true,
|
*/
|
||||||
dialogVisible: false,
|
let maxHeight = ref(window.innerHeight * 0.55)
|
||||||
vehicleId: '',
|
let tableLoading = ref(false)
|
||||||
vehicleFormEntity: reactive({}),
|
let tableData = ref([])
|
||||||
labelPosition: 'top',
|
let baseTableQuery = reactive({
|
||||||
vehicleFormRef: ref(),
|
currentPage: 1,
|
||||||
rules: reactive({
|
pageSize: 10,
|
||||||
vehicleId: [
|
total: 0,
|
||||||
{ required: true, message: '请输入箱号' }
|
sortBy: new Map([['lastInTime', true]]),// 按照成品号顺序排序
|
||||||
],
|
standId: STAND_ID,
|
||||||
currentLocation: [
|
userName: USER_NAME
|
||||||
{ required: true, message: '请输入库位' }
|
})
|
||||||
]
|
let searchQueryFormEntity = reactive({
|
||||||
}),
|
vehicleId: '',
|
||||||
// 是否空箱
|
locationId: '',
|
||||||
isEmptyOptions: [
|
vehicleStatus: -99,
|
||||||
{
|
isLock: -99,
|
||||||
value: -99,
|
isEmpty: -99
|
||||||
label: '全部'
|
})
|
||||||
},
|
let searchQueryFormRef = ref()
|
||||||
{
|
let rowEditFlag = ref(false)
|
||||||
value: 0,
|
let vehicleId = ''
|
||||||
label: '带料'
|
let rowEditFormRef = ref()
|
||||||
},
|
let rowFormEntity = reactive({})
|
||||||
{
|
/**
|
||||||
value: 1,
|
* 系统方法
|
||||||
label: '空箱'
|
*/
|
||||||
}
|
onMounted(() => {
|
||||||
],
|
nextTick(() => {
|
||||||
// 料箱状态
|
window.addEventListener('resize', resizeHeight)
|
||||||
vehicleStatusOptions: [
|
search()
|
||||||
{
|
})
|
||||||
value: 1,
|
})
|
||||||
label: '入库中'
|
onBeforeUnmount(() => {
|
||||||
},
|
nextTick(() => {
|
||||||
{
|
window.removeEventListener('resize', resizeHeight)
|
||||||
value: 2,
|
})
|
||||||
label: '在库中'
|
})
|
||||||
},
|
const resizeHeight = () => {
|
||||||
{
|
maxHeight.value = window.innerHeight * 0.55
|
||||||
value: 3,
|
}
|
||||||
label: '出库中'
|
/**
|
||||||
},
|
* 自定义方法
|
||||||
{
|
*/
|
||||||
value: 99,
|
// 查询
|
||||||
label: '异常'
|
const search = () => {
|
||||||
},
|
tableLoading.value = true
|
||||||
]
|
let request = genTableRequest(baseTableQuery)
|
||||||
|
// 设定查询参数
|
||||||
|
request.vehicleId = searchQueryFormEntity.vehicleId.trim()
|
||||||
|
request.locationId = searchQueryFormEntity.locationId.trim()
|
||||||
|
request.vehicleStatus = searchQueryFormEntity.vehicleStatus == -99 ? null : searchQueryFormEntity.vehicleStatus
|
||||||
|
request.isLock = searchQueryFormEntity.isLock == -99 ? null : searchQueryFormEntity.isLock
|
||||||
|
request.isEmpty = searchQueryFormEntity.isEmpty == -99 ? null : searchQueryFormEntity.isEmpty
|
||||||
|
queryVehicleInfoByPage(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 => {
|
||||||
mounted() {
|
console.log(err)
|
||||||
this.search()
|
ElMessage.error('查询数据异常。')
|
||||||
},
|
}).finally(() => {
|
||||||
methods: {
|
tableLoading.value = false
|
||||||
search() {
|
})
|
||||||
this.loading = true
|
}
|
||||||
const tableRequest = {
|
const clearQuery = () => {
|
||||||
pageNo: this.currentPage,
|
searchQueryFormEntity.vehicleId = ''
|
||||||
pageSize: this.pageSize,
|
searchQueryFormEntity.locationId = ''
|
||||||
sortBy: this.sortBy,
|
}
|
||||||
isAsc: this.isAsc,
|
const handleSortChange = (data) => {
|
||||||
vehicleId: this.queryKey.trim(),
|
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||||
currentLocation: this.locationQuery.trim(),
|
baseTableQuery.sortBy.delete(data.prop)
|
||||||
isEmpty: this.isEmptyQuery == -99 ? null : this.isEmptyQuery,
|
|
||||||
userName: store.getters.getUserName
|
|
||||||
}
|
|
||||||
getAllVehicles(tableRequest).then(res => {
|
|
||||||
const tableResponse = res.data
|
|
||||||
if (tableResponse.code == 0) {
|
|
||||||
this.vehicles = tableResponse.returnData.lists
|
|
||||||
this.total = tableResponse.returnData.total
|
|
||||||
} else {
|
|
||||||
errorBox(tableResponse.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
errorBox('查询料箱信息错误')
|
|
||||||
})
|
|
||||||
this.loading = false
|
|
||||||
},
|
|
||||||
handleSortChange(data) {
|
|
||||||
this.sortBy = toUnderScoreCase(data.prop)
|
|
||||||
this.isAsc = data.order == 'ascending'
|
|
||||||
this.search()
|
|
||||||
},
|
|
||||||
vehicleStatusFormat: (row, column, cellValue, index) => {
|
|
||||||
return vehicleStatusFormatter(cellValue)
|
|
||||||
},
|
|
||||||
locationFormat: (row, column, cellValue, index) => {
|
|
||||||
return locationFormatter(cellValue)
|
|
||||||
},
|
|
||||||
timeFormat: (row, column, cellValue, index) => {
|
|
||||||
return timeFormatter(cellValue)
|
|
||||||
},
|
|
||||||
isEmptyFormat: (row, column, cellValue, index) => {
|
|
||||||
if (cellValue == 0) {
|
|
||||||
return '带料'
|
|
||||||
}
|
|
||||||
if (cellValue == 1) {
|
|
||||||
return '空箱'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
reset() {
|
|
||||||
this.queryKey = ''
|
|
||||||
this.locationQuery = ''
|
|
||||||
this.search()
|
|
||||||
},
|
|
||||||
editCurrentRowVehicle(row) {
|
|
||||||
this.vehicleFormEntity = {
|
|
||||||
vehicleId: row.vehicleId,
|
|
||||||
currentLocation: row.currentLocation,
|
|
||||||
isEmpty: row.isEmpty,
|
|
||||||
vehicleStatus: row.vehicleStatus,
|
|
||||||
lastInTime: row.lastInTime
|
|
||||||
}
|
|
||||||
this.dialogVisible = true
|
|
||||||
},
|
|
||||||
submitVehicleInfo(formData) {
|
|
||||||
const request = {
|
|
||||||
vehicleId: formData.vehicleId,
|
|
||||||
currentLocation: formData.currentLocation,
|
|
||||||
isEmpty: formData.isEmpty,
|
|
||||||
vehicleStatus: formData.vehicleStatus,
|
|
||||||
lastInTime: formData.lastInTime,
|
|
||||||
userName: store.getters.getUserName
|
|
||||||
}
|
|
||||||
updateVehicleInfo(request).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.vehicleId = row.vehicleId
|
|
||||||
this.$emit('update:selVehicle', row)
|
|
||||||
},
|
|
||||||
exportExcel() {
|
|
||||||
const request = {
|
|
||||||
pageNo: this.currentPage,
|
|
||||||
pageSize: this.pageSize,
|
|
||||||
vehicleId: this.queryKey.trim(),
|
|
||||||
currentLocation: this.locationQuery.trim(),
|
|
||||||
isEmpty: this.isEmptyQuery == -99 ? null : this.isEmptyQuery,
|
|
||||||
userName: store.getters.getUserName
|
|
||||||
}
|
|
||||||
downloadVehicleExcel(request).then(res => {
|
|
||||||
const link = document.createElement('a');//创建a标签
|
|
||||||
try {
|
|
||||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
|
||||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
|
||||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
|
||||||
let _fileName = "料箱报表" + dateFormatter(new Date) + ".xlsx"
|
|
||||||
link.style.display = 'none'//隐藏
|
|
||||||
|
|
||||||
// 兼容不同浏览器的URL对象
|
|
||||||
const url = window.URL || window.webkitURL || window.moxURL
|
|
||||||
link.href = url.createObjectURL(blob)
|
|
||||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
|
||||||
document.body.appendChild(link)
|
|
||||||
link.click()
|
|
||||||
document.body.removeChild(link)
|
|
||||||
url.revokeObjectURL(link.href)//移除url对象
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e)
|
|
||||||
errorBox('下载文件失败')
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
errorBox('导出失败')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||||
|
search()
|
||||||
|
}
|
||||||
|
const getCurrentRow = (row) => {
|
||||||
|
vehicleId = row.vehicleId
|
||||||
|
}
|
||||||
|
const timeFormat = (row, column, cellValue, index) => {
|
||||||
|
return timeFormatter(cellValue)
|
||||||
|
}
|
||||||
|
const yesOrNoFormat = (row, column, cellValue, index) => {
|
||||||
|
return yesOrNoFormatter(cellValue)
|
||||||
|
}
|
||||||
|
const locationFormat = (row, column, cellValue, index) => {
|
||||||
|
return locationFormatter(cellValue)
|
||||||
|
}
|
||||||
|
const vehicleStatusFormat = (row, column, cellValue, index) => {
|
||||||
|
return vehicleStatusFormatter(cellValue)
|
||||||
|
}
|
||||||
|
// 编辑弹框
|
||||||
|
const editCurrentRowFormEntity = (row) => {
|
||||||
|
// 设置form值
|
||||||
|
rowFormEntity.workIndex = row.workIndex
|
||||||
|
rowFormEntity.workOrder = row.workOrder
|
||||||
|
rowFormEntity.productId = row.productId
|
||||||
|
rowFormEntity.singleProductId = row.singleProductId
|
||||||
|
rowFormEntity.boxNo = row.boxNo
|
||||||
|
rowFormEntity.goodsId = row.goodsId
|
||||||
|
rowFormEntity.needNum = row.needNum
|
||||||
|
rowFormEntity.distributeNum = row.distributeNum
|
||||||
|
rowFormEntity.finishNum = row.finishNum
|
||||||
|
rowFormEntity.workStatus = row.workStatus
|
||||||
|
rowFormEntity.lackStatus = row.lackStatus
|
||||||
|
// 弹出框
|
||||||
|
rowEditFlag.value = true
|
||||||
|
}
|
||||||
|
// 关闭当前缺料工作
|
||||||
|
const closeLackWork = (row) => {
|
||||||
|
const request = {
|
||||||
|
workIndex: row.workIndex,
|
||||||
|
standId: STAND_ID,
|
||||||
|
userName: USER_NAME
|
||||||
|
}
|
||||||
|
loading.open('关闭中...')
|
||||||
|
closeCurrentWorks(request).then(res => {
|
||||||
|
const response = res.data
|
||||||
|
if (response.code == 0) {
|
||||||
|
ElMessage.success(response.message)
|
||||||
|
search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error(response.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('请求异常。')
|
||||||
|
}).finally(() => {
|
||||||
|
loading.close()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 更新当前行数据
|
||||||
|
const submitUpdateRow = (rowFormEntity) => {
|
||||||
|
const request = {
|
||||||
|
workIndex: rowFormEntity.workIndex,
|
||||||
|
distributeNum: rowFormEntity.distributeNum,
|
||||||
|
finishNum: rowFormEntity.finishNum,
|
||||||
|
workStatus: rowFormEntity.workStatus,
|
||||||
|
lackStatus: rowFormEntity.lackStatus,
|
||||||
|
standId: STAND_ID,
|
||||||
|
userName: USER_NAME
|
||||||
|
}
|
||||||
|
loading.open('更新中...')
|
||||||
|
updateKateWorks(request).then(res => {
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
ElMessage.success('更新数据成功。')
|
||||||
|
rowEditFlag.value = false
|
||||||
|
search()
|
||||||
|
} else {
|
||||||
|
ElMessage.error('更新数据失败。')
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('更新数据异常。')
|
||||||
|
}).finally(() => {
|
||||||
|
loading.close()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<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 {
|
.el-pagination {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-button {
|
.my-autocomplete li {
|
||||||
width: 72px;
|
width: 196px;
|
||||||
margin-left: 0px;
|
line-height: normal;
|
||||||
margin-right: 5px;
|
padding: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-class {
|
.my-autocomplete li .name {
|
||||||
width: 100%;
|
text-overflow: ellipsis;
|
||||||
/* font-size: 5px; */
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item {
|
.my-autocomplete li .addr {
|
||||||
width: 10% inherit;
|
font-size: 12px;
|
||||||
justify-content: center;
|
color: #b4b4b4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item .el-select-v2 {
|
.my-autocomplete li .highlighted .addr {
|
||||||
width: 100% !important;
|
color: #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item .el-input-number {
|
.my-autocomplete li .goods_id {
|
||||||
width: 100% !important;
|
color: brown;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-form-item .el-button {
|
.my-autocomplete li .goods_name {
|
||||||
margin: auto;
|
color: cornflowerblue;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-search {
|
||||||
|
height: 30px;
|
||||||
|
width: 80px;
|
||||||
|
margin: auto 5px 5px auto;
|
||||||
|
color: black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -146,3 +146,18 @@ export const wmsTaskStatusFormatter = (value) => {
|
||||||
return '未知状态'
|
return '未知状态'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 料箱状态
|
||||||
|
export const vehicleStatusFormatter = (value) => {
|
||||||
|
switch (value) {
|
||||||
|
case 1:
|
||||||
|
return '入库中'
|
||||||
|
case 2:
|
||||||
|
return '在库中'
|
||||||
|
case 3:
|
||||||
|
return '出库中'
|
||||||
|
case 9:
|
||||||
|
return '锁定中'
|
||||||
|
default:
|
||||||
|
return '未知状态'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { toUnderScoreCase } from '@/utils/stringUtils.js'
|
import { toUnderScoreCase } from '@/utils/stringUtils.js'
|
||||||
// 构建table基本请求---带分页
|
// 构建table基本请求---带分页
|
||||||
export function genTableRequest(baseTableQuery) {
|
export const genTableRequest = (baseTableQuery) => {
|
||||||
// 构建sortBy的集合
|
// 构建sortBy的集合
|
||||||
let sortBy = []
|
let sortBy = []
|
||||||
for (const [key, value] of baseTableQuery.sortBy) {
|
for (const [key, value] of baseTableQuery.sortBy) {
|
||||||
|
|
@ -23,7 +23,7 @@ export function genTableRequest(baseTableQuery) {
|
||||||
* @param {*} options
|
* @param {*} options
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function addAllOptionOfOptions(options) {
|
export const addAllOptionOfOptions = (options) => {
|
||||||
const allOption = [
|
const allOption = [
|
||||||
{
|
{
|
||||||
value: -99,
|
value: -99,
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,11 @@
|
||||||
import crypto from 'crypto'
|
import crypto from 'crypto'
|
||||||
function base64URLEncode(str) {
|
export const base64URLEncode = (str) => {
|
||||||
return str.toString('base64')
|
return str.toString('base64')
|
||||||
.replace(/\+/g, '-')
|
.replace(/\+/g, '-')
|
||||||
.replace(/\//g, '_')
|
.replace(/\//g, '_')
|
||||||
.replace(/=/g, '');
|
.replace(/=/g, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
function getHashString(obj) {
|
export const getHashString = (obj) => {
|
||||||
return base64URLEncode(crypto.createHash('sha256').update(obj).digest())
|
return base64URLEncode(crypto.createHash('sha256').update(obj).digest())
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
|
||||||
base64URLEncode,
|
|
||||||
getHashString
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// 语音播报
|
// 语音播报
|
||||||
export function speak (message) {
|
export const speak = (message) => {
|
||||||
window.speechSynthesis.speak(new SpeechSynthesisUtterance(message));
|
window.speechSynthesis.speak(new SpeechSynthesisUtterance(message))
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { ElMessageBox } from 'element-plus'
|
import { ElMessageBox } from 'element-plus'
|
||||||
|
|
||||||
function errorBox(msg) {
|
export const errorBox = (msg) => {
|
||||||
ElMessageBox.alert(msg, '错误', {
|
ElMessageBox.alert(msg, '错误', {
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
|
|
@ -17,7 +17,7 @@ function errorBox(msg) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function successBox(msg) {
|
export const successBox = (msg) => {
|
||||||
ElMessageBox.alert(msg, '成功', {
|
ElMessageBox.alert(msg, '成功', {
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
|
|
@ -34,7 +34,7 @@ function successBox(msg) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function infoBox(msg) {
|
export const infoBox = (msg) => {
|
||||||
ElMessageBox.alert(msg, '提示', {
|
ElMessageBox.alert(msg, '提示', {
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
|
|
@ -51,7 +51,7 @@ function infoBox(msg) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function warningBox(msg) {
|
export const warningBox = (msg) => {
|
||||||
ElMessageBox.alert(msg, '警告', {
|
ElMessageBox.alert(msg, '警告', {
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
|
|
@ -67,10 +67,3 @@ function warningBox(msg) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
|
||||||
errorBox,
|
|
||||||
successBox,
|
|
||||||
infoBox,
|
|
||||||
warningBox
|
|
||||||
}
|
|
||||||
|
|
@ -1,35 +1,27 @@
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
function genTaskId(code) {
|
export const genTaskId = (code) => {
|
||||||
return code + moment(new Date()).format("YYYYMMDDHHmmssSSS");
|
return code + moment(new Date()).format("YYYYMMDDHHmmssSSS");
|
||||||
}
|
}
|
||||||
|
|
||||||
function toCamelCase(str) {
|
export const toCamelCase = (str) => {
|
||||||
return str.replace(/-(\w)/g, function (_, c) {
|
return str.replace(/-(\w)/g, function (_, c) {
|
||||||
return c ? c.toUpperCase() : "";
|
return c ? c.toUpperCase() : "";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function toUnderScoreCase(str) {
|
export const toUnderScoreCase = (str) => {
|
||||||
return str.replace(/([A-Z])/g, function (_, c) {
|
return str.replace(/([A-Z])/g, function (_, c) {
|
||||||
return "_" + c.toLowerCase();
|
return "_" + c.toLowerCase();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSingleCharacter(c) {
|
export const isSingleCharacter = (c) => {
|
||||||
if (c.length !== 1) {
|
if (c.length !== 1) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return c.toLowerCase() >= 'a' && c.toLowerCase() <= 'z'
|
return c.toLowerCase() >= 'a' && c.toLowerCase() <= 'z'
|
||||||
}
|
}
|
||||||
|
|
||||||
function isNumber(d) {
|
export const isNumber = (d) => {
|
||||||
return d >= '0' && d <= '9'
|
return d >= '0' && d <= '9'
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
|
||||||
genTaskId,
|
|
||||||
toCamelCase,
|
|
||||||
toUnderScoreCase,
|
|
||||||
isSingleCharacter,
|
|
||||||
isNumber
|
|
||||||
}
|
|
||||||
|
|
@ -2,6 +2,9 @@ package com.wms_main.controller.wms;
|
||||||
|
|
||||||
import com.wms_main.model.dto.query.LocationQuery;
|
import com.wms_main.model.dto.query.LocationQuery;
|
||||||
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
||||||
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
|
import com.wms_main.model.vo.wms.LocationVo;
|
||||||
|
import com.wms_main.model.vo.wms.PageVo;
|
||||||
import com.wms_main.service.controller.ILocationControllerService;
|
import com.wms_main.service.controller.ILocationControllerService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
@ -26,4 +29,14 @@ public class LocationController {
|
||||||
public BaseWmsApiResponse genLocations(@RequestBody LocationQuery locationQuery) {
|
public BaseWmsApiResponse genLocations(@RequestBody LocationQuery locationQuery) {
|
||||||
return locationControllerService.genLocations(locationQuery);
|
return locationControllerService.genLocations(locationQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询库位
|
||||||
|
* @param locationQuery 查询参数
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/queryLocationsByPage")
|
||||||
|
public WmsApiResponse<PageVo<LocationVo>> queryLocationsByPage(@RequestBody LocationQuery locationQuery) {
|
||||||
|
return locationControllerService.queryLocationsByPage(locationQuery);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
package com.wms_main.controller.wms;
|
package com.wms_main.controller.wms;
|
||||||
|
|
||||||
|
import com.wms_main.model.dto.query.VehicleQuery;
|
||||||
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
|
import com.wms_main.model.vo.wms.PageVo;
|
||||||
|
import com.wms_main.model.vo.wms.VehicleVo;
|
||||||
|
import com.wms_main.service.controller.IVehicleControllerService;
|
||||||
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;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 载具控制类
|
* 载具控制类
|
||||||
|
|
@ -15,4 +17,15 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RequestMapping("/wms/vehicle")
|
@RequestMapping("/wms/vehicle")
|
||||||
public class VehicleController {
|
public class VehicleController {
|
||||||
|
private final IVehicleControllerService vehicleControllerService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询载具信息
|
||||||
|
* @param vehicleQuery 查询参数
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/queryVehicleInfoByPage")
|
||||||
|
public WmsApiResponse<PageVo<VehicleVo>> queryVehicleInfoByPage(@RequestBody VehicleQuery vehicleQuery) {
|
||||||
|
return vehicleControllerService.queryVehicleInfoByPage(vehicleQuery);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,6 @@ public class GoodsQuery extends PageQuery {
|
||||||
/**
|
/**
|
||||||
* 料名
|
* 料名
|
||||||
*/
|
*/
|
||||||
@JsonProperty("goodsDescription")
|
@JsonProperty("goodsDesc")
|
||||||
private String goodsDescription;
|
private String goodsDesc;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,78 @@ import lombok.NoArgsConstructor;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class LocationQuery extends PageQuery{
|
public class LocationQuery extends PageQuery{
|
||||||
/**
|
/**
|
||||||
* 库位ID
|
* 库位id
|
||||||
*/
|
*/
|
||||||
@JsonProperty("locationId")
|
@JsonProperty("locationId")
|
||||||
private String locationId;
|
private String locationId;
|
||||||
|
/**
|
||||||
|
* 外部编号
|
||||||
|
*/
|
||||||
|
@JsonProperty("outerId")
|
||||||
|
private String outerId;
|
||||||
|
/**
|
||||||
|
* 库位类型
|
||||||
|
*/
|
||||||
|
@JsonProperty("locationType")
|
||||||
|
private Integer locationType;
|
||||||
|
/**
|
||||||
|
* 是否锁定
|
||||||
|
*/
|
||||||
|
@JsonProperty("isLock")
|
||||||
|
private Integer isLock;
|
||||||
|
/**
|
||||||
|
* 是否占用
|
||||||
|
*/
|
||||||
|
@JsonProperty("isOccupy")
|
||||||
|
private Integer isOccupy;
|
||||||
|
/**
|
||||||
|
* 是否在工作中
|
||||||
|
*/
|
||||||
|
@JsonProperty("isWorking")
|
||||||
|
private Integer isWorking;
|
||||||
|
/**
|
||||||
|
* 对应设备号
|
||||||
|
*/
|
||||||
|
@JsonProperty("equipmentId")
|
||||||
|
private Integer equipmentId;
|
||||||
|
/**
|
||||||
|
* 对应巷道号
|
||||||
|
*/
|
||||||
|
@JsonProperty("tunnelId")
|
||||||
|
private Integer tunnelId;
|
||||||
|
/**
|
||||||
|
* 排
|
||||||
|
*/
|
||||||
|
@JsonProperty("lRow")
|
||||||
|
private Integer lRow;
|
||||||
|
/**
|
||||||
|
* 列
|
||||||
|
*/
|
||||||
|
@JsonProperty("lCol")
|
||||||
|
private Integer lCol;
|
||||||
|
/**
|
||||||
|
* 层
|
||||||
|
*/
|
||||||
|
@JsonProperty("lLayer")
|
||||||
|
private Integer lLayer;
|
||||||
|
/**
|
||||||
|
* 深度
|
||||||
|
*/
|
||||||
|
@JsonProperty("lDepth")
|
||||||
|
private Integer lDepth;
|
||||||
|
/**
|
||||||
|
* 载具号
|
||||||
|
*/
|
||||||
|
@JsonProperty("vehicleId")
|
||||||
|
private String vehicleId;
|
||||||
|
/**
|
||||||
|
* 库区
|
||||||
|
*/
|
||||||
|
@JsonProperty("areaId")
|
||||||
|
private Integer areaId;
|
||||||
|
/**
|
||||||
|
* 子区域
|
||||||
|
*/
|
||||||
|
@JsonProperty("subArea")
|
||||||
|
private String subArea;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
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 VehicleQuery extends PageQuery {
|
||||||
|
/**
|
||||||
|
* 载具号
|
||||||
|
*/
|
||||||
|
@JsonProperty("vehicleId")
|
||||||
|
private String vehicleId;
|
||||||
|
/**
|
||||||
|
* 库位
|
||||||
|
*/
|
||||||
|
@JsonProperty("locationId")
|
||||||
|
private String locationId;
|
||||||
|
/**
|
||||||
|
* 载具状态
|
||||||
|
*/
|
||||||
|
@JsonProperty("vehicleStatus")
|
||||||
|
private Integer vehicleStatus;
|
||||||
|
/**
|
||||||
|
* 是否锁定
|
||||||
|
*/
|
||||||
|
@JsonProperty("isLock")
|
||||||
|
private Integer isLock;
|
||||||
|
/**
|
||||||
|
* 是否空载具
|
||||||
|
*/
|
||||||
|
@JsonProperty("isEmpty")
|
||||||
|
private Integer isEmpty;
|
||||||
|
}
|
||||||
|
|
@ -43,6 +43,7 @@ public class TAppLocation {
|
||||||
/**
|
/**
|
||||||
* 是否在工作中
|
* 是否在工作中
|
||||||
*/
|
*/
|
||||||
|
@TableField(value = "is_working")
|
||||||
private Integer isWorking;
|
private Integer isWorking;
|
||||||
/**
|
/**
|
||||||
* 对应设备号
|
* 对应设备号
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.wms_main.model.vo.wms;
|
package com.wms_main.model.vo.wms;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.wms_main.model.po.TAppGoods;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
@ -59,4 +60,45 @@ public class GoodsVo extends BaseImportVo {
|
||||||
*/
|
*/
|
||||||
@JsonProperty("putArea")
|
@JsonProperty("putArea")
|
||||||
private String putArea;
|
private String putArea;
|
||||||
|
/**
|
||||||
|
* 热点分析ABC
|
||||||
|
*/
|
||||||
|
@JsonProperty("hotPoint")
|
||||||
|
private String hotPoint;
|
||||||
|
/**
|
||||||
|
* 立库可放箱数
|
||||||
|
*/
|
||||||
|
@JsonProperty("maxBoxNum")
|
||||||
|
private Integer maxBoxNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将po对象转换为vo对象
|
||||||
|
* @param po po对象
|
||||||
|
* @return vo
|
||||||
|
*/
|
||||||
|
public static GoodsVo of(TAppGoods po) {
|
||||||
|
if (po == null) {
|
||||||
|
return new GoodsVo();
|
||||||
|
}
|
||||||
|
// 创建Vo
|
||||||
|
GoodsVo resultVo = new GoodsVo(
|
||||||
|
po.getGoodsId(),
|
||||||
|
po.getPlant(),
|
||||||
|
po.getGoodsDescription(),
|
||||||
|
po.getVendorName(),
|
||||||
|
po.getIsSled(),
|
||||||
|
po.getSledDays(),
|
||||||
|
po.getFeedingType(),
|
||||||
|
po.getBoxQty(),
|
||||||
|
po.getPutArea(),
|
||||||
|
po.getHotPoint(),
|
||||||
|
po.getMaxBoxNum()
|
||||||
|
);
|
||||||
|
// 设定导入相关数据
|
||||||
|
resultVo.setFirstImportTime(po.getFirstImportTime());
|
||||||
|
resultVo.setFirstImportUser(po.getFirstImportUser());
|
||||||
|
resultVo.setLastUpdateTime(po.getLastUpdateTime());
|
||||||
|
resultVo.setLastUpdateUser(po.getLastUpdateUser());
|
||||||
|
return resultVo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,120 @@
|
||||||
|
package com.wms_main.model.vo.wms;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.wms_main.model.po.TAppLocation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库位Vo
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class LocationVo {
|
||||||
|
/**
|
||||||
|
* 库位id
|
||||||
|
*/
|
||||||
|
@JsonProperty("locationId")
|
||||||
|
private String locationId;
|
||||||
|
/**
|
||||||
|
* 外部编号
|
||||||
|
*/
|
||||||
|
@JsonProperty("outerId")
|
||||||
|
private String outerId;
|
||||||
|
/**
|
||||||
|
* 库位类型
|
||||||
|
*/
|
||||||
|
@JsonProperty("locationType")
|
||||||
|
private Integer locationType;
|
||||||
|
/**
|
||||||
|
* 是否锁定
|
||||||
|
*/
|
||||||
|
@JsonProperty("isLock")
|
||||||
|
private Integer isLock;
|
||||||
|
/**
|
||||||
|
* 是否占用
|
||||||
|
*/
|
||||||
|
@JsonProperty("isOccupy")
|
||||||
|
private Integer isOccupy;
|
||||||
|
/**
|
||||||
|
* 是否在工作中
|
||||||
|
*/
|
||||||
|
@JsonProperty("isWorking")
|
||||||
|
private Integer isWorking;
|
||||||
|
/**
|
||||||
|
* 对应设备号
|
||||||
|
*/
|
||||||
|
@JsonProperty("equipmentId")
|
||||||
|
private Integer equipmentId;
|
||||||
|
/**
|
||||||
|
* 对应巷道号
|
||||||
|
*/
|
||||||
|
@JsonProperty("tunnelId")
|
||||||
|
private Integer tunnelId;
|
||||||
|
/**
|
||||||
|
* 排
|
||||||
|
*/
|
||||||
|
@JsonProperty("lRow")
|
||||||
|
private Integer lRow;
|
||||||
|
/**
|
||||||
|
* 列
|
||||||
|
*/
|
||||||
|
@JsonProperty("lCol")
|
||||||
|
private Integer lCol;
|
||||||
|
/**
|
||||||
|
* 层
|
||||||
|
*/
|
||||||
|
@JsonProperty("lLayer")
|
||||||
|
private Integer lLayer;
|
||||||
|
/**
|
||||||
|
* 深度
|
||||||
|
*/
|
||||||
|
@JsonProperty("lDepth")
|
||||||
|
private Integer lDepth;
|
||||||
|
/**
|
||||||
|
* 载具号
|
||||||
|
*/
|
||||||
|
@JsonProperty("vehicleId")
|
||||||
|
private String vehicleId;
|
||||||
|
/**
|
||||||
|
* 库区
|
||||||
|
*/
|
||||||
|
@JsonProperty("areaId")
|
||||||
|
private Integer areaId;
|
||||||
|
/**
|
||||||
|
* 子区域
|
||||||
|
*/
|
||||||
|
@JsonProperty("subArea")
|
||||||
|
private String subArea;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将po转换为vo
|
||||||
|
* @param po po
|
||||||
|
* @return vo
|
||||||
|
*/
|
||||||
|
public static LocationVo of(TAppLocation po) {
|
||||||
|
if (po == null) {
|
||||||
|
return new LocationVo();
|
||||||
|
}
|
||||||
|
// 构建返回值
|
||||||
|
return new LocationVo(
|
||||||
|
po.getLocationId(),
|
||||||
|
po.getOuterId(),
|
||||||
|
po.getLocationType(),
|
||||||
|
po.getIsLock(),
|
||||||
|
po.getIsOccupy(),
|
||||||
|
po.getIsWorking(),
|
||||||
|
po.getEquipmentId(),
|
||||||
|
po.getTunnelId(),
|
||||||
|
po.getLRow(),
|
||||||
|
po.getLCol(),
|
||||||
|
po.getLLayer(),
|
||||||
|
po.getLDepth(),
|
||||||
|
po.getVehicleId(),
|
||||||
|
po.getAreaId(),
|
||||||
|
po.getSubArea()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
package com.wms_main.model.vo.wms;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.wms_main.model.po.TAppVehicle;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 载具显示Vo
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class VehicleVo {
|
||||||
|
/**
|
||||||
|
* 载具号
|
||||||
|
*/
|
||||||
|
@JsonProperty("vehicleId")
|
||||||
|
private String vehicleId;
|
||||||
|
/**
|
||||||
|
* 是否空载具
|
||||||
|
*/
|
||||||
|
@JsonProperty("isEmpty")
|
||||||
|
private Integer isEmpty;
|
||||||
|
/**
|
||||||
|
* 载具状态
|
||||||
|
*/
|
||||||
|
@JsonProperty("vehicleStatus")
|
||||||
|
private Integer vehicleStatus;
|
||||||
|
/**
|
||||||
|
* 载具类型
|
||||||
|
*/
|
||||||
|
@JsonProperty("vehicleType")
|
||||||
|
private String vehicleType;
|
||||||
|
/**
|
||||||
|
* 是否锁定
|
||||||
|
*/
|
||||||
|
@JsonProperty("isLock")
|
||||||
|
private Integer isLock;
|
||||||
|
/**
|
||||||
|
* 库位
|
||||||
|
*/
|
||||||
|
@JsonProperty("locationId")
|
||||||
|
private String locationId;
|
||||||
|
/**
|
||||||
|
* 上次入库时间
|
||||||
|
*/
|
||||||
|
@JsonProperty("lastInTime")
|
||||||
|
private LocalDateTime lastInTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将po对象转换为vo对象
|
||||||
|
* @param po po对象
|
||||||
|
* @return vo
|
||||||
|
*/
|
||||||
|
public static VehicleVo of(TAppVehicle po) {
|
||||||
|
if (po == null) {
|
||||||
|
return new VehicleVo();
|
||||||
|
}
|
||||||
|
// 返回vo
|
||||||
|
return new VehicleVo(
|
||||||
|
po.getVehicleId(),
|
||||||
|
po.getIsEmpty(),
|
||||||
|
po.getVehicleStatus(),
|
||||||
|
po.getVehicleType(),
|
||||||
|
po.getIsLock(),
|
||||||
|
po.getLocationId(),
|
||||||
|
po.getLastInTime()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,9 @@ package com.wms_main.service.controller;
|
||||||
|
|
||||||
import com.wms_main.model.dto.query.LocationQuery;
|
import com.wms_main.model.dto.query.LocationQuery;
|
||||||
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
||||||
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
|
import com.wms_main.model.vo.wms.LocationVo;
|
||||||
|
import com.wms_main.model.vo.wms.PageVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库位控制类服务
|
* 库位控制类服务
|
||||||
|
|
@ -13,4 +16,11 @@ public interface ILocationControllerService {
|
||||||
* @return 创建结果
|
* @return 创建结果
|
||||||
*/
|
*/
|
||||||
BaseWmsApiResponse genLocations(LocationQuery locationQuery);
|
BaseWmsApiResponse genLocations(LocationQuery locationQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件分页查询库位列表---分页
|
||||||
|
* @param locationQuery 查询参数
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
WmsApiResponse<PageVo<LocationVo>> queryLocationsByPage(LocationQuery locationQuery);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.wms_main.service.controller;
|
||||||
|
|
||||||
|
import com.wms_main.model.dto.query.VehicleQuery;
|
||||||
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
|
import com.wms_main.model.vo.wms.PageVo;
|
||||||
|
import com.wms_main.model.vo.wms.VehicleVo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 载具控制类服务接口
|
||||||
|
*/
|
||||||
|
public interface IVehicleControllerService {
|
||||||
|
/**
|
||||||
|
* 根据条件分页查询载具信息
|
||||||
|
* @param vehicleQuery 查询参数
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
WmsApiResponse<PageVo<VehicleVo>> queryVehicleInfoByPage(VehicleQuery vehicleQuery);
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.wms_main.service.controller.serviceImpl;
|
package com.wms_main.service.controller.serviceImpl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
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.dao.ITAppGoodsService;
|
import com.wms_main.dao.ITAppGoodsService;
|
||||||
|
|
@ -23,6 +22,7 @@ import org.springframework.stereotype.Service;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class GoodsControllerServiceImpl implements IGoodsControllerService {
|
public class GoodsControllerServiceImpl implements IGoodsControllerService {
|
||||||
private final ITAppGoodsService goodsService;
|
private final ITAppGoodsService goodsService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 实现--查询物料信息(分页)
|
* 实现--查询物料信息(分页)
|
||||||
* @param goodsQuery 查询参数
|
* @param goodsQuery 查询参数
|
||||||
|
|
@ -30,16 +30,15 @@ public class GoodsControllerServiceImpl implements IGoodsControllerService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public WmsApiResponse<PageVo<GoodsVo>> getGoodsInfoByPage(GoodsQuery goodsQuery) {
|
public WmsApiResponse<PageVo<GoodsVo>> getGoodsInfoByPage(GoodsQuery goodsQuery) {
|
||||||
try {
|
if (goodsQuery == null) {
|
||||||
Page<TAppGoods> page = goodsQuery.toMpPage();
|
return WmsApiResponse.error("查询参数不能为NULL", null);
|
||||||
Page<TAppGoods> goodsPage = goodsService.page(page, new LambdaQueryWrapper<TAppGoods>()
|
|
||||||
.like(StringUtils.isNotEmpty(goodsQuery.getGoodsId()), TAppGoods::getGoodsId, goodsQuery.getGoodsId())
|
|
||||||
.like(StringUtils.isNotEmpty(goodsQuery.getGoodsDescription()), TAppGoods::getGoodsDescription, goodsQuery.getGoodsDescription()));
|
|
||||||
|
|
||||||
PageVo<GoodsVo> pageVo = PageVo.of(goodsPage, goods -> BeanUtil.copyProperties(goods, GoodsVo.class));
|
|
||||||
return WmsApiResponse.success("查询成功", pageVo);
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new RuntimeException("查询错误。");
|
|
||||||
}
|
}
|
||||||
|
Page<TAppGoods> page = goodsQuery.toMpPage();
|
||||||
|
Page<TAppGoods> goodsPage = goodsService.page(page, new LambdaQueryWrapper<TAppGoods>()
|
||||||
|
.like(StringUtils.isNotEmpty(goodsQuery.getGoodsId()), TAppGoods::getGoodsId, goodsQuery.getGoodsId())
|
||||||
|
.like(StringUtils.isNotEmpty(goodsQuery.getGoodsDesc()), TAppGoods::getGoodsDescription, goodsQuery.getGoodsDesc()));
|
||||||
|
|
||||||
|
PageVo<GoodsVo> pageVo = PageVo.of(goodsPage, GoodsVo::of);
|
||||||
|
return WmsApiResponse.success("查询成功", pageVo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,14 @@
|
||||||
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.extension.plugins.pagination.Page;
|
||||||
import com.wms_main.dao.ITAppLocationService;
|
import com.wms_main.dao.ITAppLocationService;
|
||||||
import com.wms_main.model.dto.query.LocationQuery;
|
import com.wms_main.model.dto.query.LocationQuery;
|
||||||
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
||||||
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
import com.wms_main.model.po.TAppLocation;
|
import com.wms_main.model.po.TAppLocation;
|
||||||
|
import com.wms_main.model.vo.wms.LocationVo;
|
||||||
|
import com.wms_main.model.vo.wms.PageVo;
|
||||||
import com.wms_main.repository.utils.StringUtils;
|
import com.wms_main.repository.utils.StringUtils;
|
||||||
import com.wms_main.service.controller.ILocationControllerService;
|
import com.wms_main.service.controller.ILocationControllerService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
@ -62,4 +67,26 @@ public class LocationControllerServiceImpl implements ILocationControllerService
|
||||||
appLocationService.saveBatch(newLocationList);
|
appLocationService.saveBatch(newLocationList);
|
||||||
return BaseWmsApiResponse.success("成功创建了" + newLocationList.size() + "个库位。");
|
return BaseWmsApiResponse.success("成功创建了" + newLocationList.size() + "个库位。");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询库位信息(分页)---实现
|
||||||
|
* @param locationQuery 查询参数
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WmsApiResponse<PageVo<LocationVo>> queryLocationsByPage(LocationQuery locationQuery) {
|
||||||
|
if (locationQuery == null) {
|
||||||
|
return WmsApiResponse.error("查询参数不能为NULL", null);
|
||||||
|
}
|
||||||
|
Page<TAppLocation> page = locationQuery.toMpPage();
|
||||||
|
LambdaQueryWrapper<TAppLocation> lambdaQueryWrapper = new LambdaQueryWrapper<TAppLocation>()
|
||||||
|
.like(StringUtils.isNotEmpty(locationQuery.getVehicleId()), TAppLocation::getVehicleId, locationQuery.getVehicleId())
|
||||||
|
.like(StringUtils.isNotEmpty(locationQuery.getLocationId()), TAppLocation::getLocationId, locationQuery.getLocationId())
|
||||||
|
.eq(locationQuery.getIsOccupy() != null, TAppLocation::getIsOccupy, locationQuery.getIsOccupy())
|
||||||
|
.eq(locationQuery.getIsLock() != null, TAppLocation::getIsLock, locationQuery.getIsLock());
|
||||||
|
Page<TAppLocation> poPage = appLocationService.page(page, lambdaQueryWrapper);
|
||||||
|
|
||||||
|
PageVo<LocationVo> pageVo = PageVo.of(poPage, LocationVo::of);
|
||||||
|
return WmsApiResponse.success("查询库位成功", pageVo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
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.ITAppVehicleService;
|
||||||
|
import com.wms_main.model.dto.query.VehicleQuery;
|
||||||
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
|
import com.wms_main.model.po.TAppVehicle;
|
||||||
|
import com.wms_main.model.vo.wms.PageVo;
|
||||||
|
import com.wms_main.model.vo.wms.VehicleVo;
|
||||||
|
import com.wms_main.repository.utils.StringUtils;
|
||||||
|
import com.wms_main.service.controller.IVehicleControllerService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 载具服务控制类实现
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class VehicleControllerService implements IVehicleControllerService {
|
||||||
|
private final ITAppVehicleService appVehicleService;// 载具服务
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询载具信息(分页)实现
|
||||||
|
* @param vehicleQuery 查询参数
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WmsApiResponse<PageVo<VehicleVo>> queryVehicleInfoByPage(VehicleQuery vehicleQuery) {
|
||||||
|
if (vehicleQuery == null) {
|
||||||
|
return WmsApiResponse.error("查询参数不能为NULL", null);
|
||||||
|
}
|
||||||
|
Page<TAppVehicle> page = vehicleQuery.toMpPage();
|
||||||
|
LambdaQueryWrapper<TAppVehicle> lambdaQueryWrapper = new LambdaQueryWrapper<TAppVehicle>()
|
||||||
|
.like(StringUtils.isNotEmpty(vehicleQuery.getVehicleId()), TAppVehicle::getVehicleId, vehicleQuery.getVehicleId())
|
||||||
|
.like(StringUtils.isNotEmpty(vehicleQuery.getLocationId()), TAppVehicle::getLocationId, vehicleQuery.getLocationId())
|
||||||
|
.eq(vehicleQuery.getVehicleStatus() != null, TAppVehicle::getVehicleStatus, vehicleQuery.getVehicleStatus())
|
||||||
|
.eq(vehicleQuery.getIsLock() != null, TAppVehicle::getIsLock, vehicleQuery.getIsLock())
|
||||||
|
.eq(vehicleQuery.getIsEmpty() != null, TAppVehicle::getIsEmpty, vehicleQuery.getIsEmpty());
|
||||||
|
Page<TAppVehicle> poPage = appVehicleService.page(page, lambdaQueryWrapper);
|
||||||
|
|
||||||
|
PageVo<VehicleVo> pageVo = PageVo.of(poPage, VehicleVo::of);
|
||||||
|
return WmsApiResponse.success("查询料箱成功", pageVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user