forked from BaoKaiWms/202501-Wms-Kate-Wuxi
添加站台监控报表
This commit is contained in:
parent
eee9970f05
commit
01257597c8
|
|
@ -1,8 +1,8 @@
|
||||||
import request from "@/http/request";
|
import request from "@/http/request";
|
||||||
|
|
||||||
const getStandsByPage = (params) => {
|
const getAllStands = (params) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/stand/getStandsByPage',
|
url: '/stand/getAllStands',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
|
|
@ -17,6 +17,6 @@ const updateStandInfo = (params) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
getStandsByPage,
|
getAllStands,
|
||||||
updateStandInfo
|
updateStandInfo
|
||||||
}
|
}
|
||||||
|
|
@ -7,21 +7,13 @@
|
||||||
label-width="158px" style="max-width: 100%" status-icon>
|
label-width="158px" style="max-width: 100%" status-icon>
|
||||||
<div style="display: flex;justify-content: space-between;">
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-form-item label="锁定状态">
|
<el-form-item label="站台类型">
|
||||||
<el-select-v2 style="width: 196px;" v-model="searchQueryFormEntity.isLock" placeholder="锁定状态"
|
<el-select-v2 style="width: 196px;" v-model="searchQueryFormEntity.standType" placeholder="站台类型"
|
||||||
:options="addAllOptionOfOptions(lockOptions)"
|
:options="addAllOptionOfOptions(standTypeOptions)"
|
||||||
@change="search()"></el-select-v2>
|
@change="search()"></el-select-v2>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="占用状态">
|
<el-form-item label="站台ID">
|
||||||
<el-select-v2 style="width: 196px;" v-model="searchQueryFormEntity.isOccupy" placeholder="占用状态"
|
<el-input v-model="searchQueryFormEntity.standId" @keyup.enter="search()" clearable/>
|
||||||
:options="addAllOptionOfOptions(occupyOptions)"
|
|
||||||
@change="search()"></el-select-v2>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="库位号">
|
|
||||||
<el-input v-model="searchQueryFormEntity.locationId" @keyup.enter="search()" clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="箱号">
|
|
||||||
<el-input v-model="searchQueryFormEntity.vehicleId" @keyup.enter="search()" clearable/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div style="align-content: center;">
|
<div style="align-content: center;">
|
||||||
|
|
@ -40,121 +32,81 @@
|
||||||
@sort-change="handleSortChange">
|
@sort-change="handleSortChange">
|
||||||
<el-table-column width="65px" fixed="left">
|
<el-table-column width="65px" fixed="left">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-radio :label="scope.row.locationId" v-model="locationId"> </el-radio>
|
<el-radio :label="scope.row.standId" v-model="standId"> </el-radio>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="locationId" label="库位号" fixed="left" min-width="120px" sortable="custom"
|
<el-table-column prop="standId" label="站台ID" fixed="left" min-width="120px" sortable="custom"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="vehicleId" label="箱号" min-width="120px" sortable="custom"
|
<el-table-column prop="standName" label="站台名称" min-width="150px" sortable="custom"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="isLock" label="锁定状态" min-width="120px" :formatter="isLockFormat"
|
<el-table-column prop="standType" label="站台类型" min-width="120px" :formatter="standTypeFormat"
|
||||||
sortable="custom"
|
sortable="custom"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="isOccupy" label="占用状态" :formatter="isOccupyFormat"
|
<el-table-column prop="standStatus" label="站台状态" :formatter="standStatusFormat"
|
||||||
min-width="120px" sortable="custom"
|
min-width="120px" sortable="custom"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="equipmentId" label="设备号" min-width="120px" sortable="custom"
|
<el-table-column prop="standIp" label="站台IP" min-width="150px" sortable="custom"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="tunnelId" label="巷道号" min-width="120px" sortable="custom"
|
<el-table-column prop="standDesc" label="站台描述" min-width="180px" sortable="custom"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="lRow" label="排" min-width="120px" sortable="custom"
|
<el-table-column prop="lastUpdateTime" label="最后更新时间" min-width="180px" sortable="custom"
|
||||||
|
:formatter="timeFormat" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="lastUpdateUser" label="最后更新人" min-width="120px" sortable="custom"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="lCol" label="列"
|
<el-table-column fixed="right" label="操作" width="170px">
|
||||||
min-width="120px" sortable="custom" show-overflow-tooltip/>
|
|
||||||
<el-table-column prop="lLayer" label="层" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip/>
|
|
||||||
<el-table-column prop="lDepth" label="深度" min-width="120px"
|
|
||||||
sortable="custom" show-overflow-tooltip/>
|
|
||||||
<el-table-column prop="subArea" label="子区域" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip/>
|
|
||||||
<!-- <el-table-column fixed="right" label="操作" width="170px">
|
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div style="display: inline-block; align-content: center;">
|
<div style="display: inline-block; align-content: center;">
|
||||||
<el-button type="primary"
|
<el-button type="primary"
|
||||||
@click="editCurrentRowFormEntity(scope.row)">编辑</el-button>
|
@click="editCurrentRowFormEntity(scope.row)">编辑</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column> -->
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<br/>
|
<br/>
|
||||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||||
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
||||||
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
:disabled="false" :background="false" :default-page-size="10" @size-change="handlePageSizeChange"
|
||||||
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
@current-change="processTableData" layout="total, sizes, prev, pager, next, jumper"
|
||||||
:total="baseTableQuery.total"/>
|
:total="baseTableQuery.total"/>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog v-model="rowEditFlag" title="工作信息" width="40%" draggable :show-close="false">
|
<el-dialog v-model="rowEditFlag" title="站台信息" width="40%" draggable :show-close="false">
|
||||||
<el-form ref="rowEditFormRef" :model="rowFormEntity" :label-position="labelPosition"
|
<el-form ref="rowEditFormRef" :model="rowFormEntity" :label-position="labelPosition"
|
||||||
label-width="100px" style="max-width: 100%" status-icon>
|
label-width="100px" style="max-width: 100%" status-icon>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="工作编号">
|
<el-form-item label="站台ID">
|
||||||
<el-input v-model="rowFormEntity.workIndex" disabled/>
|
<el-input v-model="rowFormEntity.standId" disabled/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="工单号">
|
<el-form-item label="站台名称">
|
||||||
<el-input v-model="rowFormEntity.workOrder" disabled/>
|
<el-input v-model="rowFormEntity.standName"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="总成号">
|
<el-form-item label="站台类型">
|
||||||
<el-input v-model="rowFormEntity.productId" disabled/>
|
<el-select-v2 v-model="rowFormEntity.standType" placeholder="请选择站台类型"
|
||||||
|
:options="standTypeOptions"></el-select-v2>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="成品号">
|
<el-form-item label="站台状态">
|
||||||
<el-input v-model="rowFormEntity.singleProductId" disabled/>
|
<el-select-v2 v-model="rowFormEntity.standStatus" placeholder="请选择站台状态"
|
||||||
|
:options="standStatusOptions"></el-select-v2>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="料盒号">
|
<el-form-item label="站台IP">
|
||||||
<el-input v-model="rowFormEntity.boxNo" disabled/>
|
<el-input v-model="rowFormEntity.standIp"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="料号">
|
<el-form-item label="站台描述">
|
||||||
<el-input v-model="rowFormEntity.goodsId" disabled/>
|
<el-input v-model="rowFormEntity.standDesc"/>
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="需求数量">
|
|
||||||
<el-input-number v-model.number="rowFormEntity.needNum" controls-position="right"
|
|
||||||
:min="0" disabled/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="已完成数量">
|
|
||||||
<el-input-number v-model.number="rowFormEntity.finishNum" controls-position="right"
|
|
||||||
:min="0" :max="rowFormEntity.needNum" clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="已分配数量">
|
|
||||||
<el-input-number v-model.number="rowFormEntity.distributeNum"
|
|
||||||
controls-position="right" :min="0" :max="rowFormEntity.needNum" clearable/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="工作状态">
|
|
||||||
<el-select-v2 v-model="rowFormEntity.workStatus" placeholder="请选择工作状态"
|
|
||||||
:options="workStatusOptions"></el-select-v2>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="缺料状态">
|
|
||||||
<el-select-v2 v-model="rowFormEntity.lackStatus" placeholder="请选择缺料状态"
|
|
||||||
:options="lackStatusOptions"></el-select-v2>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
@ -182,37 +134,48 @@ import {ElMessage} from 'element-plus'
|
||||||
import {genTableRequest, addAllOptionOfOptions} from '@/utils/generator.js'
|
import {genTableRequest, addAllOptionOfOptions} from '@/utils/generator.js'
|
||||||
import {labelPosition} from '@/constant/form.js'
|
import {labelPosition} from '@/constant/form.js'
|
||||||
import {loading} from '@/utils/loading'
|
import {loading} from '@/utils/loading'
|
||||||
import {queryLocationsByPage} from "@/api/location";
|
import {getAllStands, updateStandInfo} from "@/api/stand";
|
||||||
import {lockOptions, occupyOptions} from "@/constant/options";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 常量定义
|
* 常量定义
|
||||||
*/
|
*/
|
||||||
const STAND_ID = store.getters.getStandId
|
const STAND_ID = store.getters.getStandId
|
||||||
const USER_NAME = store.getters.getUserName
|
const USER_NAME = store.getters.getUserName
|
||||||
|
|
||||||
|
// 站台类型选项
|
||||||
|
const standTypeOptions = [
|
||||||
|
{ value: 1, label: '拣选站台' },
|
||||||
|
{ value: 2, label: '入库站台' }
|
||||||
|
]
|
||||||
|
|
||||||
|
// 站台状态选项
|
||||||
|
const standStatusOptions = [
|
||||||
|
{ value: 0, label: '可用' },
|
||||||
|
{ value: 1, label: '不可用' }
|
||||||
|
]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 变量定义
|
* 变量定义
|
||||||
*/
|
*/
|
||||||
let maxHeight = ref(window.innerHeight * 0.55)
|
let maxHeight = ref(window.innerHeight * 0.55)
|
||||||
let tableLoading = ref(false)
|
let tableLoading = ref(false)
|
||||||
let tableData = ref([])
|
let tableData = ref([])
|
||||||
|
let allTableData = ref([]) // 存储完整的数据,用于前端分页和排序
|
||||||
let baseTableQuery = reactive({
|
let baseTableQuery = reactive({
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
sortBy: new Map([['lDepth', true], ['lLayer', true], ['lCol', true], ['lRow', true]]),// 按照成品号顺序排序
|
sortBy: new Map([['standId', true]]),// 按照站台ID排序
|
||||||
standId: STAND_ID,
|
standId: STAND_ID,
|
||||||
userName: USER_NAME
|
userName: USER_NAME
|
||||||
})
|
})
|
||||||
let searchQueryFormEntity = reactive({
|
let searchQueryFormEntity = reactive({
|
||||||
locationId: '',
|
standId: '',
|
||||||
vehicleId: '',
|
standType: -99
|
||||||
isLock: -99,
|
|
||||||
isOccupy: -99
|
|
||||||
})
|
})
|
||||||
let searchQueryFormRef = ref()
|
let searchQueryFormRef = ref()
|
||||||
let rowEditFlag = ref(false)
|
let rowEditFlag = ref(false)
|
||||||
let locationId = ''
|
let standId = ''
|
||||||
let rowEditFormRef = ref()
|
let rowEditFormRef = ref()
|
||||||
let rowFormEntity = reactive({})
|
let rowFormEntity = reactive({})
|
||||||
/**
|
/**
|
||||||
|
|
@ -238,20 +201,26 @@ const resizeHeight = () => {
|
||||||
// 查询
|
// 查询
|
||||||
const search = () => {
|
const search = () => {
|
||||||
tableLoading.value = true
|
tableLoading.value = true
|
||||||
let request = genTableRequest(baseTableQuery)
|
let request = {}
|
||||||
// 设定查询参数
|
// 设定查询参数
|
||||||
request.locationId = searchQueryFormEntity.locationId.trim()
|
if (searchQueryFormEntity.standId.trim()) {
|
||||||
request.vehicleId = searchQueryFormEntity.vehicleId.trim()
|
request.standId = searchQueryFormEntity.standId.trim()
|
||||||
request.isLock = searchQueryFormEntity.isLock === -99 ? null : searchQueryFormEntity.isLock
|
}
|
||||||
request.isOccupy = searchQueryFormEntity.isOccupy === -99 ? null : searchQueryFormEntity.isOccupy
|
if (searchQueryFormEntity.standType !== -99) {
|
||||||
queryLocationsByPage(request).then((res) => {
|
request.standType = searchQueryFormEntity.standType
|
||||||
|
}
|
||||||
|
|
||||||
|
getAllStands(request).then((res) => {
|
||||||
const response = res.data
|
const response = res.data
|
||||||
if (response.code === 0) {
|
if (response.code === 0) {
|
||||||
const data = response.data
|
const data = response.data
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
tableData.value = data.lists
|
allTableData.value = data
|
||||||
baseTableQuery.total = data.total
|
baseTableQuery.total = data.length
|
||||||
|
// 处理分页和排序
|
||||||
|
processTableData()
|
||||||
} else {
|
} else {
|
||||||
|
allTableData.value = []
|
||||||
tableData.value = []
|
tableData.value = []
|
||||||
baseTableQuery.total = 0
|
baseTableQuery.total = 0
|
||||||
}
|
}
|
||||||
|
|
@ -265,82 +234,153 @@ const search = () => {
|
||||||
tableLoading.value = false
|
tableLoading.value = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const clearQuery = () => {
|
|
||||||
searchQueryFormEntity.locationId = ''
|
// 处理分页和排序
|
||||||
searchQueryFormEntity.vehicleId = ''
|
const processTableData = () => {
|
||||||
}
|
let data = [...allTableData.value]
|
||||||
const handleSortChange = (data) => {
|
|
||||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
// 前端排序处理
|
||||||
baseTableQuery.sortBy.delete(data.prop)
|
if (baseTableQuery.sortBy.size > 0) {
|
||||||
|
data = sortTableData(data, baseTableQuery.sortBy)
|
||||||
}
|
}
|
||||||
baseTableQuery.sortBy.set(data.prop, data.order.toLowerCase() === 'ascending')
|
|
||||||
|
// 前端分页处理
|
||||||
|
const startIndex = (baseTableQuery.currentPage - 1) * baseTableQuery.pageSize
|
||||||
|
const endIndex = startIndex + baseTableQuery.pageSize
|
||||||
|
tableData.value = data.slice(startIndex, endIndex)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 前端排序函数
|
||||||
|
const sortTableData = (data, sortBy) => {
|
||||||
|
if (sortBy.size === 0) {
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
|
||||||
|
return data.slice().sort((a, b) => {
|
||||||
|
for (const [key, ascending] of sortBy) {
|
||||||
|
let aValue = a[key]
|
||||||
|
let bValue = b[key]
|
||||||
|
|
||||||
|
// 处理null/undefined值
|
||||||
|
if (aValue == null && bValue == null) continue
|
||||||
|
if (aValue == null) return ascending ? 1 : -1 // null值排在后面
|
||||||
|
if (bValue == null) return ascending ? -1 : 1
|
||||||
|
|
||||||
|
// 处理时间字符串
|
||||||
|
if (key === 'lastUpdateTime') {
|
||||||
|
aValue = new Date(aValue).getTime()
|
||||||
|
bValue = new Date(bValue).getTime()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理数字类型(standType, standStatus等)
|
||||||
|
if (typeof aValue === 'number' && typeof bValue === 'number') {
|
||||||
|
if (aValue !== bValue) {
|
||||||
|
return ascending ? aValue - bValue : bValue - aValue
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理字符串
|
||||||
|
if (typeof aValue === 'string' && typeof bValue === 'string') {
|
||||||
|
aValue = aValue.toLowerCase()
|
||||||
|
bValue = bValue.toLowerCase()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换为字符串进行比较(兼容混合类型)
|
||||||
|
aValue = String(aValue)
|
||||||
|
bValue = String(bValue)
|
||||||
|
|
||||||
|
if (aValue < bValue) {
|
||||||
|
return ascending ? -1 : 1
|
||||||
|
}
|
||||||
|
if (aValue > bValue) {
|
||||||
|
return ascending ? 1 : -1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const clearQuery = () => {
|
||||||
|
searchQueryFormEntity.standId = ''
|
||||||
|
searchQueryFormEntity.standType = -99
|
||||||
|
// 重置分页
|
||||||
|
baseTableQuery.currentPage = 1
|
||||||
|
// 重置排序
|
||||||
|
baseTableQuery.sortBy.clear()
|
||||||
|
baseTableQuery.sortBy.set('standId', true) // 默认按站台ID升序排序
|
||||||
search()
|
search()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理页面大小变化
|
||||||
|
const handlePageSizeChange = () => {
|
||||||
|
// 页面大小变化时,重置到第一页
|
||||||
|
baseTableQuery.currentPage = 1
|
||||||
|
processTableData()
|
||||||
|
}
|
||||||
|
const handleSortChange = (data) => {
|
||||||
|
// 临时调试信息
|
||||||
|
console.log('handleSortChange called with:', data)
|
||||||
|
console.log('allTableData length:', allTableData.value.length)
|
||||||
|
|
||||||
|
// 清空当前排序设置
|
||||||
|
baseTableQuery.sortBy.clear()
|
||||||
|
|
||||||
|
// 如果排序不为null,则设置新的排序
|
||||||
|
if (data.order) {
|
||||||
|
const isAscending = data.order.toLowerCase() === 'ascending'
|
||||||
|
baseTableQuery.sortBy.set(data.prop, isAscending)
|
||||||
|
console.log('Setting sort:', data.prop, isAscending)
|
||||||
|
} else {
|
||||||
|
// 如果order为null,恢复默认排序
|
||||||
|
baseTableQuery.sortBy.set('standId', true)
|
||||||
|
console.log('Resetting to default sort: standId')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 排序变化时,重置到第一页
|
||||||
|
baseTableQuery.currentPage = 1
|
||||||
|
processTableData()
|
||||||
|
}
|
||||||
const getCurrentRow = (row) => {
|
const getCurrentRow = (row) => {
|
||||||
locationId = row.locationId
|
standId = row.standId
|
||||||
}
|
}
|
||||||
const timeFormat = (row, column, cellValue, index) => {
|
const timeFormat = (row, column, cellValue, index) => {
|
||||||
return timeFormatter(cellValue)
|
return timeFormatter(cellValue)
|
||||||
}
|
}
|
||||||
const isLockFormat = (row, column, cellValue, index) => {
|
const standTypeFormat = (row, column, cellValue, index) => {
|
||||||
return cellValue === 1 ? '已锁定' : '未锁定'
|
const typeMap = {
|
||||||
|
1: '拣选站台',
|
||||||
|
2: '入库站台'
|
||||||
|
}
|
||||||
|
return typeMap[cellValue] || '未知'
|
||||||
}
|
}
|
||||||
const isOccupyFormat = (row, column, cellValue, index) => {
|
const standStatusFormat = (row, column, cellValue, index) => {
|
||||||
return cellValue === 1 ? '占用' : '空闲'
|
return cellValue === 1 ? '可用' : '不可用'
|
||||||
}
|
}
|
||||||
// 编辑弹框
|
// 编辑弹框
|
||||||
const editCurrentRowFormEntity = (row) => {
|
const editCurrentRowFormEntity = (row) => {
|
||||||
// 设置form值
|
// 设置form值
|
||||||
rowFormEntity.workIndex = row.workIndex
|
rowFormEntity.standId = row.standId
|
||||||
rowFormEntity.workOrder = row.workOrder
|
rowFormEntity.standName = row.standName
|
||||||
rowFormEntity.productId = row.productId
|
rowFormEntity.standType = row.standType
|
||||||
rowFormEntity.singleProductId = row.singleProductId
|
rowFormEntity.standStatus = row.standStatus
|
||||||
rowFormEntity.boxNo = row.boxNo
|
rowFormEntity.standIp = row.standIp
|
||||||
rowFormEntity.goodsId = row.goodsId
|
rowFormEntity.standDesc = row.standDesc
|
||||||
rowFormEntity.needNum = row.needNum
|
|
||||||
rowFormEntity.distributeNum = row.distributeNum
|
|
||||||
rowFormEntity.finishNum = row.finishNum
|
|
||||||
rowFormEntity.workStatus = row.workStatus
|
|
||||||
rowFormEntity.lackStatus = row.lackStatus
|
|
||||||
// 弹出框
|
// 弹出框
|
||||||
rowEditFlag.value = true
|
rowEditFlag.value = true
|
||||||
}
|
}
|
||||||
// 关闭当前缺料工作
|
|
||||||
const closeLackWork = (row) => {
|
|
||||||
const request = {
|
|
||||||
workIndex: row.workIndex,
|
|
||||||
standId: STAND_ID,
|
|
||||||
userName: USER_NAME
|
|
||||||
}
|
|
||||||
loading.open('关闭中...')
|
|
||||||
closeCurrentWorks(request).then(res => {
|
|
||||||
const response = res.data
|
|
||||||
if (response.code == 0) {
|
|
||||||
ElMessage.success(response.message)
|
|
||||||
search()
|
|
||||||
} else {
|
|
||||||
ElMessage.error(response.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
ElMessage.error('请求异常。')
|
|
||||||
}).finally(() => {
|
|
||||||
loading.close()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 更新当前行数据
|
// 更新当前行数据
|
||||||
const submitUpdateRow = (rowFormEntity) => {
|
const submitUpdateRow = (rowFormEntity) => {
|
||||||
const request = {
|
const request = {
|
||||||
workIndex: rowFormEntity.workIndex,
|
standId: rowFormEntity.standId,
|
||||||
distributeNum: rowFormEntity.distributeNum,
|
standName: rowFormEntity.standName,
|
||||||
finishNum: rowFormEntity.finishNum,
|
standType: rowFormEntity.standType,
|
||||||
workStatus: rowFormEntity.workStatus,
|
standStatus: rowFormEntity.standStatus,
|
||||||
lackStatus: rowFormEntity.lackStatus,
|
standIp: rowFormEntity.standIp,
|
||||||
standId: STAND_ID,
|
standDesc: rowFormEntity.standDesc,
|
||||||
userName: USER_NAME
|
userName: 'wms-web'
|
||||||
}
|
}
|
||||||
loading.open('更新中...')
|
loading.open('更新中...')
|
||||||
updateKateWorks(request).then(res => {
|
updateStandInfo(request).then(res => {
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
ElMessage.success('更新数据成功。')
|
ElMessage.success('更新数据成功。')
|
||||||
rowEditFlag.value = false
|
rowEditFlag.value = false
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user