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({
|
||||
url: '/goods/getGoodsInfoByPage',
|
||||
method: 'post',
|
||||
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";
|
||||
|
||||
const getAllVehicles = (params) => {
|
||||
export const queryVehicleInfoByPage = (params) => {
|
||||
return request({
|
||||
url: '/location/getVehiclesByPage',
|
||||
url: '/vehicle/queryVehicleInfoByPage',
|
||||
method: 'post',
|
||||
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>
|
||||
<el-scrollbar ref="scrollbar" :wrap-style="{ 'align-content': 'center' }" always>
|
||||
<el-scrollbar ref="scrollbar" :wrap-style="{ 'align-content': 'center' }">
|
||||
<div class="app-tag">
|
||||
<el-tag closable size="default" v-for="(tag, index) in tags" :key="tag.labelName"
|
||||
:disable-transitions="true" :effect="$route.path === tag.path ? 'dark' : 'plain'"
|
||||
|
|
@ -59,7 +59,7 @@ const handleClose = (tag, index) => {
|
|||
}
|
||||
}
|
||||
// 点击tags具体标签
|
||||
const handleClick = (tag, index) => {
|
||||
const handleClick = (tag) => {
|
||||
router.push(tag.path)
|
||||
autoScroll(router.currentRoute.value.path)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
<script setup>
|
||||
import store from '@/store'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { ref } from 'vue'
|
||||
const menuList = store.getters.getMenuList
|
||||
const route = useRoute()
|
||||
// 点击菜单
|
||||
|
|
|
|||
|
|
@ -210,4 +210,34 @@ export const pickingTaskStatusOptions = [
|
|||
value: 5,
|
||||
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>
|
||||
<div style="margin-bottom: 10px; height: 100%; padding-left: 1%; padding-right: 1%;">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号"
|
||||
:suffix-icon="Search" />
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button style="background-color: #00CED1; color: #000;"
|
||||
@click="uploadDialogVisible = true">导入</el-button>
|
||||
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
<br />
|
||||
<el-table :data="goodsList" stripe border v-loading="loading" class="table-class" highlight-current-row
|
||||
max-height="650px" @row-click="getCurrentRow" :header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.goodsId" v-model="goodsId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodsId" label="物料编号" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="goodsDescription" label="物料描述" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="vendorName" label="供应商" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="putArea" label="优先存放区域" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="firstImportTime" label="初次导入时间" :formatter="timeFormat" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="firstImportUser" label="初次导入用户" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="lastUpdateTime" label="最近更新时间" :formatter="timeFormat" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="lastUpdateUser" label="最近更新用户" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column fixed="right" label="操作" width="240px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRowGoods(scope.row)">编辑</el-button>
|
||||
<el-button plain type="danger" @click="deleteCurrentRowGoods(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
||||
@current-change="search" />
|
||||
<el-dialog v-model="dialogVisible" title="物料信息" width="40%" draggable :show-close="false">
|
||||
<div
|
||||
style="max-width: 100%; max-height: 500px; overflow: auto; display: flex; justify-content: center;">
|
||||
<el-form ref="goodsFormRef" :model="goodsFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="width: 95%;" :rules="rules" status-icon>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="search-area">
|
||||
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="料号">
|
||||
<el-input v-model="searchQueryFormEntity.goodsId" @keyup.enter="search()"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述">
|
||||
<el-input v-model="searchQueryFormEntity.goodsDesc" @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.goodsId" v-model="goodsId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodsId" label="料号" fixed="left" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="goodsDescription" label="描述" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="plant" label="工厂" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="vendorName" label="供应商" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="isSled" label="SLED管理" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="sledDays" label="SLED天数" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<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-col :span="12" :offset="0">
|
||||
<el-form-item label="料号" prop="goodsId">
|
||||
<el-input v-model="goodsFormEntity.goodsId" disabled />
|
||||
<el-form-item label="工作编号">
|
||||
<el-input v-model="rowFormEntity.workIndex" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="描述" prop="goodsName">
|
||||
<el-input v-model="goodsFormEntity.goodsName" clearable />
|
||||
<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="单位" prop="goodsUnit">
|
||||
<el-input v-model="goodsFormEntity.goodsUnit" clearable />
|
||||
<el-form-item label="总成号">
|
||||
<el-input v-model="rowFormEntity.productId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料分类" prop="goodsType">
|
||||
<el-input v-model="goodsFormEntity.goodsType" clearable />
|
||||
<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="供应商分类" prop="providerType">
|
||||
<el-input v-model="goodsFormEntity.providerType" clearable />
|
||||
<el-form-item label="料盒号">
|
||||
<el-input v-model="rowFormEntity.boxNo" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="重量" prop="weight">
|
||||
<el-input-number v-model.number="goodsFormEntity.weight" controls-position="right"
|
||||
:precision="3" :step="0.1" :min="0" clearable />
|
||||
<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="重量单位" prop="weightUnit">
|
||||
<el-input v-model="goodsFormEntity.weightUnit" clearable />
|
||||
<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="每盒数量" prop="quantityPerBox">
|
||||
<el-input-number v-model.number="goodsFormEntity.quantityPerBox"
|
||||
controls-position="right" :min="0" clearable />
|
||||
<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="拆包方式" prop="unpackingType">
|
||||
<el-input v-model="goodsFormEntity.unpackingType" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="料箱类型" prop="vehicleType">
|
||||
<el-input v-model="goodsFormEntity.vehicleType" clearable />
|
||||
<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="热度" prop="heat">
|
||||
<el-input v-model="goodsFormEntity.heat" clearable />
|
||||
<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="卸货点" prop="releasePoint">
|
||||
<el-input v-model="goodsFormEntity.releasePoint" clearable />
|
||||
</el-form-item>
|
||||
</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 label="缺料状态">
|
||||
<el-select-v2 v-model="rowFormEntity.lackStatus" placeholder="请选择缺料状态"
|
||||
:options="lackStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitGoodsInfo(goodsFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="uploadDialogVisible" title="导入物料" width="40%" draggable :show-close="true">
|
||||
<fieldset class="title-area">
|
||||
<legend>导入物料基本信息</legend>
|
||||
<UploadExcelBaseGoods></UploadExcelBaseGoods>
|
||||
</fieldset>
|
||||
<fieldset class="title-area">
|
||||
<legend>导入看板</legend>
|
||||
<UploadExcelKanban></UploadExcelKanban>
|
||||
</fieldset>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button type="primary" @click="rowEditFlag = false">取消</el-button>
|
||||
<el-button type="success" @click="submitUpdateRow(rowFormEntity)">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import { getGoodsInfoByPage, deleteGoodsInfo, updateGoodsInfo } from '@/api/goods.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
// import UploadExcelGoods from '@/excel/UploadExcelGoods.vue'
|
||||
import UploadExcelBaseGoods from '@/excel/UploadExcelBaseGoods.vue'
|
||||
import UploadExcelKanban from '@/excel/UploadExcelKanban.vue'
|
||||
import { downloadGoodsExcel } from '@/api/excel.js'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'goods',
|
||||
data() {
|
||||
return {
|
||||
goodsList: [],
|
||||
goodsInfo: {},
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
goodsIdQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
uploadDialogVisible: false,
|
||||
goodsId: '',
|
||||
goodsFormEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
goodsFormRef: ref(),
|
||||
rules: reactive({})
|
||||
import { getGoodsInfoByPage } from '@/api/goods.js'
|
||||
import { timeFormatter, wmsTaskTypeFormatter, wmsTaskStatusFormatter } from '@/utils/formatter.js'
|
||||
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { genTableRequest } from '@/utils/generator.js'
|
||||
import { labelPosition } from '@/constant/form.js'
|
||||
import { loading } from '@/utils/loading'
|
||||
/**
|
||||
* 常量定义
|
||||
*/
|
||||
const STAND_ID = store.getters.getStandId
|
||||
const USER_NAME = store.getters.getUserName
|
||||
/**
|
||||
* 变量定义
|
||||
*/
|
||||
let maxHeight = ref(window.innerHeight * 0.55)
|
||||
let tableLoading = ref(false)
|
||||
let tableData = ref([])
|
||||
let baseTableQuery = reactive({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: new Map([['goodsId', true]]),// 按照料号顺序排序
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
})
|
||||
let searchQueryFormEntity = reactive({
|
||||
goodsId: '',
|
||||
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)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
goodsId: this.goodsIdQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getGoodsInfoByPage(request).then(res => {
|
||||
console.log(res)
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.goodsList = tableResponse.data.lists
|
||||
this.total = tableResponse.data.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询物料错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
dateFormat: (row, column, cellValue, index) => {
|
||||
return dateFormatter(cellValue)
|
||||
},
|
||||
timeFormat: (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
},
|
||||
reset() {
|
||||
this.goodsIdQuery = ''
|
||||
this.search()
|
||||
},
|
||||
editCurrentRowGoods(row) {
|
||||
this.goodsId = row.goodsId
|
||||
this.goodsFormEntity = {
|
||||
goodsId: row.goodsId,
|
||||
goodsName: row.goodsName,
|
||||
goodsUnit: row.goodsUnit,
|
||||
goodsType: row.goodsType,
|
||||
providerType: row.providerType,
|
||||
weight: row.weight,
|
||||
weightUnit: row.weightUnit,
|
||||
quantityPerBox: row.quantityPerBox,
|
||||
unpackingType: row.unpackingType,
|
||||
vehicleType: row.vehicleType,
|
||||
vehicleTypeDescription: row.vehicleTypeDescription,
|
||||
goodsInVehicleType: row.goodsInVehicleType,
|
||||
feedingType: row.feedingType,
|
||||
feedingValue: row.feedingValue,
|
||||
dataSource: row.dataSource,
|
||||
heat: row.heat,
|
||||
releasePoint: row.releasePoint,
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
deleteCurrentRowGoods(row) {
|
||||
this.goodsId = row.goodsId
|
||||
ElMessageBox.confirm(
|
||||
'该操作会删除选择的物料数据。\n是否继续',
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
const params = {
|
||||
goodsId: this.goodsId,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
deleteGoodsInfo(params).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
ElMessage.success('删除物料信息成功')
|
||||
this.search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('删除物料信息失败')
|
||||
})
|
||||
}).catch(() => {
|
||||
ElMessage.info('操作取消')
|
||||
})
|
||||
},
|
||||
submitGoodsInfo(formData) {
|
||||
const request = {
|
||||
goodsId: formData.goodsId,
|
||||
goodsName: formData.goodsName,
|
||||
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('导出失败')
|
||||
})
|
||||
},
|
||||
},
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('查询数据异常。')
|
||||
}).finally(() => {
|
||||
tableLoading.value = false
|
||||
})
|
||||
}
|
||||
const clearQuery = () => {
|
||||
searchQueryFormEntity.goodsId = ''
|
||||
searchQueryFormEntity.goodsDesc = ''
|
||||
}
|
||||
const handleSortChange = (data) => {
|
||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
baseTableQuery.sortBy.delete(data.prop)
|
||||
}
|
||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||
search()
|
||||
}
|
||||
const getCurrentRow = (row) => {
|
||||
goodsId = row.goodsId
|
||||
}
|
||||
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>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
.work-area {
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
.search-area {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.title-area {
|
||||
display: flex;
|
||||
/* min-height: 10%; */
|
||||
max-height: max-content;
|
||||
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;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.table-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 60%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input-number {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-select-v2 {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
margin: 5px 5px 5px 5px;
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.my-autocomplete li {
|
||||
width: 196px;
|
||||
line-height: normal;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.my-autocomplete li .name {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.my-autocomplete li .addr {
|
||||
font-size: 12px;
|
||||
color: #b4b4b4;
|
||||
}
|
||||
|
||||
.my-autocomplete li .highlighted .addr {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_id {
|
||||
color: brown;
|
||||
}
|
||||
|
||||
.my-autocomplete li .goods_name {
|
||||
color: cornflowerblue;
|
||||
}
|
||||
|
||||
.btn-search {
|
||||
height: 30px;
|
||||
width: 80px;
|
||||
margin: auto 5px 5px auto;
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,345 +1,465 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="locationIdQuery" style="width: 256px; margin-right: 10px;" placeholder="库位"
|
||||
:suffix-icon="Search" />
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
||||
</el-row>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="search-area">
|
||||
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="任务类型">
|
||||
<el-select-v2 v-model="searchQueryFormEntity.taskType" placeholder="任务类型"
|
||||
:options="addAllOptionOfOptions(taskTypeOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务状态">
|
||||
<el-select-v2 v-model="searchQueryFormEntity.taskStatus" placeholder="任务状态"
|
||||
:options="addAllOptionOfOptions(wmsTaskStatusOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="箱号">
|
||||
<el-input v-model="searchQueryFormEntity.vehicleId" @keyup.enter="search()" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="料号">
|
||||
<el-input v-model="searchQueryFormEntity.goodsId" @keyup.enter="search()" clearable />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<div style="align-content: center;">
|
||||
<el-row>
|
||||
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<div class="table-area">
|
||||
<el-table :data="tableData" stripe border v-loading="tableLoading" class="table-class"
|
||||
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||
@sort-change="handleSortChange">
|
||||
<el-table-column width="65px" fixed="left">
|
||||
<template v-slot="scope">
|
||||
<el-radio :label="scope.row.taskId" v-model="taskId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="taskId" label="任务号" fixed="left" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="taskType" label="任务类型" fixed="left" :formatter="taskTypeFormat" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="taskStatus" label="任务状态" :formatter="taskStatusFormat" fixed="right" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="taskPriority" label="优先级" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="goodsId" label="料号" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="goodsDesc" label="物料描述"
|
||||
min-width="120px" sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="opNum" label="操作数量" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="stockNum" label="库存数量" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="origin" label="起点" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="destination" label="终点" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="wcsTaskId" label="wcs任务号" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px" sortable="custom"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column prop="opUser" label="操作用户" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="remark" label="备注" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip />
|
||||
<el-table-column prop="callStand" label="呼叫站台" min-width="120px"
|
||||
sortable="custom" show-overflow-tooltip />
|
||||
<!-- <el-table-column fixed="right" label="操作" width="170px">
|
||||
<template v-slot="scope">
|
||||
<div style="display: inline-block; align-content: center;">
|
||||
<el-button type="primary"
|
||||
@click="editCurrentRowFormEntity(scope.row)">编辑</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
||||
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
||||
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="baseTableQuery.total" />
|
||||
</div>
|
||||
<el-dialog v-model="rowEditFlag" title="工作信息" width="40%" draggable :show-close="false">
|
||||
<el-form ref="rowEditFormRef" :model="rowFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="工作编号">
|
||||
<el-input v-model="rowFormEntity.workIndex" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工单号">
|
||||
<el-input v-model="rowFormEntity.workOrder" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="总成号">
|
||||
<el-input v-model="rowFormEntity.productId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成品号">
|
||||
<el-input v-model="rowFormEntity.singleProductId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="料盒号">
|
||||
<el-input v-model="rowFormEntity.boxNo" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="料号">
|
||||
<el-input v-model="rowFormEntity.goodsId" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="需求数量">
|
||||
<el-input-number v-model.number="rowFormEntity.needNum" controls-position="right"
|
||||
:min="0" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="已完成数量">
|
||||
<el-input-number v-model.number="rowFormEntity.finishNum" controls-position="right"
|
||||
:min="0" :max="rowFormEntity.needNum" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="已分配数量">
|
||||
<el-input-number v-model.number="rowFormEntity.distributeNum"
|
||||
controls-position="right" :min="0" :max="rowFormEntity.needNum" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="工作状态">
|
||||
<el-select-v2 v-model="rowFormEntity.workStatus" placeholder="请选择工作状态"
|
||||
:options="workStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="缺料状态">
|
||||
<el-select-v2 v-model="rowFormEntity.lackStatus" placeholder="请选择缺料状态"
|
||||
:options="lackStatusOptions"></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<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>
|
||||
<br />
|
||||
<el-table :data="locations" stripe border v-loading="loading" class="table-class" max-height="550px"
|
||||
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>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
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'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'locationsTable',
|
||||
data() {
|
||||
return {
|
||||
locations: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
locationIdQuery: '',
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
locationId: '',
|
||||
locationFormEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
locationFormRef: ref(),
|
||||
rules: reactive({
|
||||
locationId: [
|
||||
{ required: true, message: '请输入库位号' }
|
||||
],
|
||||
}),
|
||||
// 锁定
|
||||
isLockOptions: [
|
||||
{
|
||||
value: 0,
|
||||
label: '正常'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '锁定'
|
||||
}
|
||||
],
|
||||
// 状态
|
||||
locationStatusOptions: [
|
||||
{
|
||||
value: 0,
|
||||
label: '空闲'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '占用'
|
||||
},
|
||||
]
|
||||
import { queryTasksByPage } from '@/api/taskQuery.js'
|
||||
import { timeFormatter, wmsTaskTypeFormatter, wmsTaskStatusFormatter } from '@/utils/formatter.js'
|
||||
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { genTableRequest } from '@/utils/generator.js'
|
||||
import { labelPosition } from '@/constant/form.js'
|
||||
import { taskTypeOptions, wmsTaskStatusOptions } from '@/constant/options.js'
|
||||
import { addAllOptionOfOptions } from '@/utils/generator.js'
|
||||
import { loading } from '@/utils/loading'
|
||||
/**
|
||||
* 常量定义
|
||||
*/
|
||||
const STAND_ID = store.getters.getStandId
|
||||
const USER_NAME = store.getters.getUserName
|
||||
/**
|
||||
* 变量定义
|
||||
*/
|
||||
let maxHeight = ref(window.innerHeight * 0.55)
|
||||
let tableLoading = ref(false)
|
||||
let tableData = ref([])
|
||||
let baseTableQuery = reactive({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: new Map([['createTime', true]]),// 按照成品号顺序排序
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
})
|
||||
let searchQueryFormEntity = reactive({
|
||||
vehicleId: '',
|
||||
goodsId: '',
|
||||
taskType: -99,
|
||||
taskStatus: -99
|
||||
})
|
||||
let searchQueryFormRef = ref()
|
||||
let rowEditFlag = ref(false)
|
||||
let taskId = ''
|
||||
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.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)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const tableRequest = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
locationId: this.locationIdQuery.trim()
|
||||
}
|
||||
getLocations(tableRequest).then(res => {
|
||||
const tableResponse = res.data
|
||||
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('导出失败')
|
||||
})
|
||||
},
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('查询数据异常。')
|
||||
}).finally(() => {
|
||||
tableLoading.value = false
|
||||
})
|
||||
}
|
||||
const clearQuery = () => {
|
||||
searchQueryFormEntity.vehicleId = ''
|
||||
searchQueryFormEntity.goodsId = ''
|
||||
}
|
||||
const handleSortChange = (data) => {
|
||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
baseTableQuery.sortBy.delete(data.prop)
|
||||
}
|
||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||
search()
|
||||
}
|
||||
const getCurrentRow = (row) => {
|
||||
taskId = row.taskId
|
||||
}
|
||||
const timeFormat = (row, column, cellValue, index) => {
|
||||
return timeFormatter(cellValue)
|
||||
}
|
||||
const 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>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.work-area {
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
}
|
||||
|
||||
.search-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 40%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.table-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 60%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input-number {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-select-v2 {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
margin: 5px 5px 5px 5px;
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
.my-autocomplete li {
|
||||
width: 196px;
|
||||
line-height: normal;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
/* font-size: 5px; */
|
||||
.my-autocomplete li .name {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
.my-autocomplete li .addr {
|
||||
font-size: 12px;
|
||||
color: #b4b4b4;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
.my-autocomplete li .highlighted .addr {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
.my-autocomplete li .goods_id {
|
||||
color: brown;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
.my-autocomplete li .goods_name {
|
||||
color: cornflowerblue;
|
||||
}
|
||||
|
||||
.btn-search {
|
||||
height: 30px;
|
||||
width: 80px;
|
||||
margin: auto 5px 5px auto;
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -77,15 +77,14 @@
|
|||
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"
|
||||
v-if="searchQueryFormEntity.summaryType == 1">
|
||||
<!-- <el-table-column fixed="right" label="操作" width="170px">
|
||||
<template v-slot="scope">
|
||||
<div style="display: inline-block; align-content: center;">
|
||||
<el-button type="primary"
|
||||
@click="editCurrentRowFormEntity(scope.row)">编辑</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||
|
|
@ -277,7 +276,8 @@ const search = () => {
|
|||
})
|
||||
}
|
||||
const clearQuery = () => {
|
||||
searchQueryFormEntity.workOrder = ''
|
||||
searchQueryFormEntity.vehicleId = ''
|
||||
searchQueryFormEntity.goodsId = ''
|
||||
}
|
||||
const handleSortChange = (data) => {
|
||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
|
|
|
|||
|
|
@ -1,331 +1,457 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-input v-model="queryKey" style="width: 158px; margin-right: 10px;" placeholder="箱号"
|
||||
:suffix-icon="Search" />
|
||||
<el-input v-model="locationQuery" style="width: 158px; margin-right: 10px;" placeholder="位置"
|
||||
:suffix-icon="Search" />
|
||||
<el-select-v2 v-model="isEmptyQuery" style="width: 158px; margin-right: 10px;" placeholder="是否空箱"
|
||||
:options="isEmptyOptions" @change="search()"></el-select-v2>
|
||||
<el-button type="primary" @click="search()">搜索</el-button>
|
||||
<el-button type="warning" @click="reset()">重置</el-button>
|
||||
</el-row>
|
||||
<el-row v-if="selVehicle == null">
|
||||
<el-button style="background-color: #32CD32; color: #000;" @click="exportExcel()">导出</el-button>
|
||||
</el-row>
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-container class="content">
|
||||
<div class="work-area">
|
||||
<fieldset class="search-area">
|
||||
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<el-row>
|
||||
<el-form-item label="空箱">
|
||||
<el-select-v2 v-model="searchQueryFormEntity.isEmpty" placeholder="任务类型"
|
||||
:options="addAllOptionOfOptions(yesOrNoOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="锁定">
|
||||
<el-select-v2 v-model="searchQueryFormEntity.isLock" placeholder="任务状态"
|
||||
: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>
|
||||
<br />
|
||||
<el-table :data="vehicles" stripe border v-loading="loading" class="table-class" max-height="550px"
|
||||
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>
|
||||
</el-container>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<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'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'vehicle',
|
||||
props: ['selVehicle'],
|
||||
emits: ['update:selVehicle'],
|
||||
data() {
|
||||
return {
|
||||
vehicles: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: '',
|
||||
isAsc: true,
|
||||
queryKey: '',
|
||||
locationQuery: '',
|
||||
isEmptyQuery: -99,
|
||||
loading: true,
|
||||
dialogVisible: false,
|
||||
vehicleId: '',
|
||||
vehicleFormEntity: reactive({}),
|
||||
labelPosition: 'top',
|
||||
vehicleFormRef: ref(),
|
||||
rules: reactive({
|
||||
vehicleId: [
|
||||
{ required: true, message: '请输入箱号' }
|
||||
],
|
||||
currentLocation: [
|
||||
{ required: true, message: '请输入库位' }
|
||||
]
|
||||
}),
|
||||
// 是否空箱
|
||||
isEmptyOptions: [
|
||||
{
|
||||
value: -99,
|
||||
label: '全部'
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: '带料'
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: '空箱'
|
||||
}
|
||||
],
|
||||
// 料箱状态
|
||||
vehicleStatusOptions: [
|
||||
{
|
||||
value: 1,
|
||||
label: '入库中'
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: '在库中'
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: '出库中'
|
||||
},
|
||||
{
|
||||
value: 99,
|
||||
label: '异常'
|
||||
},
|
||||
]
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { queryVehicleInfoByPage } from '@/api/vehicle.js'
|
||||
import { timeFormatter, locationFormatter, yesOrNoFormatter, vehicleStatusFormatter } from '@/utils/formatter.js'
|
||||
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { genTableRequest } from '@/utils/generator.js'
|
||||
import { labelPosition } from '@/constant/form.js'
|
||||
import { yesOrNoOptions, vehicleStatusOptions } from '@/constant/options.js'
|
||||
import { addAllOptionOfOptions } from '@/utils/generator.js'
|
||||
import { loading } from '@/utils/loading'
|
||||
/**
|
||||
* 常量定义
|
||||
*/
|
||||
const STAND_ID = store.getters.getStandId
|
||||
const USER_NAME = store.getters.getUserName
|
||||
/**
|
||||
* 变量定义
|
||||
*/
|
||||
let maxHeight = ref(window.innerHeight * 0.55)
|
||||
let tableLoading = ref(false)
|
||||
let tableData = ref([])
|
||||
let baseTableQuery = reactive({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
sortBy: new Map([['lastInTime', true]]),// 按照成品号顺序排序
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
})
|
||||
let searchQueryFormEntity = reactive({
|
||||
vehicleId: '',
|
||||
locationId: '',
|
||||
vehicleStatus: -99,
|
||||
isLock: -99,
|
||||
isEmpty: -99
|
||||
})
|
||||
let searchQueryFormRef = ref()
|
||||
let rowEditFlag = ref(false)
|
||||
let vehicleId = ''
|
||||
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.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)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
search() {
|
||||
this.loading = true
|
||||
const tableRequest = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
sortBy: this.sortBy,
|
||||
isAsc: this.isAsc,
|
||||
vehicleId: this.queryKey.trim(),
|
||||
currentLocation: this.locationQuery.trim(),
|
||||
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('导出失败')
|
||||
})
|
||||
},
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('查询数据异常。')
|
||||
}).finally(() => {
|
||||
tableLoading.value = false
|
||||
})
|
||||
}
|
||||
const clearQuery = () => {
|
||||
searchQueryFormEntity.vehicleId = ''
|
||||
searchQueryFormEntity.locationId = ''
|
||||
}
|
||||
const handleSortChange = (data) => {
|
||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
baseTableQuery.sortBy.delete(data.prop)
|
||||
}
|
||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||
search()
|
||||
}
|
||||
const getCurrentRow = (row) => {
|
||||
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>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.work-area {
|
||||
width: 100%;
|
||||
/* padding: 5px; */
|
||||
}
|
||||
|
||||
.search-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 40%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.table-area {
|
||||
margin: auto;
|
||||
min-height: fit-content;
|
||||
max-height: 60%;
|
||||
margin-bottom: 10px;
|
||||
min-width: inherit;
|
||||
border: solid 1px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 15px 10px -15px #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-input-number {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.el-form-item .el-select-v2 {
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
margin: 5px 5px 5px 5px;
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
.my-autocomplete li {
|
||||
width: 196px;
|
||||
line-height: normal;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
/* font-size: 5px; */
|
||||
.my-autocomplete li .name {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.el-row .el-form-item {
|
||||
width: 10% inherit;
|
||||
justify-content: center;
|
||||
.my-autocomplete li .addr {
|
||||
font-size: 12px;
|
||||
color: #b4b4b4;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
.my-autocomplete li .highlighted .addr {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
.my-autocomplete li .goods_id {
|
||||
color: brown;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-button {
|
||||
margin: auto;
|
||||
.my-autocomplete li .goods_name {
|
||||
color: cornflowerblue;
|
||||
}
|
||||
|
||||
.btn-search {
|
||||
height: 30px;
|
||||
width: 80px;
|
||||
margin: auto 5px 5px auto;
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -145,4 +145,19 @@ export const wmsTaskStatusFormatter = (value) => {
|
|||
default:
|
||||
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'
|
||||
// 构建table基本请求---带分页
|
||||
export function genTableRequest(baseTableQuery) {
|
||||
export const genTableRequest = (baseTableQuery) => {
|
||||
// 构建sortBy的集合
|
||||
let sortBy = []
|
||||
for (const [key, value] of baseTableQuery.sortBy) {
|
||||
|
|
@ -23,7 +23,7 @@ export function genTableRequest(baseTableQuery) {
|
|||
* @param {*} options
|
||||
* @returns
|
||||
*/
|
||||
export function addAllOptionOfOptions(options) {
|
||||
export const addAllOptionOfOptions = (options) => {
|
||||
const allOption = [
|
||||
{
|
||||
value: -99,
|
||||
|
|
|
|||
|
|
@ -1,16 +1,11 @@
|
|||
import crypto from 'crypto'
|
||||
function base64URLEncode(str) {
|
||||
export const base64URLEncode = (str) => {
|
||||
return str.toString('base64')
|
||||
.replace(/\+/g, '-')
|
||||
.replace(/\//g, '_')
|
||||
.replace(/=/g, '');
|
||||
}
|
||||
|
||||
function getHashString(obj) {
|
||||
export const getHashString = (obj) => {
|
||||
return base64URLEncode(crypto.createHash('sha256').update(obj).digest())
|
||||
}
|
||||
|
||||
export {
|
||||
base64URLEncode,
|
||||
getHashString
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// 语音播报
|
||||
export function speak (message) {
|
||||
window.speechSynthesis.speak(new SpeechSynthesisUtterance(message));
|
||||
export const speak = (message) => {
|
||||
window.speechSynthesis.speak(new SpeechSynthesisUtterance(message))
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { ElMessageBox } from 'element-plus'
|
||||
|
||||
function errorBox(msg) {
|
||||
export const errorBox = (msg) => {
|
||||
ElMessageBox.alert(msg, '错误', {
|
||||
autofocus: true,
|
||||
confirmButtonText: '确认',
|
||||
|
|
@ -17,7 +17,7 @@ function errorBox(msg) {
|
|||
})
|
||||
}
|
||||
|
||||
function successBox(msg) {
|
||||
export const successBox = (msg) => {
|
||||
ElMessageBox.alert(msg, '成功', {
|
||||
autofocus: true,
|
||||
confirmButtonText: '确认',
|
||||
|
|
@ -34,7 +34,7 @@ function successBox(msg) {
|
|||
})
|
||||
}
|
||||
|
||||
function infoBox(msg) {
|
||||
export const infoBox = (msg) => {
|
||||
ElMessageBox.alert(msg, '提示', {
|
||||
autofocus: true,
|
||||
confirmButtonText: '确认',
|
||||
|
|
@ -51,7 +51,7 @@ function infoBox(msg) {
|
|||
})
|
||||
}
|
||||
|
||||
function warningBox(msg) {
|
||||
export const warningBox = (msg) => {
|
||||
ElMessageBox.alert(msg, '警告', {
|
||||
autofocus: true,
|
||||
confirmButtonText: '确认',
|
||||
|
|
@ -66,11 +66,4 @@ function warningBox(msg) {
|
|||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
errorBox,
|
||||
successBox,
|
||||
infoBox,
|
||||
warningBox
|
||||
}
|
||||
|
|
@ -1,35 +1,27 @@
|
|||
import moment from "moment";
|
||||
function genTaskId(code) {
|
||||
export const genTaskId = (code) => {
|
||||
return code + moment(new Date()).format("YYYYMMDDHHmmssSSS");
|
||||
}
|
||||
|
||||
function toCamelCase(str) {
|
||||
export const toCamelCase = (str) => {
|
||||
return str.replace(/-(\w)/g, function (_, c) {
|
||||
return c ? c.toUpperCase() : "";
|
||||
});
|
||||
}
|
||||
|
||||
function toUnderScoreCase(str) {
|
||||
export const toUnderScoreCase = (str) => {
|
||||
return str.replace(/([A-Z])/g, function (_, c) {
|
||||
return "_" + c.toLowerCase();
|
||||
});
|
||||
}
|
||||
|
||||
function isSingleCharacter(c) {
|
||||
export const isSingleCharacter = (c) => {
|
||||
if (c.length !== 1) {
|
||||
return false
|
||||
}
|
||||
return c.toLowerCase() >= 'a' && c.toLowerCase() <= 'z'
|
||||
}
|
||||
|
||||
function isNumber(d) {
|
||||
export const isNumber = (d) => {
|
||||
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.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 lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -26,4 +29,14 @@ public class LocationController {
|
|||
public BaseWmsApiResponse genLocations(@RequestBody LocationQuery 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;
|
||||
|
||||
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 org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 载具控制类
|
||||
|
|
@ -15,4 +17,15 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wms/vehicle")
|
||||
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")
|
||||
private String goodsDescription;
|
||||
@JsonProperty("goodsDesc")
|
||||
private String goodsDesc;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,8 +15,78 @@ import lombok.NoArgsConstructor;
|
|||
@NoArgsConstructor
|
||||
public class LocationQuery extends PageQuery{
|
||||
/**
|
||||
* 库位ID
|
||||
* 库位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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
/**
|
||||
* 对应设备号
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.wms_main.model.vo.wms;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.wms_main.model.po.TAppGoods;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
|
@ -59,4 +60,45 @@ public class GoodsVo extends BaseImportVo {
|
|||
*/
|
||||
@JsonProperty("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.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 创建结果
|
||||
*/
|
||||
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;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wms_main.dao.ITAppGoodsService;
|
||||
|
|
@ -23,6 +22,7 @@ import org.springframework.stereotype.Service;
|
|||
@Slf4j
|
||||
public class GoodsControllerServiceImpl implements IGoodsControllerService {
|
||||
private final ITAppGoodsService goodsService;
|
||||
|
||||
/**
|
||||
* 实现--查询物料信息(分页)
|
||||
* @param goodsQuery 查询参数
|
||||
|
|
@ -30,16 +30,15 @@ public class GoodsControllerServiceImpl implements IGoodsControllerService {
|
|||
*/
|
||||
@Override
|
||||
public WmsApiResponse<PageVo<GoodsVo>> getGoodsInfoByPage(GoodsQuery goodsQuery) {
|
||||
try {
|
||||
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.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("查询错误。");
|
||||
if (goodsQuery == null) {
|
||||
return WmsApiResponse.error("查询参数不能为NULL", null);
|
||||
}
|
||||
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;
|
||||
|
||||
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.model.dto.query.LocationQuery;
|
||||
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.vo.wms.LocationVo;
|
||||
import com.wms_main.model.vo.wms.PageVo;
|
||||
import com.wms_main.repository.utils.StringUtils;
|
||||
import com.wms_main.service.controller.ILocationControllerService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
|
@ -62,4 +67,26 @@ public class LocationControllerServiceImpl implements ILocationControllerService
|
|||
appLocationService.saveBatch(newLocationList);
|
||||
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