代码更新---报表界面完善

1.增加库位监控界面
2.增加配置界面
This commit is contained in:
梁州 2024-08-04 23:06:03 +08:00
parent 0c5f55649b
commit b69085124a
13 changed files with 273 additions and 345 deletions

View File

@ -2,7 +2,7 @@ import request from "@/http/request";
const getLocations = (params) => {
return request({
url: '/location/getLocations',
url: '/location/getLocationsByPage',
method: 'post',
data: params
})
@ -16,16 +16,7 @@ const updateLocation = (params) => {
})
}
const getAvailableLocations = (params) => {
return request({
url: '/location/getAvailableLocations',
method: 'post',
data: params
})
}
export {
getLocations,
updateLocation,
getAvailableLocations
}

View File

@ -1,154 +0,0 @@
<template>
<el-config-provider :locale="zhCn">
<el-container class="content">
<fieldset class="input-area">
<legend>系统配置</legend>
<div v-for="config in configs">
<el-form :model="config" :label-position="'top'" label-width="100px" style="max-width: 544px"
:rules="rules" status-icon>
<el-row :gutter="16">
<el-col :span="12" :offset="1" v-if="config.configKey == 'MAIL_ADDRESS'">
<el-form-item label="邮箱账户(账户之间用;隔开)">
<div>
<el-input v-model="config.configValue" @change="updateCurrentConfig(config)" />
</div>
</el-form-item>
</el-col>
<el-col :span="12" :offset="1"
v-if="config.configType == '1' && config.configKey != 'MAIL_ADDRESS'">
<el-form-item :label="config.configName">
<div>
<el-input v-model="config.configValue" @change="updateCurrentConfig(config)" />
</div>
</el-form-item>
</el-col>
<el-col :span="12" :offset="1"
v-if="config.configType == '2' && config.configKey != 'MAIL_ADDRESS'">
<el-form-item :label="config.configName">
<div v-if="config.configType == '2'">
<el-select v-model="config.configValue" multiple collapse-tags collapse-tags-tooltip
:placeholder="'请选择' + config.configName" @change="updateCurrentConfig(config)">
<el-option v-for="(value, index) in mails" :key="index" :label="value"
:value="value" />
</el-select>
</div>
</el-form-item>
</el-col>
<!-- 开关 -->
<el-col :span="12" :offset="1" v-if="config.configType == '3'">
<el-form-item :label="config.configName">
<div>
<el-switch v-model="config.configValue" class="ml-2" active-value="1"
inactive-value="0" :before-change="updateCurrentConfig(config)" />
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</fieldset>
</el-container>
</el-config-provider>
</template>
<script setup>
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { getConfigs, updateConfig } from '@/api/config.js'
import { ElMessage, ElLoading } from 'element-plus'
</script>
<script>
export default {
name: 'config',
data() {
return {
configs: [],
mails: [],
rules: {}
}
},
mounted() {
this.getAllConfigs()
},
methods: {
getAllConfigs() {//
const loading = ElLoading.service({
lock: true,
text: 'Loading',
background: 'rgba(0, 0, 0, 0.7)',
})
getConfigs().then(res => {
loading.close()
this.configs = res.data
this.configs.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
}
})
}).catch(err => {
console.log(err)
loading.close()
ElMessage.error('查询系统配置失败!')
})
},
updateCurrentConfig(config) {//
// config
const param = Object.assign({}, config)
const loading = ElLoading.service({
lock: true,
text: 'Loading',
background: 'rgba(0, 0, 0, 0.7)',
})
if (param.configType == '2') {
param.configValue = param.configValue.join(';')
}
updateConfig(param).then(res => {
loading.close()
if (res.data.code == 0) {
ElMessage({
message: '更新系统配置成功!',
type: 'success',
})
} else {
ElMessage.error(res.data.message)
}
}).catch(err => {
loading.close()
ElMessage.error('更新系统配置失败!')
})
}
}
}
</script>
<style scoped>
.content {
display: flex;
width: 100%;
}
.input-area {
margin: 10px;
width: 100%;
height: 85%;
border: solid 1px;
border-radius: 10px;
box-shadow: 0px 15px 10px -15px #000;
}
.el-row .el-form-item .el-select {
width: 512px;
}
.el-row .el-form-item .el-input {
width: 512px;
}
.el-row .el-form-item .el-button {
margin: auto;
}
</style>

