forked from BaoKaiWms/202501-Wms-Kate-Wuxi
1. 大幅更新
This commit is contained in:
parent
33e8cbecf8
commit
eae7715ca4
|
|
@ -1,18 +1,24 @@
|
|||
import request from "@/http/request";
|
||||
|
||||
const getConfigs = () => {
|
||||
return request.get('/config/getConfigs')
|
||||
export const updateConfig = (params) => {
|
||||
return request({
|
||||
url: '/config/updateConfig',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 10000
|
||||
})
|
||||
}
|
||||
|
||||
const updateConfig = (params) => {
|
||||
return request.post('/config/updateConfig', params)
|
||||
export const queryConfigsByPage = (params) => {
|
||||
return request({
|
||||
url: '/config/queryConfigsByPage',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 10000
|
||||
})
|
||||
}
|
||||
|
||||
const getConfigsByPage = (params) => {
|
||||
return request.post('/config/getConfigsByPage', params)
|
||||
}
|
||||
|
||||
const restartSystem = (params) => {
|
||||
export const restartSystem = (params) => {
|
||||
return request({
|
||||
url: '/system/restartSystem',
|
||||
method: 'post',
|
||||
|
|
@ -21,7 +27,7 @@ const restartSystem = (params) => {
|
|||
})
|
||||
}
|
||||
|
||||
const reloadConfig = (params) => {
|
||||
export const reloadConfig = (params) => {
|
||||
return request({
|
||||
url: '/system/reloadConfig',
|
||||
method: 'post',
|
||||
|
|
@ -29,11 +35,3 @@ const reloadConfig = (params) => {
|
|||
timeout: 10000
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
getConfigs,
|
||||
getConfigsByPage,
|
||||
updateConfig,
|
||||
restartSystem,
|
||||
reloadConfig
|
||||
}
|
||||
|
|
@ -180,3 +180,12 @@ export const deleteDbsPlan = (params) => {
|
|||
timeout: 5000
|
||||
})
|
||||
}
|
||||
// 获取物料需求
|
||||
export const getGoodsRequirement = (params) => {
|
||||
return request({
|
||||
url: '/kate/getGoodsRequirement',
|
||||
method: 'post',
|
||||
data: params,
|
||||
timeout: 5000
|
||||
})
|
||||
}
|
||||
|
|
@ -29,7 +29,7 @@ onMounted(() => {
|
|||
})
|
||||
// 根据路由变化更新标签
|
||||
watch(() => router.currentRoute.value.path, (newVal, oldVal) => {
|
||||
if (newVal != oldVal) {
|
||||
if (newVal !== oldVal) {
|
||||
// 找到path对应的tag
|
||||
autoScroll(router.currentRoute.value.path)
|
||||
}
|
||||
|
|
@ -44,9 +44,7 @@ const handleClose = (tag, index) => {
|
|||
return
|
||||
}
|
||||
closeTag(tag) // 删除当前tag
|
||||
if (router.path === tag.path) { // 如果关闭的标签不是当前路由的话,不做路由跳转
|
||||
return
|
||||
} else {
|
||||
if (router.path !== tag.path) {
|
||||
if (index === (tags.value.length - 1)) { // 关闭最后一个标签,则路由跳转至最后一个
|
||||
router.push(this.tags[index].path)
|
||||
} else { // 路由跳转至下一个标签页
|
||||
|
|
|
|||
|
|
@ -20,16 +20,6 @@
|
|||
:options="addAllOptionOfOptions(kanbanStatusOptions)"
|
||||
@change="search()"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="工单日期开始(生成看板用)">
|
||||
<el-date-picker v-model="kanbanQuery.planStartDateFrom" type="date"
|
||||
placeholder="请选择开始日期" :shortcuts="shortcuts"
|
||||
style="width: 196px;" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工单日期结束(生成看板用)">
|
||||
<el-date-picker v-model="kanbanQuery.planStartDateTo" type="date"
|
||||
placeholder="请选择结束日期" :shortcuts="shortcuts"
|
||||
style="width: 196px;" clearable/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<div style="align-content: center;">
|
||||
<el-row>
|
||||
|
|
@ -43,10 +33,6 @@
|
|||
</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-button
|
||||
style="height: 30px; width: 80px; margin: auto 5px 5px auto; background-color: #20B2AA; color: #000;"
|
||||
@click="genKanban()">生成看板
|
||||
</el-button>
|
||||
<el-button
|
||||
style="height: 30px; width: 80px; margin: auto 5px 5px auto; background-color: #32CD32; color: #000;"
|
||||
@click="exportExcel()">导出看板
|
||||
|
|
@ -90,13 +76,12 @@
|
|||
<script setup>
|
||||
import store from '@/store'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import {queryKanbanByPage, genClcKanbanRequirement} from '@/api/kateWork.js'
|
||||
import {queryKanbanByPage} from '@/api/kateWork.js'
|
||||
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||
import {ElMessage} from 'element-plus'
|
||||
import {genTableRequest, addAllOptionOfOptions} from '@/utils/generator.js'
|
||||
import {labelPosition, shortcuts} from '@/constant/form'
|
||||
import {labelPosition} from '@/constant/form'
|
||||
import {kanbanStatusOptions} from '@/constant/options'
|
||||
import {loading} from '@/utils/loading.js'
|
||||
import {dateFormatter} from '@/utils/formatter.js'
|
||||
import {exportKanbanExcel} from '@/api/excel.js'
|
||||
|
||||
|
|
@ -122,9 +107,7 @@ let baseTableQuery = reactive({
|
|||
let kanbanQuery = reactive({
|
||||
goodsId: '',
|
||||
kanbanId: '',
|
||||
kanbanStatus: -99,
|
||||
planStartDateFrom: null,
|
||||
planStartDateTo: null
|
||||
kanbanStatus: -99
|
||||
})
|
||||
let kanbanQueryFormRef = ref()
|
||||
let recordId = ''
|
||||
|
|
@ -155,10 +138,10 @@ const search = () => {
|
|||
// 设定查询参数
|
||||
request.goodsId = kanbanQuery.goodsId
|
||||
request.kanbanId = kanbanQuery.kanbanId
|
||||
request.kanbanStatus = kanbanQuery.kanbanStatus == -99 ? null : kanbanQuery.kanbanStatus
|
||||
request.kanbanStatus = kanbanQuery.kanbanStatus === -99 ? null : kanbanQuery.kanbanStatus
|
||||
queryKanbanByPage(request).then((res) => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
if (response.code === 0) {
|
||||
const data = response.data
|
||||
if (data != null) {
|
||||
kanbanList.value = data.lists
|
||||
|
|
@ -188,7 +171,7 @@ const handleSortChange = (data) => {
|
|||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
baseTableQuery.sortBy.delete(data.prop)
|
||||
}
|
||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||
baseTableQuery.sortBy.set(data.prop, data.order.toLowerCase() === 'ascending')
|
||||
search()
|
||||
}
|
||||
const getCurrentRow = (row) => {
|
||||
|
|
@ -205,29 +188,6 @@ const kanbanStatusFormat = (row, column, cellValue, index) => {
|
|||
return '异常'
|
||||
}
|
||||
}
|
||||
const genKanban = () => {
|
||||
const request = {
|
||||
planStartDateFrom: dateFormatter(kanbanQuery.planStartDateFrom),
|
||||
planStartDateTo: dateFormatter(kanbanQuery.planStartDateTo),
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
}
|
||||
loading.open('生成中...')
|
||||
genClcKanbanRequirement(request).then(res => {
|
||||
loading.close()
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
ElMessage.success('生成看板需求成功。')
|
||||
search()
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
loading.close()
|
||||
console.log(err)
|
||||
ElMessage.error('生成看板需求异常。')
|
||||
})
|
||||
}
|
||||
// 导出看板
|
||||
const exportExcel = () => {
|
||||
const params = {
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||
<el-button style="background-color: #6495ED;" class="btn-search"
|
||||
@click="">生成需求
|
||||
@click="openRequirementDialog()">生成需求
|
||||
</el-button>
|
||||
</el-row>
|
||||
<el-row>
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
@click="exportExcel()">导出excel
|
||||
</el-button>
|
||||
<el-button style="background-color: #ADD8E6;" class="btn-search"
|
||||
@click="">生成看板
|
||||
@click="genKanban()">生成看板
|
||||
</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
|
|
@ -123,6 +123,19 @@
|
|||
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="baseTableQuery.total"/>
|
||||
</div>
|
||||
<el-dialog v-model="showGoodsRequireDialog" title="物料需求" width="50%" center >
|
||||
<el-button type="success" style="margin-left: 5px" @click="exportRequirements()">导出需求</el-button>
|
||||
<el-table :data="goodsRequireList" stripe border class="table-class" max-height="450px"
|
||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
|
||||
<el-table-column prop="goodsId" show-overflow-tooltip label="料号" fixed="left"/>
|
||||
<el-table-column prop="goodsDesc" show-overflow-tooltip label="描述"/>
|
||||
<el-table-column prop="needQty" show-overflow-tooltip label="需求数量"/>
|
||||
<el-table-column prop="stockQty" show-overflow-tooltip label="库存数量"/>
|
||||
<el-table-column prop="lackQty" show-overflow-tooltip label="缺少数量"/>
|
||||
<el-table-column prop="goodsType" show-overflow-tooltip label="补料类型"/>
|
||||
<el-table-column prop="stockType" show-overflow-tooltip label="存放类型"/>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
<!-- <el-dialog v-model="dialogVisible" title="库存信息" width="40%" draggable :show-close="false">
|
||||
<el-form ref="stockFormRef" :model="stockFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
|
|
@ -245,7 +258,7 @@
|
|||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import {queryDbsByPage, deleteDbsPlan} from '@/api/kateWork.js'
|
||||
import {queryDbsByPage, deleteDbsPlan, getGoodsRequirement, genClcKanbanRequirement} from '@/api/kateWork.js'
|
||||
import {dateFormatter, timeFormatter} from '@/utils/formatter.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||
|
|
@ -256,12 +269,15 @@ import {dbsStatusOptions} from '@/constant/options'
|
|||
import UploadExcelDbs from '@/excel/UploadExcelDbs.vue'
|
||||
import {exportDbsWithExcel} from '@/api/excel'
|
||||
import {loading} from "@/utils/loading";
|
||||
import { useRouter } from 'vue-router';
|
||||
import {exportToExcel} from "@/utils/excelUtils";
|
||||
|
||||
/**
|
||||
* 常量定义
|
||||
*/
|
||||
const USER_NAME = store.getters.getUserName
|
||||
const STAND_ID = store.getters.getStandId
|
||||
const router = useRouter()
|
||||
/**
|
||||
* 变量定义
|
||||
*/
|
||||
|
|
@ -290,6 +306,8 @@ let dbsEditFormEntity = reactive({})
|
|||
let showDbsUploadDialog = ref(false)
|
||||
let selectedOrders = ref([])
|
||||
let orderOptions = ref([])
|
||||
let goodsRequireList = ref([])
|
||||
let showGoodsRequireDialog = ref(false)
|
||||
/**
|
||||
* 系统方法
|
||||
*/
|
||||
|
|
@ -317,11 +335,11 @@ const search = () => {
|
|||
// 设定查询参数
|
||||
request.workOrder = dbsQueryFormEntity.workOrder.trim()
|
||||
request.productId = dbsQueryFormEntity.productId.trim()
|
||||
request.dbsStatus = dbsQueryFormEntity.dbsStatus == -99 ? null : dbsQueryFormEntity.dbsStatus
|
||||
request.dbsStatus = dbsQueryFormEntity.dbsStatus === -99 ? null : dbsQueryFormEntity.dbsStatus
|
||||
request.planStartDate = dateFormatter(dbsQueryFormEntity.planStartDate)
|
||||
queryDbsByPage(request).then((res) => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
if (response.code === 0) {
|
||||
const data = response.data
|
||||
if (data != null) {
|
||||
displayDbs.value = data.lists
|
||||
|
|
@ -365,7 +383,7 @@ const timeFormat = (row, column, cellValue, index) => {
|
|||
return timeFormatter(cellValue)
|
||||
}
|
||||
const rowStyle = ({row, rowIndex}) => {
|
||||
if (row.dbsStatus == 2) {
|
||||
if (row.dbsStatus === 2) {
|
||||
return {"color": "green"}
|
||||
}
|
||||
}
|
||||
|
|
@ -373,7 +391,7 @@ const handleSortChange = (data) => {
|
|||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
baseTableQuery.sortBy.delete(data.prop)
|
||||
}
|
||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||
baseTableQuery.sortBy.set(data.prop, data.order.toLowerCase() === 'ascending')
|
||||
search()
|
||||
}
|
||||
const getCurrentRow = (row) => {
|
||||
|
|
@ -383,7 +401,7 @@ const exportExcel = () => {
|
|||
const params = {
|
||||
workOrder: dbsQueryFormEntity.workOrder,
|
||||
productId: dbsQueryFormEntity.productId,
|
||||
dbsStatus: dbsQueryFormEntity.dbsStatus == -99 ? null : dbsQueryFormEntity.dbsStatus,
|
||||
dbsStatus: dbsQueryFormEntity.dbsStatus === -99 ? null : dbsQueryFormEntity.dbsStatus,
|
||||
planStartDate: dateFormatter(dbsQueryFormEntity.planStartDate)
|
||||
}
|
||||
exportDbsWithExcel(params).then(res => {
|
||||
|
|
@ -431,7 +449,7 @@ const deleteCurrentRow = (row) => {
|
|||
loading.open('删除中...')
|
||||
deleteDbsPlan(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
if (response.code === 0) {
|
||||
ElMessage.success(response.message)
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
|
|
@ -482,6 +500,86 @@ const addSelectWorkOrders = (workOrder) => {
|
|||
ElMessage.error('请勿重复添加工单')
|
||||
}
|
||||
}
|
||||
// 打开物料需求界面
|
||||
const openRequirementDialog = () => {
|
||||
if (selectedOrders.value.length === 0) {
|
||||
ElMessage.error('请选择工单。')
|
||||
return
|
||||
}
|
||||
// 生成请求
|
||||
const request = {
|
||||
orderIds: selectedOrders.value,
|
||||
userName: USER_NAME,
|
||||
standId: STAND_ID
|
||||
}
|
||||
getGoodsRequirement(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code === 0) {
|
||||
if (response.data != null && response.data.length > 0) {
|
||||
goodsRequireList.value = response.data
|
||||
} else {
|
||||
goodsRequireList.value = []
|
||||
}
|
||||
showGoodsRequireDialog.value = true
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('获取需求列表异常。')
|
||||
})
|
||||
}
|
||||
// 导出需求
|
||||
const exportRequirements = () => {
|
||||
try {
|
||||
const header = {
|
||||
goodsId: '料号',
|
||||
goodsDesc: '物料描述',
|
||||
needQty: '需求数量',
|
||||
stockQty: '库存数量',
|
||||
lackQty: '缺少数量',
|
||||
goodsType: '补料类型',
|
||||
stockType: '存放类型'
|
||||
}
|
||||
exportToExcel(header, goodsRequireList.value, '工单需求', '工单需求')
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
ElMessage.error('导出需求异常。')
|
||||
}
|
||||
|
||||
}
|
||||
// 生成看板
|
||||
const genKanban = () => {
|
||||
if (selectedOrders.value.length === 0) {
|
||||
ElMessage.error('请选择工单。')
|
||||
return
|
||||
}
|
||||
const request = {
|
||||
orderIds: selectedOrders.value,
|
||||
standId: STAND_ID,
|
||||
userName: USER_NAME
|
||||
}
|
||||
loading.open('生成中...')
|
||||
genClcKanbanRequirement(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code === 0) {
|
||||
ElMessage.success('生成看板需求成功。')
|
||||
// 跳转界面
|
||||
const menuItem = store.getters.getMenuItemByPath('/clcKanban')
|
||||
if (menuItem !== undefined) {
|
||||
store.commit('mutationSelectTags', menuItem)
|
||||
router.push(menuItem.path)
|
||||
}
|
||||
} else {
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('生成看板需求异常。')
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.content {
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@
|
|||
<el-form-item label="入库类型" prop="emptyTask">
|
||||
<el-select-v2 style="width: 196px" v-model="inTaskEntity.emptyTask" placeholder="请选择入库类型"
|
||||
:options="inTypeOptions"
|
||||
:disabled="taskRequestEntity.vehicleId != ''"></el-select-v2>
|
||||
:disabled="taskRequestEntity.vehicleId !== ''"></el-select-v2>
|
||||
</el-form-item>
|
||||
<el-form-item label="箱号" prop="vehicleId">
|
||||
<el-input v-model="inTaskEntity.vehicleId" ref="vehicleId"
|
||||
:disabled="taskRequestEntity.vehicleId != ''" clearable
|
||||
:disabled="taskRequestEntity.vehicleId !== ''" clearable
|
||||
@keyup.enter="handleEnter()"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="料号">
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
</el-form>
|
||||
</fieldset>
|
||||
<fieldset class="confirm-area" v-if="taskRequestEntity.vehicleId != ''">
|
||||
<fieldset class="confirm-area" v-if="taskRequestEntity.vehicleId !== ''">
|
||||
<el-form ref="taskRequestRef" :model="taskRequestEntity" :label-position="labelPosition"
|
||||
label-width="158px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
|
|
@ -206,19 +206,19 @@ const changeFocus = () => {
|
|||
// 进行大写格式化
|
||||
inTaskEntity.vehicleId = inTaskEntity.vehicleId.toUpperCase().trim()
|
||||
inTaskEntity.goodsId = inTaskEntity.goodsId.toUpperCase().trim()
|
||||
if (inTaskEntity.vehicleId == '') {
|
||||
if (inTaskEntity.vehicleId === '') {
|
||||
vehicleId.value.focus()
|
||||
return
|
||||
}
|
||||
// 进行格式判断
|
||||
if (inTaskEntity.vehicleId != '') {
|
||||
if (inTaskEntity.vehicleId !== '') {
|
||||
const vehicleArray = inTaskEntity.vehicleId.split('-')
|
||||
if (vehicleArray.length != 2) {
|
||||
if (vehicleArray.length !== 2) {
|
||||
errorBox('箱号格式不正确,正确格式为“ASRS-XXXX”。')
|
||||
vehicleId.value.focus()
|
||||
return
|
||||
} else {
|
||||
if (vehicleArray[0] != 'ASRS' || !numberCheck(vehicleArray[1]) || vehicleArray[1].length != 4) {
|
||||
if (vehicleArray[0] !== 'ASRS' || !numberCheck(vehicleArray[1]) || vehicleArray[1].length !== 4) {
|
||||
errorBox('箱号格式不正确,正确格式为“ASRS-XXXX”。')
|
||||
vehicleId.value.focus()
|
||||
return
|
||||
|
|
@ -238,16 +238,16 @@ const changeFocus = () => {
|
|||
}
|
||||
// 非空箱入库
|
||||
if (!inTaskEntity.emptyTask) {
|
||||
if (inTaskEntity.goodsId == '') {
|
||||
if (inTaskEntity.goodsId === '') {
|
||||
goodsId.value.focus()
|
||||
return
|
||||
}
|
||||
if (inTaskEntity.opNum == null || inTaskEntity.opNum == '') {
|
||||
if (inTaskEntity.opNum == null || inTaskEntity.opNum === '') {
|
||||
opNum.value.focus()
|
||||
return
|
||||
}
|
||||
}
|
||||
if (inTaskEntity.goodsId == inTaskEntity.vehicleId || inTaskEntity.goodsId == inTaskEntity.opNum || inTaskEntity.vehicleId == inTaskEntity.opNum) {
|
||||
if (inTaskEntity.goodsId === inTaskEntity.vehicleId || inTaskEntity.goodsId === inTaskEntity.opNum || inTaskEntity.vehicleId === inTaskEntity.opNum) {
|
||||
errorBox('箱号、料号、数量必须为互不相同。')
|
||||
goodsId.value.focus()
|
||||
return
|
||||
|
|
@ -256,7 +256,7 @@ const changeFocus = () => {
|
|||
}
|
||||
// 判断一个字符串是否是数字
|
||||
const numberCheck = (numberStr) => {
|
||||
if (numberStr == null || numberStr == '') {
|
||||
if (numberStr == null || numberStr === '') {
|
||||
return false
|
||||
}
|
||||
try {
|
||||
|
|
@ -267,7 +267,7 @@ const numberCheck = (numberStr) => {
|
|||
}
|
||||
// 清除输入
|
||||
const clearInput = () => {
|
||||
if (taskRequestEntity.vehicleId != '') {
|
||||
if (taskRequestEntity.vehicleId !== '') {
|
||||
if (!taskRequestEntity.emptyTask) {
|
||||
inTaskEntity.goodsId = ''
|
||||
inTaskEntity.opNum = null
|
||||
|
|
@ -286,21 +286,21 @@ const confirmBinding = () => {
|
|||
inTaskEntity.vehicleId = inTaskEntity.vehicleId.toUpperCase().trim()
|
||||
inTaskEntity.goodsId = inTaskEntity.goodsId.toUpperCase().trim()
|
||||
// 判断是否是非空箱入库时,未输入料号和数量
|
||||
if (!inTaskEntity.emptyTask && inTaskEntity.goodsId == '' && inTaskEntity.vehicleId != '') {
|
||||
if (inTaskEntity.vehicleId == '') {
|
||||
if (!inTaskEntity.emptyTask && inTaskEntity.goodsId === '' && inTaskEntity.vehicleId !== '') {
|
||||
if (inTaskEntity.vehicleId === '') {
|
||||
ElMessage.error("请输入箱号。")
|
||||
vehicleId.value.focus()
|
||||
return
|
||||
}
|
||||
// 进行格式判断
|
||||
if (inTaskEntity.vehicleId != '') {
|
||||
if (inTaskEntity.vehicleId !== '') {
|
||||
const vehicleArray = inTaskEntity.vehicleId.split('-')
|
||||
if (vehicleArray.length != 2) {
|
||||
if (vehicleArray.length !== 2) {
|
||||
errorBox('箱号格式不正确,正确格式为“ASRS-XXXX”。')
|
||||
vehicleId.value.focus()
|
||||
return
|
||||
} else {
|
||||
if (vehicleArray[0] != 'ASRS' || !numberCheck(vehicleArray[1]) || vehicleArray[1].length != 4) {
|
||||
if (vehicleArray[0] !== 'ASRS' || !numberCheck(vehicleArray[1]) || vehicleArray[1].length !== 4) {
|
||||
errorBox('箱号格式不正确,正确格式为“ASRS-XXXX”。')
|
||||
vehicleId.value.focus()
|
||||
return
|
||||
|
|
@ -330,18 +330,18 @@ const confirmBinding = () => {
|
|||
}
|
||||
// 添加绑定关系
|
||||
const addBinding = () => {
|
||||
if (taskRequestEntity.vehicleId != '' && taskRequestEntity.vehicleId != inTaskEntity.vehicleId) {
|
||||
if (taskRequestEntity.vehicleId !== '' && taskRequestEntity.vehicleId !== inTaskEntity.vehicleId) {
|
||||
errorBox('请下发已绑定的任务或取消绑定后重试。')
|
||||
return
|
||||
}
|
||||
if (taskRequestEntity.vehicleId == '') {
|
||||
if (inTaskEntity.vehicleId == '') {
|
||||
if (taskRequestEntity.vehicleId === '') {
|
||||
if (inTaskEntity.vehicleId === '') {
|
||||
errorBox('请输入箱号。')
|
||||
vehicleId.value.focus()
|
||||
return
|
||||
}
|
||||
if (!inTaskEntity.emptyTask) {
|
||||
if (inTaskEntity.goodsId != '' && inTaskEntity.opNum != null && inTaskEntity.opNum > 0) {
|
||||
if (inTaskEntity.goodsId !== '' && inTaskEntity.opNum != null && inTaskEntity.opNum > 0) {
|
||||
// 非空入库
|
||||
taskRequestEntity.goodsInfo.push({
|
||||
goodsId: inTaskEntity.goodsId.trim().toUpperCase(),
|
||||
|
|
@ -356,12 +356,12 @@ const addBinding = () => {
|
|||
taskRequestEntity.vehicleId = inTaskEntity.vehicleId.trim().toUpperCase()
|
||||
} else {
|
||||
if (!taskRequestEntity.emptyTask) {
|
||||
if (inTaskEntity.goodsId == '') {
|
||||
if (inTaskEntity.goodsId === '') {
|
||||
errorBox('请输入料号。')
|
||||
goodsId.value.focus()
|
||||
return
|
||||
}
|
||||
if (inTaskEntity.opNum == null || inTaskEntity.opNum == 0) {
|
||||
if (inTaskEntity.opNum == null || inTaskEntity.opNum === 0) {
|
||||
errorBox('请输入正确的数量。')
|
||||
opNum.value.focus()
|
||||
return
|
||||
|
|
@ -384,7 +384,7 @@ const addBinding = () => {
|
|||
// 确认下发任务
|
||||
const confirmTasks = () => {
|
||||
// 判断是否是非空箱入库时,未输入料号和数量
|
||||
if (!taskRequestEntity.emptyTask && taskRequestEntity.goodsInfo.length == 0) {
|
||||
if (!taskRequestEntity.emptyTask && taskRequestEntity.goodsInfo.length === 0) {
|
||||
ElMessageBox.confirm(
|
||||
'非空箱入库未绑定物料,默认生成回库任务。\n是否继续',
|
||||
'警告',
|
||||
|
|
@ -408,7 +408,7 @@ const confirmSend = () => {
|
|||
loading.open()
|
||||
requireStockIn(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
if (response.code === 0) {
|
||||
ElMessage.success(response.message)
|
||||
cancelBinding()
|
||||
} else {
|
||||
|
|
@ -430,7 +430,7 @@ const cancelBinding = () => {
|
|||
// 移除当前行
|
||||
const removeThisRow = (row) => {
|
||||
taskRequestEntity.goodsInfo.splice(taskRequestEntity.goodsInfo.indexOf(row), 1)
|
||||
if (taskRequestEntity.goodsInfo.length == 0 && taskRequestEntity.vehicleId != '' && !taskRequestEntity.emptyTask) {
|
||||
if (taskRequestEntity.goodsInfo.length === 0 && taskRequestEntity.vehicleId !== '' && !taskRequestEntity.emptyTask) {
|
||||
// 非空箱且没有料号列表的情况下,解绑当前任务
|
||||
resetTaskEntity()
|
||||
}
|
||||
|
|
@ -454,7 +454,7 @@ const openOutForInDialog = () => {
|
|||
// 添加入库料
|
||||
const addForInGoods = () => {
|
||||
outForInEntity.goodsId = outForInEntity.goodsId.trim()
|
||||
if (outForInEntity.goodsId == '') {
|
||||
if (outForInEntity.goodsId === '') {
|
||||
errorBox('请输入料号。')
|
||||
} else {
|
||||
outForInEntity.goodsId = outForInEntity.goodsId.toUpperCase()
|
||||
|
|
@ -475,7 +475,7 @@ const confirmCallVehicles = () => {
|
|||
const goodsIds = outForInRequestEntity.goodsIds.flatMap(item => {
|
||||
return item.goodsId
|
||||
})
|
||||
if (goodsIds.length == 0) {
|
||||
if (goodsIds.length === 0) {
|
||||
errorBox('请输入料号。')
|
||||
return
|
||||
}
|
||||
|
|
@ -487,7 +487,7 @@ const confirmCallVehicles = () => {
|
|||
loading.open()
|
||||
requireVehiclesForIn(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
if (response.code === 0) {
|
||||
successBox(response.message)
|
||||
} else {
|
||||
errorBox(response.message)
|
||||
|
|
|
|||
|
|
@ -1,261 +0,0 @@
|
|||
<template>
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-config-provider :locale="zhCn">
|
||||
<el-row>
|
||||
<el-input v-model="configNameQuery" 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>
|
||||
<br />
|
||||
<el-table :data="configList" 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.configId" v-model="configId"> </el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="configId" label="配置id" fixed="left" min-width="80px" show-overflow-tooltip />
|
||||
<el-table-column prop="configName" label="配置名称" fixed="left" min-width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="configKey" label="配置键" show-overflow-tooltip min-width="120px" />
|
||||
<el-table-column prop="configValue" label="配置值" show-overflow-tooltip min-width="140px" />
|
||||
<el-table-column prop="configType" label="配置类型" :formatter="configTypeFormat" min-width="100px"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<br />
|
||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
||||
:small="false" :disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
||||
@current-change="search" layout="total, sizes, prev, pager, next, jumper" :total="total" />
|
||||
<el-dialog v-model="dialogVisible" title="库存信息" width="40%" draggable :show-close="false">
|
||||
<el-form ref="configFormRef" :model="configFormEntity" :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="configName">
|
||||
<el-input v-model="configFormEntity.configName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配置类型" prop="configType">
|
||||
<el-select-v2 v-model="configFormEntity.configType" placeholder="请选择配置类型"
|
||||
:options="configTypeOptions" disabled></el-select-v2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="配置键" prop="configKey">
|
||||
<el-input v-model="configFormEntity.configKey" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配置值" prop="configValue">
|
||||
<el-input v-if="configFormEntity.configType == '1'" type="textarea" :rows="1"
|
||||
v-model="configFormEntity.configValue" placeholder="" :maxlength="-1"
|
||||
:show-word-limit="false" :autosize="{ minRows: 1, maxRows: 4 }">
|
||||
</el-input>
|
||||
<el-select v-if="configFormEntity.configType == '2'"
|
||||
v-model="configFormEntity.configValue" multiple collapse-tags collapse-tags-tooltip
|
||||
:placeholder="'请选择' + configFormEntity.configName">
|
||||
<el-option v-for="(value, index) in mails" :key="index" :label="value"
|
||||
:value="value" />
|
||||
</el-select>
|
||||
<el-switch v-if="configFormEntity.configType == '3'" style="margin-left: 5px;"
|
||||
v-model="configFormEntity.configValue" active-value="1" inactive-value="0" />
|
||||
</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="submitChange()">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-config-provider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getConfigsByPage, updateConfig } from '@/api/config.js'
|
||||
import { configTypeFormatter } from '@/utils/formatter.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { errorBox } from '@/utils/myMessageBox.js'
|
||||
import store from '@/store'
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
name: 'wmsConfig',
|
||||
data() {
|
||||
return {
|
||||
pageInfo: {},
|
||||
configList: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
configNameQuery: '',
|
||||
loading: false,
|
||||
configId: '',
|
||||
configFormRef: ref(),
|
||||
configFormEntity: reactive({}),
|
||||
rules: reactive({
|
||||
configId: [
|
||||
{ required: true, message: '请输入配置id' }
|
||||
],
|
||||
configName: [
|
||||
{ required: true, message: '请输入配置名称' }
|
||||
],
|
||||
configKey: [
|
||||
{ required: true, message: '请输入配置键' }
|
||||
],
|
||||
configValue: [
|
||||
{ required: true, message: '请输入配置值' }
|
||||
],
|
||||
configType: [
|
||||
{ required: true, message: '请输入配置类型' }
|
||||
]
|
||||
}),
|
||||
labelPosition: 'top',
|
||||
dialogVisible: false,
|
||||
configTypeOptions: [
|
||||
{
|
||||
value: '1',
|
||||
label: '输入框'
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '下拉多选'
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '开关'
|
||||
}
|
||||
],
|
||||
mails: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.search()
|
||||
},
|
||||
methods: {
|
||||
configTypeFormat: (row, column, cellValue, index) => {
|
||||
return configTypeFormatter(cellValue)
|
||||
},
|
||||
search() {
|
||||
this.loading = true
|
||||
const request = {
|
||||
pageNo: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
configName: this.configNameQuery.trim(),
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
getConfigsByPage(request).then(res => {
|
||||
const tableResponse = res.data
|
||||
if (tableResponse.code == 0) {
|
||||
this.configList = tableResponse.returnData.lists
|
||||
this.configList.forEach((config) => {
|
||||
if (config.configType == '2') {
|
||||
const tempArray = config.configValue.split(';')
|
||||
config.configValue = tempArray
|
||||
}
|
||||
if (config.configKey == 'MAIL_ADDRESS') {
|
||||
const tempArray = config.configValue.split(';')
|
||||
this.mails = tempArray
|
||||
}
|
||||
})
|
||||
this.total = tableResponse.returnData.total
|
||||
} else {
|
||||
errorBox(tableResponse.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('查询配置错误')
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
reset() {
|
||||
this.configNameQuery = ''
|
||||
this.search()
|
||||
},
|
||||
getCurrentRow(row) {
|
||||
this.configId = row.configId
|
||||
},
|
||||
editCurrentRow(row) {
|
||||
this.configFormEntity = reactive({
|
||||
configId: row.configId,
|
||||
configName: row.configName,
|
||||
configKey: row.configKey,
|
||||
configValue: row.configValue,
|
||||
configType: row.configType
|
||||
})
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submitChange() {
|
||||
const request = {
|
||||
configId: this.configFormEntity.configId,
|
||||
configName: this.configFormEntity.configName,
|
||||
configKey: this.configFormEntity.configKey,
|
||||
configValue: this.configFormEntity.configValue,
|
||||
configType: this.configFormEntity.configType,
|
||||
userName: store.getters.getUserName
|
||||
}
|
||||
updateConfig(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('更新系统配置失败')
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-pagination {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.el-row .el-button {
|
||||
width: 72px;
|
||||
margin-left: 0px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select-v2 {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input-number {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-select {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.el-row .el-form-item .el-input {
|
||||
width: 100% !important;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -34,13 +34,13 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="configId" label="配置id" fixed="left" min-width="80px"
|
||||
show-overflow-tooltip/>
|
||||
show-overflow-tooltip sortable="custom" />
|
||||
<el-table-column prop="configName" label="配置名称" fixed="left" min-width="120px"
|
||||
show-overflow-tooltip/>
|
||||
<el-table-column prop="configKey" label="配置键" show-overflow-tooltip min-width="120px"/>
|
||||
<el-table-column prop="configValue" label="配置值" show-overflow-tooltip min-width="140px"/>
|
||||
show-overflow-tooltip sortable="custom" />
|
||||
<el-table-column prop="configKey" label="配置键" show-overflow-tooltip min-width="120px" sortable="custom" />
|
||||
<el-table-column prop="configValue" label="配置值" show-overflow-tooltip min-width="140px" sortable="custom" />
|
||||
<el-table-column prop="configType" label="配置类型" :formatter="configTypeFormat" min-width="100px"
|
||||
show-overflow-tooltip/>
|
||||
show-overflow-tooltip sortable="custom" />
|
||||
<el-table-column fixed="right" label="操作" width="120px">
|
||||
<template v-slot="scope">
|
||||
<el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
</div>
|
||||
<el-dialog v-model="showConfigEditFlag" title="编辑配置信息" width="40%" draggable :show-close="false">
|
||||
<el-form ref="configEditFormRef" :model="configEditFormEntity" :label-position="labelPosition"
|
||||
label-width="100px" style="max-width: 100%" :rules="rules" status-icon>
|
||||
label-width="100px" style="max-width: 100%" :rules="editRules" status-icon>
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="配置名称" prop="configName">
|
||||
|
|
@ -73,30 +73,31 @@
|
|||
<el-row :gutter="16">
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="配置键" prop="configKey">
|
||||
<el-input v-model="configFormEntity.configKey" disabled/>
|
||||
<el-input v-model="configEditFormEntity.configKey" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配置值" prop="configValue">
|
||||
<el-input v-if="configFormEntity.configType == '1'" type="textarea" :rows="1"
|
||||
v-model="configFormEntity.configValue" placeholder="" :maxlength="-1"
|
||||
<el-input v-if="configEditFormEntity.configType === 1" type="textarea" :rows="1"
|
||||
v-model="configEditFormEntity.configValue" placeholder="" :maxlength="-1"
|
||||
:show-word-limit="false" :autosize="{ minRows: 1, maxRows: 4 }">
|
||||
</el-input>
|
||||
<el-select v-if="configFormEntity.configType == '2'"
|
||||
v-model="configFormEntity.configValue" multiple collapse-tags
|
||||
collapse-tags-tooltip :placeholder="'请选择' + configFormEntity.configName">
|
||||
<el-option v-for="(value, index) in mails" :key="index" :label="value"
|
||||
:value="value"/>
|
||||
</el-select>
|
||||
<el-switch v-if="configFormEntity.configType == '3'" style="margin-left: 5px;"
|
||||
v-model="configFormEntity.configValue" active-value="1" inactive-value="0"/>
|
||||
<!-- 类型2需要增加subKey-->
|
||||
<!-- <el-select v-if="configEditFormEntity.configType === 2"-->
|
||||
<!-- v-model="configEditFormEntity.configValue" multiple collapse-tags-->
|
||||
<!-- collapse-tags-tooltip :placeholder="'请选择' + configEditFormEntity.configName">-->
|
||||
<!-- <el-option v-for="(value, index) in mails" :key="index" :label="value"-->
|
||||
<!-- :value="value"/>-->
|
||||
<!-- </el-select>-->
|
||||
<el-switch v-if="configEditFormEntity.configType === 3" style="margin-left: 5px;"
|
||||
v-model="configEditFormEntity.configValue" active-value="1" inactive-value="0"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button @click="showConfigEditFlag = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitChange()">
|
||||
确定
|
||||
</el-button>
|
||||
|
|
@ -109,20 +110,19 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import store from '@/store'
|
||||
import {queryDbsByPage} from '@/api/kateWork.js'
|
||||
import {dateFormatter, timeFormatter, configTypeFormatter} from '@/utils/formatter.js'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import store from '@/store'
|
||||
import {configTypeFormatter} from '@/utils/formatter.js'
|
||||
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||
import {ElMessage} from 'element-plus'
|
||||
import {genTableRequest, addAllOptionOfOptions} from '@/utils/generator.js'
|
||||
import {labelPosition, shortcuts} from '@/constant/form'
|
||||
import {dbsStatusOptions} from '@/constant/options'
|
||||
import {exportDbsWithExcel} from '@/api/excel'
|
||||
|
||||
import {genTableRequest} from '@/utils/generator.js'
|
||||
import {labelPosition} from '@/constant/form'
|
||||
import {queryConfigsByPage, updateConfig} from "@/api/config";
|
||||
/**
|
||||
* 常量定义
|
||||
*/
|
||||
const USER_NAME = store.getters.getUserName
|
||||
const STAND_ID = store.getters.getStandId
|
||||
const configTypeOptions = [
|
||||
{
|
||||
value: '1',
|
||||
|
|
@ -137,6 +137,23 @@ const configTypeOptions = [
|
|||
label: '开关'
|
||||
}
|
||||
]
|
||||
const editRules = {
|
||||
configId: [
|
||||
{required: true, message: '请输入配置id'}
|
||||
],
|
||||
configName: [
|
||||
{required: true, message: '请输入配置名称'}
|
||||
],
|
||||
configKey: [
|
||||
{required: true, message: '请输入配置键'}
|
||||
],
|
||||
configValue: [
|
||||
{required: true, message: '请输入配置值'}
|
||||
],
|
||||
configType: [
|
||||
{required: true, message: '请输入配置类型'}
|
||||
]
|
||||
}
|
||||
/**
|
||||
* 变量定义
|
||||
*/
|
||||
|
|
@ -159,7 +176,14 @@ let configQueryFormRef = ref()
|
|||
let showConfigEditFlag = ref(false)
|
||||
let configId = ''
|
||||
let configEditFormRef = ref()
|
||||
let configEditFormEntity = reactive({})
|
||||
let configEditFormEntity = reactive({
|
||||
configId: '',
|
||||
configName: '',
|
||||
configKey: '',
|
||||
configValue: '',
|
||||
configType: null
|
||||
// subKey: ''
|
||||
})
|
||||
/**
|
||||
* 系统方法
|
||||
*/
|
||||
|
|
@ -187,15 +211,15 @@ const search = () => {
|
|||
// 设定查询参数
|
||||
request.configKey = configQueryFormEntity.configKey
|
||||
request.configName = configQueryFormEntity.configName
|
||||
queryDbsByPage(request).then((res) => {
|
||||
queryConfigsByPage(request).then((res) => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
if (response.code === 0) {
|
||||
const data = response.data
|
||||
if (data != null) {
|
||||
displayConfigs.value = data.lists
|
||||
baseTableQuery.total = data.total
|
||||
} else {
|
||||
displayDbs.value = []
|
||||
displayConfigs.value = []
|
||||
baseTableQuery.total = 0
|
||||
}
|
||||
} else {
|
||||
|
|
@ -203,22 +227,20 @@ const search = () => {
|
|||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('查询DBS数据异常。')
|
||||
ElMessage.error('查询配置数据异常。')
|
||||
}).finally(() => {
|
||||
tableLoading.value = false
|
||||
})
|
||||
}
|
||||
const clearQuery = () => {
|
||||
dbsQueryFormEntity.workOrder = ''
|
||||
dbsQueryFormEntity.productId = ''
|
||||
dbsQueryFormEntity.dbsStatus = -99
|
||||
dbsQueryFormEntity.planStartDate = null
|
||||
configQueryFormEntity.configKey = ''
|
||||
configQueryFormEntity.configName = ''
|
||||
}
|
||||
const handleSortChange = (data) => {
|
||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||
baseTableQuery.sortBy.delete(data.prop)
|
||||
}
|
||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||
baseTableQuery.sortBy.set(data.prop, data.order.toLowerCase() === 'ascending')
|
||||
search()
|
||||
}
|
||||
const getCurrentRow = (row) => {
|
||||
|
|
@ -227,70 +249,38 @@ const getCurrentRow = (row) => {
|
|||
const configTypeFormat = (row, column, cellValue, index) => {
|
||||
return configTypeFormatter(cellValue)
|
||||
}
|
||||
const exportExcel = () => {
|
||||
const params = {
|
||||
workOrder: dbsQueryFormEntity.workOrder,
|
||||
productId: dbsQueryFormEntity.productId,
|
||||
dbsStatus: dbsQueryFormEntity.dbsStatus == -99 ? null : dbsQueryFormEntity.dbsStatus,
|
||||
planStartDate: dateFormatter(dbsQueryFormEntity.planStartDate)
|
||||
}
|
||||
exportDbsWithExcel(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 = 'DBS计划' + dateFormatter(new Date) + '.xlsx'
|
||||
link.style.display = 'none'//隐藏
|
||||
|
||||
// 兼容不同浏览器的URL对象
|
||||
const url = window.URL || window.webkitURL || window.moxURL
|
||||
link.href = url.createObjectURL(blob)
|
||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
url.revokeObjectURL(link.href)//移除url对象
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
ElMessage.error('下载文件失败')
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
ElMessage.error('导出失败')
|
||||
})
|
||||
}
|
||||
const editCurrentRow = (row) => {
|
||||
|
||||
showConfigEditFlag.value = true
|
||||
configEditFormEntity.configId = row.configId
|
||||
configEditFormEntity.configName = row.configName
|
||||
configEditFormEntity.configKey = row.configKey
|
||||
configEditFormEntity.configValue = row.configValue
|
||||
configEditFormEntity.configType = row.configType
|
||||
}
|
||||
const submitStockInfo = () => {
|
||||
const submitChange = () => {
|
||||
const request = {
|
||||
stockId: this.stockFormEntity.stockId,
|
||||
locationId: this.stockFormEntity.locationId,
|
||||
vehicleId: this.stockFormEntity.vehicleId,
|
||||
stockStatus: this.stockFormEntity.stockStatus,
|
||||
goodsId: this.stockFormEntity.goodsId,
|
||||
goodsStatus: this.stockFormEntity.goodsStatus,
|
||||
remainNum: this.stockFormEntity.remainNum,
|
||||
userName: store.getters.getUserName
|
||||
configId: configEditFormEntity.configId,
|
||||
configName: configEditFormEntity.configName,
|
||||
configKey: configEditFormEntity.configKey,
|
||||
configValue: configEditFormEntity.configValue,
|
||||
configType: configEditFormEntity.configType,
|
||||
userName: USER_NAME,
|
||||
standId: STAND_ID
|
||||
}
|
||||
updateStockInfo(request).then(res => {
|
||||
if (res.data.code == 0) {
|
||||
this.dialogVisible = false
|
||||
ElMessage.success('更新库存成功')
|
||||
this.search()
|
||||
updateConfig(request).then(res => {
|
||||
const response = res.data
|
||||
if (response.code === 0) {
|
||||
showConfigEditFlag.value = false
|
||||
ElMessage.success('更新系统配置成功')
|
||||
search()
|
||||
} else {
|
||||
errorBox(res.data.message)
|
||||
ElMessage.error(response.message)
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
errorBox('更新库存失败')
|
||||
ElMessage.error('更新系统配置失败')
|
||||
})
|
||||
}
|
||||
const openUploadDialog = () => {
|
||||
showDbsUploadDialog.value = true
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.content {
|
||||
|
|
|
|||
|
|
@ -43,6 +43,18 @@ export default createStore({
|
|||
getKittingWork(state) {
|
||||
return state.kittingWork
|
||||
},
|
||||
getMenuItemByPath(state) {
|
||||
return function (path) {
|
||||
for (const item of state.menuList) {
|
||||
for (const subItem of item.children) {
|
||||
if (subItem.path === path) {
|
||||
return subItem
|
||||
}
|
||||
}
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
/**
|
||||
|
|
@ -51,7 +63,7 @@ export default createStore({
|
|||
mutationSelectTags(state, data) {
|
||||
let result = false
|
||||
for (let i = 0; i < state.stateTagsList.length; i++) {
|
||||
if (state.stateTagsList[i].path == data.path) {
|
||||
if (state.stateTagsList[i].path === data.path) {
|
||||
return result = true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
13
dev_wms_client/src/utils/excelUtils.js
Normal file
13
dev_wms_client/src/utils/excelUtils.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import * as XLSX from 'xlsx'
|
||||
import {timeFormatter} from "@/utils/formatter";
|
||||
|
||||
export const exportToExcel = (excelHead, data, sheetName, fileName) => {
|
||||
const workBook = XLSX.utils.book_new()
|
||||
const dataWithHead = [excelHead, ...data]
|
||||
const worksheet = XLSX.utils.json_to_sheet(dataWithHead, {
|
||||
skipHeader: true
|
||||
})
|
||||
XLSX.utils.book_append_sheet(workBook, worksheet, sheetName)
|
||||
const fileNameWithTime = fileName + timeFormatter(new Date()) + '.xlsx'
|
||||
XLSX.writeFile(workBook, fileNameWithTime)
|
||||
}
|
||||
|
|
@ -39,11 +39,11 @@ export const locationFormatter = (locationId) => {
|
|||
// 配置类型格式化
|
||||
export const configTypeFormatter = (value) => {
|
||||
switch (value) {
|
||||
case '1':
|
||||
case 1:
|
||||
return '输入框'
|
||||
case '2':
|
||||
case 2:
|
||||
return '下拉多选'
|
||||
case '3':
|
||||
case 3:
|
||||
return '开关'
|
||||
default:
|
||||
return '任务类型异常'
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ const login = () => {
|
|||
loading.open('登录中...')
|
||||
loginWithAuth(loginForm).then(res => {
|
||||
const response = res.data
|
||||
if (response.code == 0) {
|
||||
if (response.code === 0) {
|
||||
store.commit('mutationUser', response.data.user)// 用户信息
|
||||
store.commit('mutationMenu', response.data.menuList)// 菜单信息
|
||||
store.commit('mutationStand', response.data.stand)
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
package com.wms_main.controller.wms;
|
||||
|
||||
import com.wms_main.model.dto.query.ConfigQuery;
|
||||
import com.wms_main.model.dto.request.wms.ConfigUpdateRequest;
|
||||
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.ConfigVo;
|
||||
import com.wms_main.model.vo.wms.PageVo;
|
||||
import com.wms_main.service.controller.IConfigControllerService;
|
||||
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 +19,26 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wms/config")
|
||||
public class ConfigController {
|
||||
private final IConfigControllerService configControllerService;
|
||||
|
||||
/**
|
||||
* 配置查询
|
||||
* @param configQuery 查询参数
|
||||
* @return 查询结果
|
||||
*/
|
||||
@PostMapping("/queryConfigsByPage")
|
||||
public WmsApiResponse<PageVo<ConfigVo>> queryConfigsByPage(@RequestBody ConfigQuery configQuery) {
|
||||
return configControllerService.queryConfigsByPage(configQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置更新
|
||||
* @param configUpdateRequest 更新请求
|
||||
* @return 更新结果
|
||||
*/
|
||||
@PostMapping("/updateConfig")
|
||||
public BaseWmsApiResponse updateConfig(@RequestBody ConfigUpdateRequest configUpdateRequest) {
|
||||
return configControllerService.updateConfig(configUpdateRequest);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,6 +103,16 @@ public class KateWorkController {
|
|||
return kateWorkControllerService.genClcKanbanRequirement(genRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物料需求
|
||||
* @param goodsRequireRequest 请求参数
|
||||
* @return 处理结果
|
||||
*/
|
||||
@PostMapping("/getGoodsRequirement")
|
||||
WmsApiResponse<List<GoodsRequireVo>> getGoodsRequirement(@RequestBody GoodsRequireRequest goodsRequireRequest) {
|
||||
return kateWorkControllerService.getGoodsRequirement(goodsRequireRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询图纸
|
||||
* @param imageQuery 查询参数
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
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 ConfigQuery extends PageQuery {
|
||||
/**
|
||||
* 配置ID
|
||||
*/
|
||||
@JsonProperty("configId")
|
||||
private String configId;
|
||||
/**
|
||||
* 配置键
|
||||
*/
|
||||
@JsonProperty("configKey")
|
||||
private String configKey;
|
||||
/**
|
||||
* 配置值
|
||||
*/
|
||||
@JsonProperty("configValue")
|
||||
private String configValue;
|
||||
/**
|
||||
* 配置类型
|
||||
* 1:输入框
|
||||
* 2:下拉多选
|
||||
* 3:开关
|
||||
*/
|
||||
@JsonProperty("configType")
|
||||
private Integer configType;
|
||||
/**
|
||||
* 配置显示名称
|
||||
*/
|
||||
@JsonProperty("configName")
|
||||
private String configName;
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.wms_main.model.dto.request.wms;
|
||||
|
||||
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 ConfigUpdateRequest extends BaseWmsRequest {
|
||||
/**
|
||||
* 配置ID
|
||||
*/
|
||||
@JsonProperty("configId")
|
||||
private String configId;
|
||||
/**
|
||||
* 配置键
|
||||
*/
|
||||
@JsonProperty("configKey")
|
||||
private String configKey;
|
||||
/**
|
||||
* 配置值
|
||||
*/
|
||||
@JsonProperty("configValue")
|
||||
private String configValue;
|
||||
/**
|
||||
* 配置类型
|
||||
* 1:输入框
|
||||
* 2:下拉多选
|
||||
* 3:开关
|
||||
*/
|
||||
@JsonProperty("configType")
|
||||
private Integer configType;
|
||||
/**
|
||||
* 配置显示名称
|
||||
*/
|
||||
@JsonProperty("configName")
|
||||
private String configName;
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生成看板需求请求
|
||||
|
|
@ -26,4 +27,9 @@ public class GenKanbanRequirementRequest extends BaseWmsRequest{
|
|||
*/
|
||||
@JsonProperty("planStartDateTo")
|
||||
private LocalDate planStartDateTo;
|
||||
/**
|
||||
* 工单列表
|
||||
*/
|
||||
@JsonProperty("orderIds")
|
||||
private List<String> orderIds;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.wms_main.model.dto.request.wms;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
|
@ -15,5 +16,9 @@ import java.util.List;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class GoodsRequireRequest extends BaseWmsRequest {
|
||||
/**
|
||||
* 工单列表
|
||||
*/
|
||||
@JsonProperty("orderIds")
|
||||
private List<String> orderIds;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
package com.wms_main.model.vo.wms;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.wms_main.model.po.TAppConfig;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 配置显示类
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ConfigVo {
|
||||
/**
|
||||
* 配置ID
|
||||
*/
|
||||
@JsonProperty("configId")
|
||||
private String configId;
|
||||
/**
|
||||
* 配置键
|
||||
*/
|
||||
@JsonProperty("configKey")
|
||||
private String configKey;
|
||||
/**
|
||||
* 配置值
|
||||
*/
|
||||
@JsonProperty("configValue")
|
||||
private String configValue;
|
||||
/**
|
||||
* 配置类型
|
||||
* 1:输入框
|
||||
* 2:下拉多选
|
||||
* 3:开关
|
||||
*/
|
||||
@JsonProperty("configType")
|
||||
private Integer configType;
|
||||
/**
|
||||
* 配置显示名称
|
||||
*/
|
||||
@JsonProperty("configName")
|
||||
private String configName;
|
||||
|
||||
/**
|
||||
* 将po转化为vo
|
||||
* @param tAppConfig po
|
||||
* @return vo
|
||||
*/
|
||||
public static ConfigVo of(TAppConfig tAppConfig)
|
||||
{
|
||||
if (tAppConfig == null) {
|
||||
return new ConfigVo();
|
||||
}
|
||||
return new ConfigVo(tAppConfig.getConfigId(), tAppConfig.getConfigKey(), tAppConfig.getConfigValue(), tAppConfig.getConfigType(), tAppConfig.getConfigName());
|
||||
}
|
||||
}
|
||||
|
|
@ -41,10 +41,10 @@ public class GoodsRequireVo {
|
|||
* 物料类型
|
||||
*/
|
||||
@JsonProperty("goodsType")
|
||||
private Integer goodsType;
|
||||
private String goodsType;
|
||||
/**
|
||||
* 库存类型
|
||||
*/
|
||||
@JsonProperty("stockType")
|
||||
private Integer stockType;
|
||||
private String stockType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,11 +181,11 @@ public class ConveyTaskServiceImpl implements IConveyTaskService {
|
|||
}
|
||||
// 生成记录并删除
|
||||
pickRecords.add(new TAppPickTaskBak(
|
||||
targetPickTask.getPickId(),
|
||||
targetPickTask.getPickStand(),
|
||||
targetPickTask.getVehicleId(),
|
||||
forInPickTask.getPickId(),
|
||||
forInPickTask.getPickStand(),
|
||||
forInPickTask.getVehicleId(),
|
||||
WmsPickTaskStatusEnum.FOR_IN.getCode(),
|
||||
targetPickTask.getCreateTime(),
|
||||
forInPickTask.getCreateTime(),
|
||||
null,
|
||||
null,
|
||||
LocalDateTime.now()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package com.wms_main.service.controller;
|
||||
|
||||
import com.wms_main.model.dto.query.ConfigQuery;
|
||||
import com.wms_main.model.dto.request.wms.ConfigUpdateRequest;
|
||||
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.ConfigVo;
|
||||
import com.wms_main.model.vo.wms.PageVo;
|
||||
|
||||
/**
|
||||
* 配置控制类 服务接口
|
||||
*/
|
||||
public interface IConfigControllerService {
|
||||
/**
|
||||
* 查询配置信息---分页
|
||||
* @param configQuery 查询参数
|
||||
* @return 查询结果
|
||||
*/
|
||||
WmsApiResponse<PageVo<ConfigVo>> queryConfigsByPage(ConfigQuery configQuery);
|
||||
|
||||
/**
|
||||
* 更新配置信息
|
||||
* @param configUpdateRequest 请求参数
|
||||
* @return 更新结果
|
||||
*/
|
||||
BaseWmsApiResponse updateConfig(ConfigUpdateRequest configUpdateRequest);
|
||||
}
|
||||
|
|
@ -74,7 +74,7 @@ public interface IKateWorkControllerService {
|
|||
* @param goodsRequireRequest 请求参数
|
||||
* @return 请求结果
|
||||
*/
|
||||
BaseWmsApiResponse getGoodsRequirement(GoodsRequireRequest goodsRequireRequest);
|
||||
WmsApiResponse<List<GoodsRequireVo>> getGoodsRequirement(GoodsRequireRequest goodsRequireRequest);
|
||||
|
||||
/**
|
||||
* 查询图纸
|
||||
|
|
|
|||
|
|
@ -0,0 +1,82 @@
|
|||
package com.wms_main.service.controller.serviceImpl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wms_main.dao.ITAppConfigService;
|
||||
import com.wms_main.model.dto.query.ConfigQuery;
|
||||
import com.wms_main.model.dto.request.wms.ConfigUpdateRequest;
|
||||
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||
import com.wms_main.model.po.TAppConfig;
|
||||
import com.wms_main.model.vo.wms.ConfigVo;
|
||||
import com.wms_main.model.vo.wms.PageVo;
|
||||
import com.wms_main.repository.utils.StringUtils;
|
||||
import com.wms_main.service.controller.IConfigControllerService;
|
||||
import com.wms_main.service.system.ISystemService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 配置控制类服务实现
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ConfigControllerServiceImpl implements IConfigControllerService {
|
||||
// 配置服务
|
||||
private final ITAppConfigService appConfigService;
|
||||
// 系统服务
|
||||
private final ISystemService systemService;
|
||||
|
||||
/**
|
||||
* 查询系统配置(分页)---实现
|
||||
*
|
||||
* @param configQuery 配置
|
||||
* @return 结果
|
||||
*/
|
||||
public WmsApiResponse<PageVo<ConfigVo>> queryConfigsByPage(ConfigQuery configQuery) {
|
||||
if (configQuery == null) {
|
||||
return WmsApiResponse.error("查询参数不能为NULL", null);
|
||||
}
|
||||
Page<TAppConfig> page = configQuery.toMpPage();
|
||||
LambdaQueryWrapper<TAppConfig> lambdaQueryWrapper = new LambdaQueryWrapper<TAppConfig>()
|
||||
.like(StringUtils.isNotEmpty(configQuery.getConfigKey()), TAppConfig::getConfigKey, configQuery.getConfigKey())
|
||||
.like(StringUtils.isNotEmpty(configQuery.getConfigName()), TAppConfig::getConfigName, configQuery.getConfigName());
|
||||
Page<TAppConfig> configPage = appConfigService.page(page, lambdaQueryWrapper);
|
||||
|
||||
PageVo<ConfigVo> pageVo = PageVo.of(configPage, ConfigVo::of);
|
||||
return WmsApiResponse.success("查询配置数据成功", pageVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新系统配置
|
||||
*
|
||||
* @param configUpdateRequest 更新请求
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BaseWmsApiResponse updateConfig(ConfigUpdateRequest configUpdateRequest) {
|
||||
if (configUpdateRequest == null) {
|
||||
return BaseWmsApiResponse.error("更新请求不能为NULL。");
|
||||
}
|
||||
if (StringUtils.isEmpty(configUpdateRequest.getConfigId())) {
|
||||
return BaseWmsApiResponse.error("请求缺少配置id,无法更新。");
|
||||
}
|
||||
// 查询对应的配置信息
|
||||
TAppConfig targetConfig = appConfigService.getById(configUpdateRequest.getConfigId());
|
||||
if (targetConfig == null) {
|
||||
return BaseWmsApiResponse.error("id不正确,未查询到对应的配置信息。");
|
||||
}
|
||||
// 更新配置
|
||||
appConfigService.update(new LambdaUpdateWrapper<TAppConfig>()
|
||||
.set(TAppConfig::getConfigValue, configUpdateRequest.getConfigValue())
|
||||
.eq(TAppConfig::getConfigId, configUpdateRequest.getConfigId()));
|
||||
// 重载配置
|
||||
if (systemService.reloadConfig()) {
|
||||
return BaseWmsApiResponse.success("更新配置成功,重载配置成功。");
|
||||
} else {
|
||||
return BaseWmsApiResponse.success("更新配置成功,但重载配置失败,需手动重载配置。");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -669,59 +669,23 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BaseWmsApiResponse genClcKanbanRequirement(GenKanbanRequirementRequest genRequest) {
|
||||
if (genRequest.getPlanStartDateFrom() == null || genRequest.getPlanStartDateTo() == null) {
|
||||
return BaseWmsApiResponse.error("请选择开始时间和结束时间。");
|
||||
// 判断工单列表是否为空
|
||||
if (genRequest == null) {
|
||||
return WmsApiResponse.error("查询参数为空。", null);
|
||||
}
|
||||
if (genRequest.getPlanStartDateFrom().isAfter(genRequest.getPlanStartDateTo())) {
|
||||
return BaseWmsApiResponse.error("开始时间不能大于结束时间。");
|
||||
if (genRequest.getOrderIds() == null || genRequest.getOrderIds().isEmpty()) {
|
||||
return WmsApiResponse.error("工单列表为空,无法生成看板。", null);
|
||||
}
|
||||
// 查找这个时间段内的所有dbs计划---未开始的
|
||||
// 查询出所有的dbs
|
||||
List<TAppDbs> dbsList = appDbsService.list(new LambdaQueryWrapper<TAppDbs>()
|
||||
.between(TAppDbs::getTestPlanStartDate, genRequest.getPlanStartDateFrom(), genRequest.getPlanStartDateTo())
|
||||
.in(TAppDbs::getWorkOrder, genRequest.getOrderIds())
|
||||
.lt(TAppDbs::getDbsStatus, 2));
|
||||
// 总的物料需求
|
||||
Map<String, Integer> totalGoodsRequireMap = new HashMap<>();
|
||||
// 物料数量需求---根据总成号区分
|
||||
Map<String, Map<String, Integer>> goodsRequireByProductMap = new HashMap<>();
|
||||
// 迭代计划表,获取
|
||||
for (TAppDbs dbs : dbsList) {
|
||||
Map<String, Integer> goodsRequireOfDbsMap = new HashMap<>();// 当前dbs的物料需求
|
||||
Map<String, Integer> goodsRequireOfProductMap;// 当前成品的物料需求
|
||||
// 获得物料需求
|
||||
if (dbs.getDbsStatus() == 0) {
|
||||
if (goodsRequireByProductMap.containsKey(dbs.getProductIdOrigin())) {
|
||||
// 包含原始成品号
|
||||
goodsRequireOfProductMap = goodsRequireByProductMap.get(dbs.getProductIdOrigin());
|
||||
} else {
|
||||
goodsRequireOfProductMap = getGoodsRequireMapOfServiceProduct(dbs.getProductIdOrigin());
|
||||
if (!goodsRequireOfProductMap.isEmpty()) {
|
||||
// 存在服务件配料单,添加这个总成的Map
|
||||
goodsRequireByProductMap.put(dbs.getProductIdOrigin(), goodsRequireOfProductMap);
|
||||
} else {
|
||||
if (goodsRequireByProductMap.containsKey(dbs.getProductId())) {
|
||||
// 直接获得当前总成的物料需求
|
||||
goodsRequireOfProductMap = goodsRequireByProductMap.get(dbs.getProductId());
|
||||
} else {
|
||||
// 去查询非服务件配料单
|
||||
goodsRequireOfProductMap = getGoodsRequireMapOfNonServiceProduct(dbs.getProductId());
|
||||
if (goodsRequireOfProductMap.isEmpty()) {
|
||||
return BaseWmsApiResponse.error("工单" + dbs.getWorkOrder() + "的物料需求为空,请检查数据。");
|
||||
}
|
||||
// 添加这个非服务件配件清单的map
|
||||
goodsRequireByProductMap.put(dbs.getProductId(), goodsRequireOfProductMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 需求*产量
|
||||
for (String goodsId : goodsRequireOfProductMap.keySet()) {
|
||||
goodsRequireOfDbsMap.put(goodsId, goodsRequireOfProductMap.get(goodsId) * dbs.getPlanProduction());
|
||||
}
|
||||
} else {
|
||||
// 查询已经生成的工作清单里面的物料需求
|
||||
goodsRequireOfDbsMap = getRemainRequireMapOfOrder(dbs.getWorkOrder());
|
||||
}
|
||||
// 合并需求
|
||||
mergeRequire(totalGoodsRequireMap, goodsRequireOfDbsMap);
|
||||
Map<String, Integer> totalGoodsRequireMap;
|
||||
try {
|
||||
totalGoodsRequireMap = getGoodsRequireMap(dbsList);
|
||||
} catch (Exception e) {
|
||||
return BaseWmsApiResponse.error(e.getMessage());
|
||||
}
|
||||
// 获取需要的物料的基本信息
|
||||
List<String> goodsIds = new ArrayList<>(totalGoodsRequireMap.keySet());
|
||||
|
|
@ -801,12 +765,69 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
|||
* @return 响应结果
|
||||
*/
|
||||
@Override
|
||||
public BaseWmsApiResponse getGoodsRequirement(GoodsRequireRequest goodsRequireRequest) {
|
||||
public WmsApiResponse<List<GoodsRequireVo>> getGoodsRequirement(GoodsRequireRequest goodsRequireRequest) {
|
||||
// 判断工单列表是否为空
|
||||
if (goodsRequireRequest == null) {
|
||||
re
|
||||
return WmsApiResponse.error("查询参数为空。", null);
|
||||
}
|
||||
return null;
|
||||
if (goodsRequireRequest.getOrderIds() == null || goodsRequireRequest.getOrderIds().isEmpty()) {
|
||||
return WmsApiResponse.error("工单列表为空,无法生成需求。", null);
|
||||
}
|
||||
// 查询出所有的dbs
|
||||
List<TAppDbs> dbsList = appDbsService.list(new LambdaQueryWrapper<TAppDbs>()
|
||||
.in(TAppDbs::getWorkOrder, goodsRequireRequest.getOrderIds())
|
||||
.lt(TAppDbs::getDbsStatus, 2));
|
||||
// 总的物料需求
|
||||
Map<String, Integer> totalGoodsRequireMap;
|
||||
try {
|
||||
totalGoodsRequireMap = getGoodsRequireMap(dbsList);
|
||||
} catch (Exception e) {
|
||||
return WmsApiResponse.error(e.getMessage(), null);
|
||||
}
|
||||
// 获取需要的物料的基本信息
|
||||
List<String> goodsIds = new ArrayList<>(totalGoodsRequireMap.keySet());
|
||||
if (goodsIds.isEmpty()) {
|
||||
return WmsApiResponse.success("获取需求成功。", Collections.emptyList());
|
||||
}
|
||||
// 物料信息
|
||||
List<TAppGoods> goodsList = appGoodsService.list(new LambdaQueryWrapper<TAppGoods>()
|
||||
.in(TAppGoods::getGoodsId, goodsIds));
|
||||
// 整合物料信息为map
|
||||
Map<String, TAppGoods> filterGoodsMap = goodsList.stream().collect(Collectors.toMap(TAppGoods::getGoodsId, goods -> goods));
|
||||
// 获取筛选过的需要的物料的库存信息
|
||||
List<TAppStock> stockList = appStockService.list(new LambdaQueryWrapper<TAppStock>()
|
||||
.in(TAppStock::getGoodsId, filterGoodsMap.keySet())
|
||||
.gt(TAppStock::getRemainNum, 0));
|
||||
// 生成物料数量map
|
||||
Map<String, Integer> stockByGoodsMap = new HashMap<>();
|
||||
for (TAppStock stock : stockList) {
|
||||
if (stockByGoodsMap.containsKey(stock.getGoodsId())) {
|
||||
stockByGoodsMap.replace(stock.getGoodsId(), stockByGoodsMap.get(stock.getGoodsId()) + stock.getRemainNum());
|
||||
} else {
|
||||
stockByGoodsMap.put(stock.getGoodsId(), stock.getRemainNum());
|
||||
}
|
||||
}
|
||||
// 获取需求
|
||||
List<GoodsRequireVo> resultList = new ArrayList<>();
|
||||
for (String goodsId : filterGoodsMap.keySet()) {
|
||||
TAppGoods thisGoods = filterGoodsMap.get(goodsId);
|
||||
// 需求数量
|
||||
int needNum = totalGoodsRequireMap.get(goodsId);
|
||||
// 库存数量
|
||||
int stockNum = stockByGoodsMap.getOrDefault(goodsId, 0);
|
||||
resultList.add(new GoodsRequireVo(
|
||||
goodsId,
|
||||
thisGoods.getGoodsDescription(),
|
||||
needNum,
|
||||
stockNum,
|
||||
Math.max(needNum - stockNum, 0),
|
||||
thisGoods.getFeedingType().toUpperCase(),
|
||||
thisGoods.getPutArea().toUpperCase()));
|
||||
}
|
||||
// 对结果集排序,缺料放于最前
|
||||
return WmsApiResponse.success("获取需求成功。", resultList.stream()
|
||||
.sorted(Comparator.comparing(GoodsRequireVo::getLackQty, Comparator.reverseOrder()))
|
||||
.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1779,4 +1800,58 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
|||
workList.add(tempSingleNonServiceProductWork);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有物料需求
|
||||
* @param dbsList dbs计划
|
||||
* @return getGoodsRequireMap 结果
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
private Map<String, Integer> getGoodsRequireMap(List<TAppDbs> dbsList) throws Exception {
|
||||
// 总的物料需求
|
||||
Map<String, Integer> totalGoodsRequireMap = new HashMap<>();
|
||||
// 物料数量需求---根据总成号区分
|
||||
Map<String, Map<String, Integer>> goodsRequireByProductMap = new HashMap<>();
|
||||
// 迭代计划表,获取
|
||||
for (TAppDbs dbs : dbsList) {
|
||||
Map<String, Integer> goodsRequireOfDbsMap = new HashMap<>();// 当前dbs的物料需求
|
||||
Map<String, Integer> goodsRequireOfProductMap;// 当前成品的物料需求
|
||||
// 获得物料需求
|
||||
if (dbs.getDbsStatus() == 0) {
|
||||
if (goodsRequireByProductMap.containsKey(dbs.getProductIdOrigin())) {
|
||||
// 包含原始成品号
|
||||
goodsRequireOfProductMap = goodsRequireByProductMap.get(dbs.getProductIdOrigin());
|
||||
} else {
|
||||
goodsRequireOfProductMap = getGoodsRequireMapOfServiceProduct(dbs.getProductIdOrigin());
|
||||
if (!goodsRequireOfProductMap.isEmpty()) {
|
||||
// 存在服务件配料单,添加这个总成的Map
|
||||
goodsRequireByProductMap.put(dbs.getProductIdOrigin(), goodsRequireOfProductMap);
|
||||
} else {
|
||||
if (goodsRequireByProductMap.containsKey(dbs.getProductId())) {
|
||||
// 直接获得当前总成的物料需求
|
||||
goodsRequireOfProductMap = goodsRequireByProductMap.get(dbs.getProductId());
|
||||
} else {
|
||||
// 去查询非服务件配料单
|
||||
goodsRequireOfProductMap = getGoodsRequireMapOfNonServiceProduct(dbs.getProductId());
|
||||
if (goodsRequireOfProductMap.isEmpty()) {
|
||||
throw new Exception("工单" + dbs.getWorkOrder() + "的物料需求为空,请检查数据。");
|
||||
}
|
||||
// 添加这个非服务件配件清单的map
|
||||
goodsRequireByProductMap.put(dbs.getProductId(), goodsRequireOfProductMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 需求*产量
|
||||
for (String goodsId : goodsRequireOfProductMap.keySet()) {
|
||||
goodsRequireOfDbsMap.put(goodsId, goodsRequireOfProductMap.get(goodsId) * dbs.getPlanProduction());
|
||||
}
|
||||
} else {
|
||||
// 查询已经生成的工作清单里面的物料需求
|
||||
goodsRequireOfDbsMap = getRemainRequireMapOfOrder(dbs.getWorkOrder());
|
||||
}
|
||||
// 合并需求
|
||||
mergeRequire(totalGoodsRequireMap, goodsRequireOfDbsMap);
|
||||
}
|
||||
return totalGoodsRequireMap;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user