View File

@ -50,7 +50,6 @@ export default {
name: 'inTaskRecord',
data() {
return {
pageInfo: {},
tasks: [],
currentPage: 1,
pageSize: 10,
@ -92,13 +91,13 @@ export default {
vehicleId: this.vehicleIdQuery.trim()
}
getTaskRecords(tableRequest).then(res => {
console.log(res.data)
const tableResponse = res.data
if (tableResponse.code != 0) {
ElMessage.error(tableResponse.message)
}
if (tableResponse.code == 0) {
this.tasks = tableResponse.returnData.lists
this.total = tableResponse.returnData.total
} else {
ElMessage.error(tableResponse.message)
}
}).catch(err => {
console.log(err)
ElMessage.error('查询任务记录错误')

View File

@ -113,11 +113,13 @@ export default {
}
getTaskRecords(tableRequest).then(res => {
const tableResponse = res.data
if (tableResponse.code != 0) {
ElMessage.error(tableResponse.message)
}
if (tableResponse.code == 0) {
this.tasks = tableResponse.rows
this.total = tableResponse.total
} else {
ElMessage.error(tableResponse.message)
}
}).catch(err => {
console.log(err)
ElMessage.error('查询盘点记录错误')

View File

@ -1,28 +1,37 @@
<template>
<div style="margin-bottom: 10px">
<el-config-provider :locale="zhCn">
<el-row style="align-items: flex-start;">
<el-input v-model="queryKey" style="width: 196px; margin-left: auto; margin-right: 10px;" placeholder="载具号" />
<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-button type="success" @click="exportExcel()">导出信息</el-button>
<!-- <el-button type="success" @click="exportExcel()">导出信息</el-button> -->
</el-row>
<br />
<el-table :data="vehicles" stripe border v-loading="loading" class="table-class" max-height="650px"
<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.vehicleId" v-model="vehicleId">&nbsp;</el-radio>
<el-radio :label="scope.row.locationId" v-model="locationId">&nbsp;</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="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" v-if="selVehicle == null">
<template v-slot="scope">
<el-button plain type="primary" @click="editCurrentRowVehicle(scope.row)">编辑</el-button>
<el-button plain type="primary" @click="editCurrentRowLocation(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
@ -31,32 +40,76 @@
: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-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="vehicleId">
<el-input v-model="vehicleFormEntity.vehicleId" disabled />
<el-form-item label="库位" prop="locationId">
<el-input v-model="locationFormEntity.locationId" :formatter="locationFormat"
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 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="isEmpty">
<el-select-v2 v-model="vehicleFormEntity.isEmpty" placeholder="请选择是否空托"
:options="isEmptyOptions"></el-select-v2>
<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="vehicleStatus">
<el-select-v2 v-model="vehicleFormEntity.vehicleStatus" placeholder="请选择托盘状态"
:options="vehicleStatusOptions"></el-select-v2>
<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>
@ -64,7 +117,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submitVehicleInfo(vehicleFormEntity)">
<el-button type="primary" @click="submitLocationInfo(locationFormEntity)">
确定
</el-button>
</span>
@ -75,63 +128,57 @@
</template>
<script setup>
import { getAllVehicles, updateVehicleInfo } from '@/api/vehicle'
import { getLocations, updateLocation } from '@/api/location.js'
import { Search } from '@element-plus/icons-vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { ElMessage } from 'element-plus'
import { ref, reactive } from 'vue'
import { vehicleStatusFormatter, locationFormatter, dateFormatter } from '@/utils/formatter.js'
import { downloadLocationsExcel } from '@/api/excel.js'
import { locationStatusFormatter, locationFormatter } from '@/utils/formatter.js'
</script>
<script>
export default {
name: 'locationsTable',
// props: ['selVehicle'],
// emits: ['update:selVehicle'],
data() {
return {
pageInfo: {},
vehicles: [],
locations: [],
currentPage: 1,
pageSize: 10,
total: 0,
queryKey: '',
locationIdQuery: '',
loading: true,
dialogVisible: false,
vehicleId: '',
vehicleFormEntity: reactive({}),
locationId: '',
locationFormEntity: reactive({}),
labelPosition: 'top',
vehicleFormRef: ref(),
locationFormRef: ref(),
rules: reactive({
vehicleId: [
{ required: true, message: '请输入托盘号' }
locationId: [
{ required: true, message: '请输入库位号' }
],
currentLocation: [
{ required: true, message: '请输入库位' }
]
}),
//
isEmptyOptions: [
//
isLockOptions: [
{
value: 0,
label: '带料'
label: '正常'
},
{
value: 1,
label: '空托'
label: '锁定'
}
],
//
vehicleStatusOptions: [
//
locationStatusOptions: [
{
value: 0,
label: '空闲'
},
{
value: 1,
label: '在库中'
label: '占用'
},
{
value: 2,
label: '在站台'
},
{
value: 3,
label: '移动中'
}
]
}
},
@ -144,54 +191,74 @@ export default {
const tableRequest = {
pageNo: this.currentPage,
pageSize: this.pageSize,
vehicleId: this.queryKey.trim()
locationId: this.locationIdQuery.trim()
}
getAllVehicles(tableRequest).then(res => {
getLocations(tableRequest).then(res => {
const tableResponse = res.data
if (tableResponse.code != 0) {
if (tableResponse.code == 0) {
this.locations = tableResponse.returnData.lists
this.total = tableResponse.returnData.total
} else {
ElMessage.error(tableResponse.message)
}
this.vehicles = tableResponse.returnData.lists
this.total = tableResponse.returnData.total
}).catch(err => {
ElMessage.error('查询载具信息错误' + err.message)
ElMessage.error('查询库位信息错误' + err.message)
})
this.loading = false
},
vehicleStatusFormat: (row, column, cellValue, index) => {
return vehicleStatusFormatter(cellValue)
locationStatusFormat: (row, column, cellValue, index) => {
return locationStatusFormatter(cellValue)
},
locationFormat: (row, column, cellValue, index) => {
return locationFormatter(cellValue)
},
isEmptyFormat: (row, column, cellValue, index) => {
isLockFormat: (row, column, cellValue, index) => {
if (cellValue == 0) {
return '带料'
return '正常'
}
if (cellValue == 1) {
return '空载具'
return '锁定'
}
},
reset() {
this.queryKey = ''
this.locationIdQuery = ''
this.search()
},
editCurrentRowVehicle(row) {
this.vehicleFormEntity = row
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
},
submitVehicleInfo(formData) {
submitLocationInfo(formData) {
const request = {
vehicleId: formData.vehicleId,
currentLocation: formData.currentLocation,
isEmpty: formData.isEmpty,
vehicleStatus: formData.vehicleStatus
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
}
updateVehicleInfo(request).then(res => {
updateLocation(request).then(res => {
if (res.data.code == 0) {
this.dialogVisible = false
ElMessage({
message: '更新载具信息成功',
message: '更新库位信息成功',
type: 'success',
})
this.search()
@ -199,52 +266,52 @@ export default {
ElMessage.error(res.data.message)
}
}).catch(err => {
ElMessage.error('更新载具信息失败:' + err)
ElMessage.error('更新库位信息失败:' + err)
})
},
getCurrentRow(row) {
this.vehicleId = row.vehicleId
this.$emit('update:selVehicle', row)
this.locationId = row.locationId
// this.$emit('update:selVehicle', row)
},
exportExcel() {
const request = {
vehicleId: formData.vehicleId,
currentLocation: formData.currentLocation,
isEmpty: formData.isEmpty,
vehicleStatus: formData.vehicleStatus
}
downloadLocationsExcel(request).then(res => {
const link = document.createElement('a');//a
try {
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //blobblobtypexls
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'//
// exportExcel() {
// const request = {
// vehicleId: formData.vehicleId,
// currentLocation: formData.currentLocation,
// isEmpty: formData.isEmpty,
// vehicleStatus: formData.vehicleStatus
// }
// downloadVehicleExcel(request).then(res => {
// const link = document.createElement('a');//a
// try {
// // let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //blobblobtypexls
// 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) {
ElMessage({
message: '下载文件失败:: ' + e,
type: 'error',
showClose: true
})
}
}).catch(err => {
ElMessage({
message: '导出失败:: ' + err,
type: 'error',
showClose: true
})
})
},
// // 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) {
// ElMessage({
// message: ': ' + e,
// type: 'error',
// showClose: true
// })
// }
// }).catch(err => {
// ElMessage({
// message: ': ' + err,
// type: 'error',
// showClose: true
// })
// })
// },
}
}
</script>

View File

@ -50,7 +50,6 @@ export default {
name: 'outTaskRecord',
data() {
return {
pageInfo: {},
tasks: [],
currentPage: 1,
pageSize: 10,
@ -93,11 +92,12 @@ export default {
}
getTaskRecords(tableRequest).then(res => {
const tableResponse = res.data
if (tableResponse.code != 0) {
if (tableResponse.code == 0) {
this.tasks = tableResponse.returnData.lists
this.total = tableResponse.returnData.total
} else {
ElMessage.error(tableResponse.message)
}
this.tasks = tableResponse.rows
this.total = tableResponse.total
}).catch(err => {
console.log(err)
ElMessage.error('查询任务记录错误')

View File

@ -137,7 +137,6 @@ export default {
emits: ['update:selStock'],
data() {
return {
pageInfo: {},
displayStocks: [],
currentPage: 1,
pageSize: 10,
@ -289,11 +288,12 @@ export default {
}
getAllStocks(request).then(res => {
const tableResponse = res.data
if (tableResponse.code != 0) {
ElMessage.error(tableResponse.message)
}
if (tableResponse.code == 0) {
this.displayStocks = tableResponse.returnData.lists
this.total = tableResponse.returnData.total
} else {
ElMessage.error(tableResponse.message)
}
}).catch(err => {
console.log(err)
ElMessage.error('查询库存错误')

View File

@ -1,9 +1,9 @@
<template>
<div style="margin-bottom: 15px">
<div style="margin-bottom: 10px">
<el-config-provider :locale="zhCn">
<el-row>
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号" />
<el-input v-model="vehicleIdQuery" style="width: 256px; margin-right: 10px;" placeholder="载具号" />
<el-input v-model="goodsIdQuery" style="width: 256px; margin-right: 10px;" placeholder="料号" />
<el-input v-model="vehicleIdQuery" style="width: 256px; margin-right: 10px;" placeholder="号" />
<el-button type="primary" @click="search()">搜索</el-button>
<el-button type="warning" @click="reset()">重置</el-button>
</el-row>
@ -118,7 +118,6 @@ export default {
name: 'taskMonitor',
data() {
return {
pageInfo: {},
tasks: [],
currentPage: 1,
pageSize: 10,
@ -202,11 +201,12 @@ export default {
}
getTasksByPage(tableRequest).then(res => {
const tableResponse = res.data
if (tableResponse.code != 0) {
ElMessage.error(tableResponse.message)
}
if (tableResponse.code == 0) {
this.tasks = tableResponse.returnData.lists
this.total = tableResponse.returnData.total
} else {
ElMessage.error(tableResponse.message)
}
}).catch(err => {
console.log(err)
ElMessage.error('查询任务错误')

View File

@ -1,15 +1,17 @@
<template>
<div style="margin-bottom: 10px">
<el-config-provider :locale="zhCn">
<el-row style="align-items: flex-start;">
<el-row>
<el-input v-model="queryKey" style="width: 256px; margin-right: 10px;" placeholder="箱号"
:suffix-icon="Search" />
<!-- <div v-if="selVehicle == null"><uploadVehicles></uploadVehicles></div> -->
<el-input v-model="queryKey" style="width: 196px; margin-left: auto; margin-right: 10px;" placeholder="载具号" />
<!-- <el-input v-model="queryKey" style="width: 196px; margin-left: auto; margin-right: 10px;" placeholder="箱号" /> -->
<el-button type="primary" @click="search()">搜索</el-button>
<el-button type="warning" @click="reset()">重置</el-button>
<el-button type="success" @click="exportExcel()" v-if="selVehicle == null">导出信息</el-button>
</el-row>
<br />
<el-table :data="vehicles" stripe border v-loading="loading" class="table-class" max-height="650px"
<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' }">
<el-table-column width="65px" fixed="left">
@ -18,10 +20,10 @@
</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="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="空托" :formatter="timeFormat" min-width="120px" />
<el-table-column prop="lastInTime" label="最近入库时间" :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>
@ -33,12 +35,12 @@
: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-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-form-item label="号" prop="vehicleId">
<el-input v-model="vehicleFormEntity.vehicleId" disabled />
</el-form-item>
</el-col>
@ -50,13 +52,13 @@
</el-row>
<el-row :gutter="16">
<el-col :span="12" :offset="0">
<el-form-item label="空" prop="isEmpty">
<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-form-item label="状态" prop="vehicleStatus">
<el-select-v2 v-model="vehicleFormEntity.vehicleStatus" placeholder="请选择托盘状态"
:options="vehicleStatusOptions"></el-select-v2>
</el-form-item>
@ -80,6 +82,7 @@
import { getAllVehicles, updateVehicleInfo } from '@/api/vehicle'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
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 uploadVehicles from '@/excel/uploadVehicles.vue'
@ -92,7 +95,6 @@ export default {
emits: ['update:selVehicle'],
data() {
return {
pageInfo: {},
vehicles: [],
currentPage: 1,
pageSize: 10,
@ -106,7 +108,7 @@ export default {
vehicleFormRef: ref(),
rules: reactive({
vehicleId: [
{ required: true, message: '请输入托盘号' }
{ required: true, message: '请输入号' }
],
currentLocation: [
{ required: true, message: '请输入库位' }
@ -153,13 +155,14 @@ export default {
}
getAllVehicles(tableRequest).then(res => {
const tableResponse = res.data
if (tableResponse.code != 0) {
ElMessage.error(tableResponse.message)
}
if (tableResponse.code == 0) {
this.vehicles = tableResponse.returnData.lists
this.total = tableResponse.returnData.total
} else {
ElMessage.error(tableResponse.message)
}
}).catch(err => {
ElMessage.error('查询载具信息错误' + err.message)
ElMessage.error('查询料箱信息错误' + err.message)
})
this.loading = false
},
@ -177,7 +180,7 @@ export default {
return '带料'
}
if (cellValue == 1) {
return '空载具'
return '空'
}
},
reset() {
@ -185,7 +188,13 @@ export default {
this.search()
},
editCurrentRowVehicle(row) {
this.vehicleFormEntity = row
this.vehicleFormEntity = {
vehicleId: row.vehicleId,
currentLocation: row.currentLocation,
isEmpty: row.isEmpty,
vehicleStatus: row.vehicleStatus,
lastInTime: row.lastInTime
}
this.dialogVisible = true
},
submitVehicleInfo(formData) {
@ -193,13 +202,14 @@ export default {
vehicleId: formData.vehicleId,
currentLocation: formData.currentLocation,
isEmpty: formData.isEmpty,
vehicleStatus: formData.vehicleStatus
vehicleStatus: formData.vehicleStatus,
lastInTime: row.lastInTime
}
updateVehicleInfo(request).then(res => {
if (res.data.code == 0) {
this.dialogVisible = false
ElMessage({
message: '更新载具信息成功',
message: '更新料箱信息成功',
type: 'success',
})
this.search()
@ -207,7 +217,7 @@ export default {
ElMessage.error(res.data.message)
}
}).catch(err => {
ElMessage.error('更新载具信息失败:' + err)
ElMessage.error('更新料箱信息失败:' + err)
})
},
getCurrentRow(row) {
@ -227,7 +237,7 @@ export default {
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //blobblobtypexls
let blob = res.data //blob
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //
let _fileName = "导出载具信息" + dateFormatter(new Date) + ".xlsx"
let _fileName = "导出料箱信息" + dateFormatter(new Date) + ".xlsx"
link.style.display = 'none'//
// URL

View File

@ -24,7 +24,7 @@
show-overflow-tooltip />
<el-table-column fixed="right" label="操作" width="120px">
<template v-slot="scope">
<el-button plain type="primary" @click="editCurrentRowStock(scope.row)">编辑</el-button>
<el-button plain type="primary" @click="editCurrentRow(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
@ -67,8 +67,7 @@
: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" />
v-model="configFormEntity.configValue" active-value="1" inactive-value="0" />
</el-form-item>
</el-col>
</el-row>
@ -96,7 +95,7 @@ import { ElMessage } from 'element-plus'
</script>
<script>
export default {
name: 'stock',
name: 'wmsConfig',
data() {
return {
pageInfo: {},
@ -190,7 +189,7 @@ export default {
getCurrentRow(row) {
this.configId = row.configId
},
editCurrentRowStock(row) {
editCurrentRow(row) {
this.configFormEntity = reactive({
configId: row.configId,
configName: row.configName,

View File

@ -142,11 +142,13 @@ export default {
}
queryLogs(tableRequest).then(res => {
const tableResponse = res.data
if (tableResponse.code != 0) {
ElMessage.error(tableResponse.message)
}
if (tableResponse.code == 0) {
this.wmsLogs = tableResponse.returnData.lists
this.total = tableResponse.returnData.total
} else {
ElMessage.error(tableResponse.message)
}
}).catch(err => {
ElMessage.error('查询日志错误' + err.message)
})

View File

@ -16,14 +16,14 @@ const routes = [
{ path: '/goodsOut', component: () => import('@/layout/goodsOut.vue') },// 出库
{ path: '/inTaskRecord', component: () => import('@/layout/inTaskRecord.vue') },// 入库记录
{ path: '/outTaskRecord', component: () => import('@/layout/outTaskRecord.vue') },// 出库记录
{ path: '/location', component: () => import('@/layout/location.vue') },// 库位
{ path: '/location', component: () => import('@/layout/locationsTable.vue') },// 库位
{ path: '/goods', component: () => import('@/layout/goods.vue') },// 物料
{ path: '/standSettings', component: () => import('@/layout/standSettings.vue') },// 站台(库口)设置
{ path: '/config', component: () => import('@/layout/newConfig.vue') },// 系统配置
{ path: '/config', component: () => import('@/layout/wmsConfig.vue') },// 系统配置
{ path: '/taskMonitor', component: () => import('@/layout/taskMonitor.vue') },// 任务监控
{ path: '/vehicles', component: () => import('@/layout/vehicle.vue') },// 任务监控
{ path: '/vehicles', component: () => import('@/layout/vehicle.vue') },// 料箱监控
{ path: '/inventory', component: () => import('@/layout/inventory.vue') },// 盘点
{ path: '/inventoryRecord', component: () => import('@/layout/inventoryRecord.vue') },// 盘点
{ path: '/inventoryRecord', component: () => import('@/layout/inventoryRecord.vue') },// 盘点记录
{ path: '/wmsLog', component: () => import('@/layout/wmsLog.vue') },// 日志
{ path: '/testDoKitting', component: () => import('@/layout/doKitting.vue') },// 备料执行
{ path: '/testFinishKitting', component: () => import('@/layout/finishKitting.vue') },// 备料完成

View File

@ -104,6 +104,17 @@ function vehicleStatusFormatter(value) {
}
}
function locationStatusFormatter(value) {
switch (value) {
case 0:
return '空闲'
case 1:
return '占用'
default:
return '异常状态'
}
}
function configTypeFormatter(value) {
switch (value) {
case '1':
@ -127,5 +138,6 @@ export {
pickingStatusFormatter,
vehicleStatusFormatter,
configTypeFormatter,
dueFormatter
dueFormatter,
locationStatusFormatter
}