forked from BaoKaiWms/202501-Wms-Kate-Wuxi
Merge branch 'master' of http://112.4.208.194:3000/BaoKaiWms/202501-Wms-Kate-Wuxi
# Conflicts: # dev_wms_client/src/layout/goods.vue
This commit is contained in:
commit
ab09896da6
|
|
@ -83,6 +83,16 @@ export const exportKittingBomRelationWithExcel = (data) => {
|
||||||
timeout: 600000
|
timeout: 600000
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 导出物料
|
||||||
|
export const exportGoodsExcel = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/excel/exportGoodsExcel',
|
||||||
|
method: 'post',
|
||||||
|
responseType: 'blob',
|
||||||
|
data: data,
|
||||||
|
timeout: 600000
|
||||||
|
})
|
||||||
|
}
|
||||||
// 导出库存
|
// 导出库存
|
||||||
export const exportStockExcel = (data) => {
|
export const exportStockExcel = (data) => {
|
||||||
return request({
|
return request({
|
||||||
|
|
@ -123,90 +133,20 @@ export const exportKanbanExcel = (data) => {
|
||||||
timeout: 600000
|
timeout: 600000
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 导出入库记录
|
||||||
// 以下待废弃
|
export const exportInTaskRecordExcel = (data) => {
|
||||||
export const downloadInRecordExcel = (data) => {
|
|
||||||
return request({
|
return request({
|
||||||
url: '/excel/downloadInRecordExcel',
|
url: '/excel/exportInTaskRecordExcel',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
responseType: 'blob',
|
responseType: 'blob',
|
||||||
data: data,
|
data: data,
|
||||||
timeout: 600000
|
timeout: 600000
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 导出出库记录
|
||||||
export const downloadOutRecordExcel = (data) => {
|
export const exportOutTaskRecordExcel = (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: '/excel/downloadOutRecordExcel',
|
url: '/excel/exportOutTaskRecordExcel',
|
||||||
method: 'post',
|
|
||||||
responseType: 'blob',
|
|
||||||
data: data,
|
|
||||||
timeout: 600000
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export const downloadInventoryRecordExcel = (data) => {
|
|
||||||
return request({
|
|
||||||
url: '/excel/downloadInventoryRecordExcel',
|
|
||||||
method: 'post',
|
|
||||||
responseType: 'blob',
|
|
||||||
data: data,
|
|
||||||
timeout: 600000
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export const downloadGoodsExcel = (data) => {
|
|
||||||
return request({
|
|
||||||
url: '/excel/exportBaseGoods',
|
|
||||||
method: 'post',
|
|
||||||
responseType: 'blob',
|
|
||||||
data: data,
|
|
||||||
timeout: 600000
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export const downloadVehicleExcel = (data) => {
|
|
||||||
return request({
|
|
||||||
url: '/excel/downloadVehicleExcel',
|
|
||||||
method: 'post',
|
|
||||||
responseType: 'blob',
|
|
||||||
data: data,
|
|
||||||
timeout: 600000
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export const downloadLocationsExcel = (data) => {
|
|
||||||
return request({
|
|
||||||
url: '/excel/downloadLocationsExcel',
|
|
||||||
method: 'post',
|
|
||||||
responseType: 'blob',
|
|
||||||
data: data,
|
|
||||||
timeout: 600000
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export const queryUploadRecord = (data) => {
|
|
||||||
return request({
|
|
||||||
url: '/excel/queryUploadRecord',
|
|
||||||
method: 'post',
|
|
||||||
data: data,
|
|
||||||
timeout: 100000
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export const downloadClcKanbanRequirementExcel = (data) => {
|
|
||||||
return request({
|
|
||||||
url: '/excel/downloadClcKanbanRequirementExcel',
|
|
||||||
method: 'post',
|
|
||||||
responseType: 'blob',
|
|
||||||
data: data,
|
|
||||||
timeout: 600000
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export const downloadWorkSummaryExcel = (data) => {
|
|
||||||
return request({
|
|
||||||
url: '/excel/downloadWorkSummaryExcel',
|
|
||||||
method: 'post',
|
method: 'post',
|
||||||
responseType: 'blob',
|
responseType: 'blob',
|
||||||
data: data,
|
data: data,
|
||||||
|
|
|
||||||
|
|
@ -8,3 +8,19 @@ export const queryTasksByPage = (params) => {
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 分页查询入库记录
|
||||||
|
export const queryInTaskRecordByPage = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/taskQuery/queryInTaskRecordByPage',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 分页查询出库记录
|
||||||
|
export const queryOutTaskRecordByPage = (params) => {
|
||||||
|
return request({
|
||||||
|
url: '/taskQuery/queryOutTaskRecordByPage',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
const request = axios.create({
|
const request = axios.create({
|
||||||
baseURL: 'http://localhost:12315/wms',
|
baseURL: 'https://s4wwjasrsp01.ap.cat.com/wmsServer/wms',
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,96 +1,105 @@
|
||||||
<template>
|
<template>
|
||||||
<el-config-provider :locale="zhCn">
|
<el-config-provider :locale="zhCn">
|
||||||
<el-container class="content">
|
<el-container class="content">
|
||||||
<div class="work-area">
|
<div class="work-area">
|
||||||
<fieldset class="search-area">
|
<fieldset class="search-area">
|
||||||
<el-form ref="kanbanQueryFormRef" :model="kanbanQuery" :label-position="labelPosition"
|
<el-form ref="kanbanQueryFormRef" :model="kanbanQuery" :label-position="labelPosition"
|
||||||
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-input v-model="kanbanQuery.goodsId" placeholder="料号" @keyup.enter="search()" clearable />
|
<el-input v-model="kanbanQuery.goodsId" placeholder="料号" @keyup.enter="search()"
|
||||||
</el-form-item>
|
clearable/>
|
||||||
<el-form-item label="看板Id">
|
</el-form-item>
|
||||||
<el-input v-model="kanbanQuery.kanbanId" placeholder="看板Id" @keyup.enter="search()" clearable />
|
<el-form-item label="看板Id">
|
||||||
</el-form-item>
|
<el-input v-model="kanbanQuery.kanbanId" placeholder="看板Id"
|
||||||
<el-form-item label="看板状态">
|
@keyup.enter="search()" clearable/>
|
||||||
<el-select-v2 v-model="kanbanQuery.kanbanStatus" placeholder="看板状态"
|
</el-form-item>
|
||||||
:options="addAllOptionOfOptions(kanbanStatusOptions)"
|
<el-form-item label="看板状态">
|
||||||
@change="search()"></el-select-v2>
|
<el-select-v2 v-model="kanbanQuery.kanbanStatus" placeholder="看板状态"
|
||||||
</el-form-item>
|
:options="addAllOptionOfOptions(kanbanStatusOptions)"
|
||||||
<el-form-item label="工单日期开始(生成看板用)">
|
@change="search()"></el-select-v2>
|
||||||
<el-date-picker v-model="kanbanQuery.planStartDateFrom" type="date"
|
</el-form-item>
|
||||||
placeholder="请选择开始日期" :shortcuts="shortcuts" style="width: 196px;" clearable />
|
<el-form-item label="工单日期开始(生成看板用)">
|
||||||
</el-form-item>
|
<el-date-picker v-model="kanbanQuery.planStartDateFrom" type="date"
|
||||||
<el-form-item label="工单日期结束(生成看板用)">
|
placeholder="请选择开始日期" :shortcuts="shortcuts"
|
||||||
<el-date-picker v-model="kanbanQuery.planStartDateTo" type="date"
|
style="width: 196px;" clearable/>
|
||||||
placeholder="请选择结束日期" :shortcuts="shortcuts" style="width: 196px;" clearable />
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="工单日期结束(生成看板用)">
|
||||||
</el-row>
|
<el-date-picker v-model="kanbanQuery.planStartDateTo" type="date"
|
||||||
<div style="align-content: center;">
|
placeholder="请选择结束日期" :shortcuts="shortcuts"
|
||||||
<el-row>
|
style="width: 196px;" clearable/>
|
||||||
<el-button type="primary"
|
</el-form-item>
|
||||||
style="height: 30px; width: 80px; margin: auto 5px 5px auto; color: black;"
|
</el-row>
|
||||||
@click="search()">查询</el-button>
|
<div style="align-content: center;">
|
||||||
<el-button type="warning"
|
<el-row>
|
||||||
style="height: 30px; width: 80px; margin: auto 5px 5px auto; color: black;"
|
<el-button type="primary"
|
||||||
@click="clearQuery()">清空</el-button>
|
style="height: 30px; width: 80px; margin: auto 5px 5px auto; color: black;"
|
||||||
</el-row>
|
@click="search()">查询
|
||||||
<el-row>
|
</el-button>
|
||||||
<el-button
|
<el-button type="warning"
|
||||||
style="height: 30px; width: 80px; margin: auto 5px 5px auto; background-color: #20B2AA; color: #000;"
|
style="height: 30px; width: 80px; margin: auto 5px 5px auto; color: black;"
|
||||||
@click="genKanban()">生成看板</el-button>
|
@click="clearQuery()">清空
|
||||||
<el-button
|
</el-button>
|
||||||
style="height: 30px; width: 80px; margin: auto 5px 5px auto; background-color: #32CD32; color: #000;"
|
</el-row>
|
||||||
@click="exportExcel()">导出看板</el-button>
|
<el-row>
|
||||||
</el-row>
|
<el-button
|
||||||
</div>
|
style="height: 30px; width: 80px; margin: auto 5px 5px auto; background-color: #20B2AA; color: #000;"
|
||||||
</div>
|
@click="genKanban()">生成看板
|
||||||
</el-form>
|
</el-button>
|
||||||
</fieldset>
|
<el-button
|
||||||
<div class="table-area">
|
style="height: 30px; width: 80px; margin: auto 5px 5px auto; background-color: #32CD32; color: #000;"
|
||||||
<el-table :data="kanbanList" stripe border v-loading="tableLoading" class="table-class"
|
@click="exportExcel()">导出看板
|
||||||
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
</el-button>
|
||||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
</el-row>
|
||||||
@sort-change="handleSortChange">
|
</div>
|
||||||
<el-table-column width="65px" fixed="left">
|
|
||||||
<template v-slot="scope">
|
|
||||||
<el-radio :label="scope.row.recordId" v-model="recordId"> </el-radio>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="recordId" label="id" fixed="left" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="goodsId" label="料号" show-overflow-tooltip sortable="custom"
|
|
||||||
min-width="120px" />
|
|
||||||
<el-table-column prop="kanbanId" label="看板id" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="kanbanStatus" label="看板状态" sortable="custom"
|
|
||||||
:formatter="kanbanStatusFormat" min-width="120px" show-overflow-tooltip />
|
|
||||||
</el-table>
|
|
||||||
<br />
|
|
||||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
|
||||||
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
|
||||||
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
|
||||||
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
:total="baseTableQuery.total" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</el-container>
|
</el-form>
|
||||||
</el-config-provider>
|
</fieldset>
|
||||||
|
<div class="table-area">
|
||||||
|
<el-table :data="kanbanList" stripe border v-loading="tableLoading" class="table-class"
|
||||||
|
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||||
|
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||||
|
@sort-change="handleSortChange">
|
||||||
|
<el-table-column width="65px" fixed="left">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-radio :label="scope.row.recordId" v-model="recordId"> </el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="recordId" label="id" fixed="left" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="goodsId" label="料号" show-overflow-tooltip sortable="custom"
|
||||||
|
min-width="120px"/>
|
||||||
|
<el-table-column prop="kanbanId" label="看板id" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="kanbanStatus" label="看板状态" sortable="custom"
|
||||||
|
:formatter="kanbanStatusFormat" min-width="120px" show-overflow-tooltip/>
|
||||||
|
</el-table>
|
||||||
|
<br/>
|
||||||
|
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||||
|
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
||||||
|
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
||||||
|
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="baseTableQuery.total"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-container>
|
||||||
|
</el-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import { queryKanbanByPage, genClcKanbanRequirement } from '@/api/kateWork.js'
|
import {queryKanbanByPage, genClcKanbanRequirement} from '@/api/kateWork.js'
|
||||||
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import {ElMessage} from 'element-plus'
|
||||||
import { genTableRequest, addAllOptionOfOptions } from '@/utils/generator.js'
|
import {genTableRequest, addAllOptionOfOptions} from '@/utils/generator.js'
|
||||||
import { labelPosition, shortcuts } from '@/constant/form'
|
import {labelPosition, shortcuts} from '@/constant/form'
|
||||||
import { kanbanStatusOptions } from '@/constant/options'
|
import {kanbanStatusOptions} from '@/constant/options'
|
||||||
import { loading } from '@/utils/loading.js'
|
import {loading} from '@/utils/loading.js'
|
||||||
import { dateFormatter } from '@/utils/formatter.js'
|
import {dateFormatter} from '@/utils/formatter.js'
|
||||||
import { exportKanbanExcel } from '@/api/excel.js'
|
import {exportKanbanExcel} from '@/api/excel.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 常量定义
|
* 常量定义
|
||||||
*/
|
*/
|
||||||
|
|
@ -103,19 +112,19 @@ let maxHeight = ref(window.innerHeight * 0.55)
|
||||||
let tableLoading = ref(false)
|
let tableLoading = ref(false)
|
||||||
let kanbanList = ref([])
|
let kanbanList = ref([])
|
||||||
let baseTableQuery = reactive({
|
let baseTableQuery = reactive({
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
sortBy: new Map([['goodsId', true]]),
|
sortBy: new Map([['goodsId', true]]),
|
||||||
standId: STAND_ID,
|
standId: STAND_ID,
|
||||||
userName: USER_NAME
|
userName: USER_NAME
|
||||||
})
|
})
|
||||||
let kanbanQuery = reactive({
|
let kanbanQuery = reactive({
|
||||||
goodsId: '',
|
goodsId: '',
|
||||||
kanbanId: '',
|
kanbanId: '',
|
||||||
kanbanStatus: -99,
|
kanbanStatus: -99,
|
||||||
planStartDateFrom: null,
|
planStartDateFrom: null,
|
||||||
planStartDateTo: null
|
planStartDateTo: null
|
||||||
})
|
})
|
||||||
let kanbanQueryFormRef = ref()
|
let kanbanQueryFormRef = ref()
|
||||||
let recordId = ''
|
let recordId = ''
|
||||||
|
|
@ -123,221 +132,221 @@ let recordId = ''
|
||||||
* 系统方法
|
* 系统方法
|
||||||
*/
|
*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
window.addEventListener('resize', resizeHeight)
|
window.addEventListener('resize', resizeHeight)
|
||||||
search()
|
search()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
window.removeEventListener('resize', resizeHeight)
|
window.removeEventListener('resize', resizeHeight)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
const resizeHeight = () => {
|
const resizeHeight = () => {
|
||||||
maxHeight.value = window.innerHeight * 0.55
|
maxHeight.value = window.innerHeight * 0.55
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 自定义方法
|
* 自定义方法
|
||||||
*/
|
*/
|
||||||
// 查询
|
// 查询
|
||||||
const search = () => {
|
const search = () => {
|
||||||
tableLoading.value = true
|
tableLoading.value = true
|
||||||
let request = genTableRequest(baseTableQuery)
|
let request = genTableRequest(baseTableQuery)
|
||||||
// 设定查询参数
|
// 设定查询参数
|
||||||
request.goodsId = kanbanQuery.goodsId
|
request.goodsId = kanbanQuery.goodsId
|
||||||
request.kanbanId = kanbanQuery.kanbanId
|
request.kanbanId = kanbanQuery.kanbanId
|
||||||
request.kanbanStatus = kanbanQuery.kanbanStatus == -99 ? null : kanbanQuery.kanbanStatus
|
request.kanbanStatus = kanbanQuery.kanbanStatus == -99 ? null : kanbanQuery.kanbanStatus
|
||||||
queryKanbanByPage(request).then((res) => {
|
queryKanbanByPage(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) {
|
||||||
kanbanList.value = data.lists
|
kanbanList.value = data.lists
|
||||||
baseTableQuery.total = data.total
|
baseTableQuery.total = data.total
|
||||||
} else {
|
} else {
|
||||||
kanbanList.value = []
|
kanbanList.value = []
|
||||||
baseTableQuery.total = 0
|
baseTableQuery.total = 0
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(response.message)
|
ElMessage.error(response.message)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
ElMessage.error('查询看板信息异常。')
|
ElMessage.error('查询看板信息异常。')
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
tableLoading.value = false
|
tableLoading.value = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 清空查询
|
// 清空查询
|
||||||
const clearQuery = () => {
|
const clearQuery = () => {
|
||||||
kanbanQuery.goodsId = ''
|
kanbanQuery.goodsId = ''
|
||||||
kanbanQuery.kanbanId = ''
|
kanbanQuery.kanbanId = ''
|
||||||
kanbanQuery.kanbanStatus = -99
|
kanbanQuery.kanbanStatus = -99
|
||||||
}
|
}
|
||||||
// 处理排序
|
// 处理排序
|
||||||
const handleSortChange = (data) => {
|
const handleSortChange = (data) => {
|
||||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||||
baseTableQuery.sortBy.delete(data.prop)
|
baseTableQuery.sortBy.delete(data.prop)
|
||||||
}
|
}
|
||||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||||
search()
|
search()
|
||||||
}
|
}
|
||||||
const getCurrentRow = (row) => {
|
const getCurrentRow = (row) => {
|
||||||
recordId = row.recordId
|
recordId = row.recordId
|
||||||
}
|
}
|
||||||
// 看板状态格式化
|
// 看板状态格式化
|
||||||
const kanbanStatusFormat = (row, column, cellValue, index) => {
|
const kanbanStatusFormat = (row, column, cellValue, index) => {
|
||||||
switch (cellValue) {
|
switch (cellValue) {
|
||||||
case 0:
|
case 0:
|
||||||
return '空'
|
return '空'
|
||||||
case 1:
|
case 1:
|
||||||
return '满'
|
return '满'
|
||||||
default:
|
default:
|
||||||
return '异常'
|
return '异常'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const genKanban = () => {
|
const genKanban = () => {
|
||||||
const request = {
|
const request = {
|
||||||
planStartDateFrom: dateFormatter(kanbanQuery.planStartDateFrom),
|
planStartDateFrom: dateFormatter(kanbanQuery.planStartDateFrom),
|
||||||
planStartDateTo: dateFormatter(kanbanQuery.planStartDateTo),
|
planStartDateTo: dateFormatter(kanbanQuery.planStartDateTo),
|
||||||
standId: STAND_ID,
|
standId: STAND_ID,
|
||||||
userName: USER_NAME
|
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)
|
||||||
}
|
}
|
||||||
loading.open('生成中...')
|
}).catch(err => {
|
||||||
genClcKanbanRequirement(request).then(res => {
|
loading.close()
|
||||||
loading.close()
|
console.log(err)
|
||||||
const response = res.data
|
ElMessage.error('生成看板需求异常。')
|
||||||
if (response.code == 0) {
|
})
|
||||||
ElMessage.success('生成看板需求成功。')
|
|
||||||
search()
|
|
||||||
} else {
|
|
||||||
ElMessage.error(response.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
loading.close()
|
|
||||||
console.log(err)
|
|
||||||
ElMessage.error('生成看板需求异常。')
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
// 导出看板
|
// 导出看板
|
||||||
const exportExcel = () => {
|
const exportExcel = () => {
|
||||||
const params = {
|
const params = {
|
||||||
goodsId: kanbanQuery.goodsId,
|
goodsId: kanbanQuery.goodsId,
|
||||||
kanbanId: kanbanQuery.kanbanId,
|
kanbanId: kanbanQuery.kanbanId,
|
||||||
kanbanStatus: kanbanQuery.kanbanStatus == -99 ? null : kanbanQuery.kanbanStatus,
|
kanbanStatus: kanbanQuery.kanbanStatus == -99 ? null : kanbanQuery.kanbanStatus,
|
||||||
standId: STAND_ID,
|
standId: STAND_ID,
|
||||||
userName: USER_NAME
|
userName: USER_NAME
|
||||||
}
|
}
|
||||||
exportKanbanExcel(params).then(res => {
|
exportKanbanExcel(params).then(res => {
|
||||||
const link = document.createElement('a');//创建a标签
|
const link = document.createElement('a');//创建a标签
|
||||||
try {
|
try {
|
||||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
// 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'//隐藏
|
link.style.display = 'none'//隐藏
|
||||||
|
|
||||||
// 兼容不同浏览器的URL对象
|
// 兼容不同浏览器的URL对象
|
||||||
const url = window.URL || window.webkitURL || window.moxURL
|
const url = window.URL || window.webkitURL || window.moxURL
|
||||||
link.href = url.createObjectURL(blob)
|
link.href = url.createObjectURL(blob)
|
||||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||||
document.body.appendChild(link)
|
document.body.appendChild(link)
|
||||||
link.click()
|
link.click()
|
||||||
document.body.removeChild(link)
|
document.body.removeChild(link)
|
||||||
url.revokeObjectURL(link.href)//移除url对象
|
url.revokeObjectURL(link.href)//移除url对象
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
ElMessage.error('下载文件失败')
|
ElMessage.error('下载文件失败')
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
ElMessage.error('导出失败')
|
ElMessage.error('导出失败')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.content {
|
.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.work-area {
|
.work-area {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
/* padding: 5px; */
|
/* padding: 5px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-area {
|
.search-area {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
min-height: fit-content;
|
min-height: fit-content;
|
||||||
max-height: 40%;
|
max-height: 40%;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
min-width: inherit;
|
min-width: inherit;
|
||||||
border: solid 1px;
|
border: solid 1px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-area {
|
.table-area {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
min-height: fit-content;
|
min-height: fit-content;
|
||||||
max-height: 60%;
|
max-height: 60%;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
min-width: inherit;
|
min-width: inherit;
|
||||||
border: solid 1px;
|
border: solid 1px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item {
|
.el-form-item {
|
||||||
margin: 5px 5px 5px 5px;
|
margin: 5px 5px 5px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item .el-input {
|
.el-form-item .el-input {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item .el-select-v2 {
|
.el-form-item .el-select-v2 {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-class {
|
.table-class {
|
||||||
margin: 5px 5px 5px 5px;
|
margin: 5px 5px 5px 5px;
|
||||||
width: inherit;
|
width: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-pagination {
|
.el-pagination {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li {
|
.my-autocomplete li {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
padding: 7px;
|
padding: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .name {
|
.my-autocomplete li .name {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .addr {
|
.my-autocomplete li .addr {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #b4b4b4;
|
color: #b4b4b4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .highlighted .addr {
|
.my-autocomplete li .highlighted .addr {
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .goods_id {
|
.my-autocomplete li .goods_id {
|
||||||
color: brown;
|
color: brown;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .goods_name {
|
.my-autocomplete li .goods_name {
|
||||||
color: cornflowerblue;
|
color: cornflowerblue;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -334,7 +334,7 @@ const timeFormat = (row, column, cellValue, index) => {
|
||||||
}
|
}
|
||||||
const rowStyle = ({ row, rowIndex }) => {
|
const rowStyle = ({ row, rowIndex }) => {
|
||||||
if (row.dbsStatus == 2) {
|
if (row.dbsStatus == 2) {
|
||||||
return { "color": "red" }
|
return { "color": "green" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const handleSortChange = (data) => {
|
const handleSortChange = (data) => {
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-button type="success"
|
<el-button type="success"
|
||||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||||
@click="addBinding()">绑定物料</el-button>
|
@click="confirmBinding()">绑定物料</el-button>
|
||||||
<el-button type="warning"
|
<el-button type="warning"
|
||||||
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
style="height: 50px; width: 100px; margin: auto 5px auto 5px; font-size: large; color: black;"
|
||||||
@click="clearInput()">清除输入</el-button>
|
@click="clearInput()">清除输入</el-button>
|
||||||
|
|
@ -70,8 +70,8 @@
|
||||||
<el-table-column prop="goodsId" label="零件号" fixed="left" />
|
<el-table-column prop="goodsId" label="零件号" fixed="left" />
|
||||||
<el-table-column prop="opNum" label="数量" />
|
<el-table-column prop="opNum" label="数量" />
|
||||||
<el-table-column fixed="right" label="操作">
|
<el-table-column fixed="right" label="操作">
|
||||||
<template #default>
|
<template v-slot="scope">
|
||||||
<el-button plain type="warning" @click="removeThisRow(row)">删除</el-button>
|
<el-button plain type="warning" @click="removeThisRow(scope.row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -79,7 +79,8 @@
|
||||||
<el-dialog v-model="showInOutDialog" title="入库清单扫码" width="70%" draggable>
|
<el-dialog v-model="showInOutDialog" title="入库清单扫码" width="70%" draggable>
|
||||||
<fieldset class="main-area">
|
<fieldset class="main-area">
|
||||||
<el-form ref="outForInRef" :model="outForInEntity" :label-position="labelPosition"
|
<el-form ref="outForInRef" :model="outForInEntity" :label-position="labelPosition"
|
||||||
label-width="158px" style="max-width: 100%" :rules="outForInRules" status-icon @submit.native.prevent>
|
label-width="158px" style="max-width: 100%" :rules="outForInRules" status-icon
|
||||||
|
@submit.native.prevent>
|
||||||
<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="料号">
|
||||||
|
|
@ -106,8 +107,8 @@
|
||||||
:cell-style="{ 'text-align': 'center' }">
|
:cell-style="{ 'text-align': 'center' }">
|
||||||
<el-table-column prop="goodsId" label="料号" fixed="left" />
|
<el-table-column prop="goodsId" label="料号" fixed="left" />
|
||||||
<el-table-column fixed="right" label="操作">
|
<el-table-column fixed="right" label="操作">
|
||||||
<template #default>
|
<template v-slot="scope">
|
||||||
<el-button plain type="warning" @click="popThisGoodsId(row)">删除</el-button>
|
<el-button plain type="warning" @click="popThisGoodsId(scope.row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -271,6 +272,27 @@ const clearInput = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 绑定前确认
|
||||||
|
const confirmBinding = () => {
|
||||||
|
// 判断是否是非空箱入库时,未输入料号和数量
|
||||||
|
if (!inTaskEntity.emptyTask && inTaskEntity.goodsId == '') {
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
'非空箱入库未输入料号。\n是否继续绑定',
|
||||||
|
'警告',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
addBinding()
|
||||||
|
}).catch(() => {
|
||||||
|
ElMessage.info('操作取消')
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
handleEnter()
|
||||||
|
}
|
||||||
|
}
|
||||||
// 添加绑定关系
|
// 添加绑定关系
|
||||||
const addBinding = () => {
|
const addBinding = () => {
|
||||||
if (taskRequestEntity.vehicleId != '' && taskRequestEntity.vehicleId != inTaskEntity.vehicleId) {
|
if (taskRequestEntity.vehicleId != '' && taskRequestEntity.vehicleId != inTaskEntity.vehicleId) {
|
||||||
|
|
@ -431,10 +453,10 @@ const confirmCallVehicles = () => {
|
||||||
const response = res.data
|
const response = res.data
|
||||||
if (response.code == 0) {
|
if (response.code == 0) {
|
||||||
successBox(response.message)
|
successBox(response.message)
|
||||||
outForInRequestEntity.goodsIds = []
|
|
||||||
} else {
|
} else {
|
||||||
errorBox(response.message)
|
errorBox(response.message)
|
||||||
}
|
}
|
||||||
|
outForInRequestEntity.goodsIds = []
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
errorBox('请求错误。')
|
errorBox('请求错误。')
|
||||||
|
|
|
||||||
|
|
@ -1,193 +1,318 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="margin-bottom: 15px">
|
<el-config-provider :locale="zhCn">
|
||||||
<el-config-provider :locale="zhCn">
|
<el-container class="content">
|
||||||
<el-row>
|
<div class="work-area">
|
||||||
<el-input v-model="vehicleIdQuery" style="width: 158px; margin-right: 10px;" placeholder="箱号" />
|
<fieldset class="search-area">
|
||||||
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号" />
|
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
||||||
<el-date-picker v-model="createTimeQuery" type="date" placeholder="选择创建日期" :shortcuts="shortcuts"
|
label-width="158px" style="max-width: 100%" status-icon>
|
||||||
style="width: 158px; margin-right: 10px;" clearable />
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<el-date-picker v-model="finishTimeQuery" type="date" placeholder="选择完成日期" :shortcuts="shortcuts"
|
<el-row>
|
||||||
style="width: 158px; margin-right: 10px;" clearable />
|
<el-form-item label="箱号">
|
||||||
<el-button type="primary" @click="search()">搜索</el-button>
|
<el-input v-model="searchQueryFormEntity.vehicleId" @keyup.enter="search()" clearable/>
|
||||||
<el-button type="warning" @click="reset()">重置</el-button>
|
</el-form-item>
|
||||||
<el-button type="success" @click="exportExcel()">导出记录</el-button>
|
<el-form-item label="料号">
|
||||||
</el-row>
|
<el-input v-model="searchQueryFormEntity.goodsId" @keyup.enter="search()" clearable/>
|
||||||
<br />
|
</el-form-item>
|
||||||
<el-table :data="tasks" stripe border v-loading="loading" style="width: 100%" max-height="684px"
|
<el-form-item label="创建时间from">
|
||||||
class="table-class" :header-cell-style="{ 'text-align': 'center' }"
|
<el-date-picker v-model="searchQueryFormEntity.fromTime" type="datetime"
|
||||||
:cell-style="{ 'text-align': 'center' }">
|
placeholder="请选择from时间" :shortcuts="shortcuts"
|
||||||
<el-table-column prop="taskId" label="任务号" fixed="left" show-overflow-tooltip min-width="120px" />
|
style="width: 196px;" clearable/>
|
||||||
<el-table-column prop="taskType" label="任务类型" fixed="left" :formatter="taskTypeFormat"
|
</el-form-item>
|
||||||
min-width="120px" />
|
<el-form-item label="创建时间to">
|
||||||
<el-table-column prop="vehicleId" label="箱号" min-width="120px" show-overflow-tooltip />
|
<el-date-picker v-model="searchQueryFormEntity.toTime" type="datetime"
|
||||||
<el-table-column prop="goodsRelated.goodsId" label="料号" min-width="120px" show-overflow-tooltip />
|
placeholder="请选择to时间" :shortcuts="shortcuts"
|
||||||
<el-table-column prop="goodsRelated.goodsName" label="料名" min-width="120px" show-overflow-tooltip />
|
style="width: 196px;" clearable/>
|
||||||
<el-table-column prop="taskGroup" label="任务组" min-width="120px" show-overflow-tooltip />
|
</el-form-item>
|
||||||
<el-table-column prop="origin" label="起点" min-width="120px" />
|
</el-row>
|
||||||
<el-table-column prop="destination" label="终点" min-width="120px" />
|
<div style="align-content: center;">
|
||||||
<el-table-column prop="goodsRelated.opNum" label="操作数量" min-width="120px" />
|
<el-row>
|
||||||
<el-table-column prop="goodsRelated.originNum" label="库存数量" min-width="120px" />
|
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||||
<el-table-column prop="taskPriority" label="任务优先级" min-width="120px" />
|
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||||
<el-table-column prop="preTask" label="前置任务" min-width="120px" show-overflow-tooltip />
|
</el-row>
|
||||||
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px"
|
<el-row>
|
||||||
show-overflow-tooltip />
|
<el-button type="success" class="btn-search"
|
||||||
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px"
|
@click="exportExcel()">导出excel
|
||||||
show-overflow-tooltip />
|
</el-button>
|
||||||
<el-table-column prop="userName" label="操作人员姓名" min-width="120px" />
|
</el-row>
|
||||||
<el-table-column prop="taskStatus" label="任务状态" fixed="right" :formatter="taskStatusFormat"
|
</div>
|
||||||
min-width="120px" />
|
</div>
|
||||||
</el-table>
|
</el-form>
|
||||||
<br />
|
</fieldset>
|
||||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
<div class="table-area">
|
||||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
<el-table :data="tableData" stripe border v-loading="tableLoading" class="table-class"
|
||||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||||
@current-change="search" />
|
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||||
</el-config-provider>
|
@sort-change="handleSortChange">
|
||||||
</div>
|
<el-table-column width="65px" fixed="left">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-radio :label="scope.row.taskId" v-model="taskId"> </el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="taskId" label="任务号" fixed="left" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="taskType" label="任务类型" :formatter="taskTypeFormat" min-width="120px"
|
||||||
|
sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="taskStatus" label="任务状态" :formatter="taskStatusFormat" min-width="120px"
|
||||||
|
sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="taskPriority" label="优先级" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="goodsId" label="料号" min-width="120px" fixed="left" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="goodsDesc" label="物料描述"
|
||||||
|
min-width="120px" sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="opNum" label="操作数量" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="stockNum" label="库存数量" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="origin" label="起点" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="destination" label="终点" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="wcsTaskId" label="wcs任务号" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" fixed="right" min-width="120px"
|
||||||
|
sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" fixed="right" min-width="120px"
|
||||||
|
sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="opUser" label="操作用户" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="remark" label="备注" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="callStand" label="呼叫站台" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip/>
|
||||||
|
</el-table>
|
||||||
|
<br/>
|
||||||
|
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||||
|
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
||||||
|
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
||||||
|
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="baseTableQuery.total"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-container>
|
||||||
|
</el-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { getTaskRecords } from '@/api/record.js'
|
|
||||||
import { dateFormatter, taskStatusFormatter, timeFormatter } from '@/utils/formatter.js'
|
|
||||||
import { downloadInRecordExcel } from '@/api/excel.js'
|
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import { errorBox } from '@/utils/myMessageBox.js'
|
import {queryInTaskRecordByPage} from '@/api/taskQuery.js'
|
||||||
</script>
|
import {timeFormatter, wmsTaskTypeFormatter, wmsTaskStatusFormatter, dateFormatter} from '@/utils/formatter.js'
|
||||||
<script>
|
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||||
export default {
|
import {ElMessage} from 'element-plus'
|
||||||
name: 'inTaskRecord',
|
import {genTableRequest} from '@/utils/generator.js'
|
||||||
data() {
|
import {labelPosition, shortcuts} from '@/constant/form.js'
|
||||||
return {
|
import {exportInTaskRecordExcel} from '@/api/excel.js'
|
||||||
tasks: [],
|
|
||||||
currentPage: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
total: 0,
|
|
||||||
goodsIdQuery: '',
|
|
||||||
vehicleIdQuery: '',
|
|
||||||
loading: true,
|
|
||||||
createTimeQuery: null,
|
|
||||||
finishTimeQuery: null,
|
|
||||||
shortcuts: [
|
|
||||||
{
|
|
||||||
text: '今天',
|
|
||||||
value: new Date(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '昨天',
|
|
||||||
value: () => {
|
|
||||||
const date = new Date()
|
|
||||||
date.setTime(date.getTime() - 3600 * 1000 * 24)
|
|
||||||
return date
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.search()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
dateFormat: (row, column, cellValue, index) => {
|
|
||||||
return dateFormatter(cellValue)
|
|
||||||
},
|
|
||||||
timeFormat: (row, column, cellValue, index) => {
|
|
||||||
return timeFormatter(cellValue)
|
|
||||||
},
|
|
||||||
taskStatusFormat: (row, column, cellValue, index) => {
|
|
||||||
return taskStatusFormatter(cellValue)
|
|
||||||
},
|
|
||||||
taskTypeFormat: (row, column, cellValue, index) => {
|
|
||||||
switch (cellValue) {
|
|
||||||
case 1: return '入库'
|
|
||||||
case 2: return '出库'
|
|
||||||
case 3: return '盘点'
|
|
||||||
case 9: return '移库'
|
|
||||||
default: return '未知'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
search() {
|
|
||||||
this.loading = true
|
|
||||||
const tableRequest = {
|
|
||||||
pageNo: this.currentPage,
|
|
||||||
pageSize: this.pageSize,
|
|
||||||
taskType: 1,
|
|
||||||
goodsId: this.goodsIdQuery.trim(),
|
|
||||||
vehicleId: this.vehicleIdQuery.trim(),
|
|
||||||
createTime: timeFormatter(this.createTimeQuery),
|
|
||||||
finishTime: timeFormatter(this.finishTimeQuery),
|
|
||||||
}
|
|
||||||
getTaskRecords(tableRequest).then(res => {
|
|
||||||
const tableResponse = res.data
|
|
||||||
if (tableResponse.code == 0) {
|
|
||||||
this.tasks = tableResponse.returnData.lists
|
|
||||||
this.total = tableResponse.returnData.total
|
|
||||||
} else {
|
|
||||||
errorBox(tableResponse.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
errorBox('查询任务记录错误')
|
|
||||||
})
|
|
||||||
this.loading = false
|
|
||||||
},
|
|
||||||
reset() {
|
|
||||||
this.goodsIdQuery = ''
|
|
||||||
this.vehicleIdQuery = ''
|
|
||||||
this.createTimeQuery = null
|
|
||||||
this.finishTimeQuery = null
|
|
||||||
this.search()
|
|
||||||
},
|
|
||||||
exportExcel() {
|
|
||||||
const params = {
|
|
||||||
vehicleId: this.vehicleIdQuery.trim(),
|
|
||||||
goodsId: this.goodsIdQuery.trim(),
|
|
||||||
createTime: timeFormatter(this.createTimeQuery),
|
|
||||||
finishTime: timeFormatter(this.finishTimeQuery),
|
|
||||||
userName: store.getters.getUserName
|
|
||||||
}
|
|
||||||
downloadInRecordExcel(params).then(res => {
|
|
||||||
const link = document.createElement('a');//创建a标签
|
|
||||||
try {
|
|
||||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
|
||||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
|
||||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
|
||||||
let _fileName = "导出入库记录" + dateFormatter(new Date) + ".xlsx"
|
|
||||||
link.style.display = 'none'//隐藏
|
|
||||||
|
|
||||||
// 兼容不同浏览器的URL对象
|
/**
|
||||||
const url = window.URL || window.webkitURL || window.moxURL
|
* 常量定义
|
||||||
link.href = url.createObjectURL(blob)
|
*/
|
||||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
const STAND_ID = store.getters.getStandId
|
||||||
document.body.appendChild(link)
|
const USER_NAME = store.getters.getUserName
|
||||||
link.click()
|
/**
|
||||||
document.body.removeChild(link)
|
* 变量定义
|
||||||
url.revokeObjectURL(link.href)//移除url对象
|
*/
|
||||||
} catch (e) {
|
let maxHeight = ref(window.innerHeight * 0.55)
|
||||||
console.log(e)
|
let tableLoading = ref(false)
|
||||||
errorBox('下载文件失败')
|
let tableData = ref([])
|
||||||
}
|
let baseTableQuery = reactive({
|
||||||
}).catch(err => {
|
currentPage: 1,
|
||||||
console.log(err)
|
pageSize: 10,
|
||||||
errorBox('导出失败')
|
total: 0,
|
||||||
})
|
sortBy: new Map([['createTime', false]]),// 按照创建时间倒序
|
||||||
},
|
standId: STAND_ID,
|
||||||
},
|
userName: USER_NAME
|
||||||
|
})
|
||||||
|
let searchQueryFormEntity = reactive({
|
||||||
|
vehicleId: '',
|
||||||
|
goodsId: '',
|
||||||
|
fromTime: null,
|
||||||
|
toTime: null
|
||||||
|
})
|
||||||
|
let searchQueryFormRef = ref()
|
||||||
|
let taskId = ''
|
||||||
|
/**
|
||||||
|
* 系统方法
|
||||||
|
*/
|
||||||
|
onMounted(() => {
|
||||||
|
nextTick(() => {
|
||||||
|
window.addEventListener('resize', resizeHeight)
|
||||||
|
search()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
nextTick(() => {
|
||||||
|
window.removeEventListener('resize', resizeHeight)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
const resizeHeight = () => {
|
||||||
|
maxHeight.value = window.innerHeight * 0.55
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 自定义方法
|
||||||
|
*/
|
||||||
|
// 查询
|
||||||
|
const search = () => {
|
||||||
|
tableLoading.value = true
|
||||||
|
let request = genTableRequest(baseTableQuery)
|
||||||
|
// 设定查询参数
|
||||||
|
request.vehicleId = searchQueryFormEntity.vehicleId.trim()
|
||||||
|
request.goodsId = searchQueryFormEntity.goodsId.trim()
|
||||||
|
request.fromTime = searchQueryFormEntity.fromTime == null ? null : timeFormatter(searchQueryFormEntity.fromTime)
|
||||||
|
request.toTime = searchQueryFormEntity.toTime == null ? null : timeFormatter(searchQueryFormEntity.toTime)
|
||||||
|
queryInTaskRecordByPage(request).then((res) => {
|
||||||
|
const response = res.data
|
||||||
|
if (response.code === 0) {
|
||||||
|
const data = response.data
|
||||||
|
if (data != null) {
|
||||||
|
tableData.value = data.lists
|
||||||
|
baseTableQuery.total = data.total
|
||||||
|
} else {
|
||||||
|
tableData.value = []
|
||||||
|
baseTableQuery.total = 0
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ElMessage.error(response.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('查询数据异常。')
|
||||||
|
}).finally(() => {
|
||||||
|
tableLoading.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const clearQuery = () => {
|
||||||
|
searchQueryFormEntity.vehicleId = ''
|
||||||
|
searchQueryFormEntity.goodsId = ''
|
||||||
|
searchQueryFormEntity.fromTime = null
|
||||||
|
searchQueryFormEntity.toTime = null
|
||||||
|
}
|
||||||
|
const handleSortChange = (data) => {
|
||||||
|
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||||
|
baseTableQuery.sortBy.delete(data.prop)
|
||||||
|
}
|
||||||
|
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||||
|
search()
|
||||||
|
}
|
||||||
|
const getCurrentRow = (row) => {
|
||||||
|
taskId = row.taskId
|
||||||
|
}
|
||||||
|
const timeFormat = (row, column, cellValue, index) => {
|
||||||
|
return timeFormatter(cellValue)
|
||||||
|
}
|
||||||
|
const taskTypeFormat = (row, column, cellValue, index) => {
|
||||||
|
return wmsTaskTypeFormatter(cellValue)
|
||||||
|
}
|
||||||
|
const taskStatusFormat = (row, column, cellValue, index) => {
|
||||||
|
return wmsTaskStatusFormatter(cellValue)
|
||||||
|
}
|
||||||
|
const exportExcel = () => {
|
||||||
|
const params = {
|
||||||
|
goodsId: searchQueryFormEntity.goodsId,
|
||||||
|
vehicleId: searchQueryFormEntity.vehicleId,
|
||||||
|
fromTime: searchQueryFormEntity.fromTime == null ? null : timeFormatter(searchQueryFormEntity.fromTime),
|
||||||
|
toTime: searchQueryFormEntity.toTime == null ? null : timeFormatter(searchQueryFormEntity.toTime),
|
||||||
|
userName: USER_NAME
|
||||||
|
}
|
||||||
|
exportInTaskRecordExcel(params).then(res => {
|
||||||
|
const link = document.createElement('a');//创建a标签
|
||||||
|
try {
|
||||||
|
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||||
|
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||||
|
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||||
|
let _fileName = '入库记录' + dateFormatter(new Date) + '.xlsx'
|
||||||
|
link.style.display = 'none'//隐藏
|
||||||
|
|
||||||
|
// 兼容不同浏览器的URL对象
|
||||||
|
const url = window.URL || window.webkitURL || window.moxURL
|
||||||
|
link.href = url.createObjectURL(blob)
|
||||||
|
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
document.body.removeChild(link)
|
||||||
|
url.revokeObjectURL(link.href)//移除url对象
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
ElMessage.error('下载文件失败')
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('导出失败')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.el-pagination {
|
.content {
|
||||||
padding-left: 5px;
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-button {
|
.work-area {
|
||||||
width: 72px;
|
width: 100%;
|
||||||
margin-left: 0px;
|
/* padding: 5px; */
|
||||||
margin-right: 5px;
|
}
|
||||||
|
|
||||||
|
.search-area {
|
||||||
|
margin: auto;
|
||||||
|
min-height: fit-content;
|
||||||
|
max-height: 40%;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
min-width: inherit;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
|
overflow: auto;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-area {
|
||||||
|
margin: auto;
|
||||||
|
min-height: fit-content;
|
||||||
|
max-height: 60%;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
min-width: inherit;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
|
overflow: auto;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item {
|
||||||
|
margin: 5px 5px 5px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item .el-input {
|
||||||
|
width: 196px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item .el-input-number {
|
||||||
|
width: 196px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item .el-select-v2 {
|
||||||
|
width: 196px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-class {
|
.table-class {
|
||||||
width: 100%;
|
margin: 5px 5px 5px 5px;
|
||||||
|
width: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-pagination {
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-search {
|
||||||
|
height: 30px;
|
||||||
|
width: 80px;
|
||||||
|
margin: auto 5px 5px auto;
|
||||||
|
color: black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,192 +1,346 @@
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div style="margin-bottom: 15px">
|
<el-config-provider :locale="zhCn">
|
||||||
<el-config-provider :locale="zhCn">
|
<el-container class="content">
|
||||||
<el-row>
|
<div class="work-area">
|
||||||
<el-input v-model="goodsIdQuery" style="width: 158px; margin-right: 10px;" placeholder="料号" />
|
<fieldset class="search-area">
|
||||||
<el-input v-model="vehicleIdQuery" style="width: 158px; margin-right: 10px;" placeholder="箱号" />
|
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
||||||
<el-date-picker v-model="createTimeQuery" type="date" placeholder="选择创建日期" :shortcuts="shortcuts"
|
label-width="158px" style="max-width: 100%" status-icon>
|
||||||
style="width: 158px; margin-right: 10px;" clearable />
|
<div style="display: flex;justify-content: space-between;">
|
||||||
<el-date-picker v-model="finishTimeQuery" type="date" placeholder="选择完成日期" :shortcuts="shortcuts"
|
<el-row>
|
||||||
style="width: 158px; margin-right: 10px;" clearable />
|
<el-form-item label="箱号">
|
||||||
<el-button type="primary" @click="search()">搜索</el-button>
|
<el-input v-model="searchQueryFormEntity.vehicleId" @keyup.enter="search()" clearable/>
|
||||||
<el-button type="warning" @click="reset()">重置</el-button>
|
</el-form-item>
|
||||||
<el-button type="success" @click="exportExcel()">导出记录</el-button>
|
<el-form-item label="料号">
|
||||||
</el-row>
|
<el-input v-model="searchQueryFormEntity.goodsId" @keyup.enter="search()" clearable/>
|
||||||
<br />
|
</el-form-item>
|
||||||
<el-table :data="tasks" stripe border v-loading="loading" style="width: 100%" max-height="684px"
|
<el-form-item label="创建时间from">
|
||||||
class="table-class" :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }">
|
<el-date-picker v-model="searchQueryFormEntity.fromTime" type="datetime"
|
||||||
<el-table-column prop="taskId" label="任务号" fixed="left" show-overflow-tooltip min-width="120px" />
|
placeholder="请选择from时间" :shortcuts="shortcuts"
|
||||||
<el-table-column prop="taskType" label="任务类型" fixed="left" :formatter="taskTypeFormat" min-width="120px" />
|
style="width: 196px;" clearable/>
|
||||||
<el-table-column prop="vehicleId" label="箱号" min-width="120px" show-overflow-tooltip />
|
</el-form-item>
|
||||||
<el-table-column prop="goodsRelated.goodsId" label="料号" min-width="120px" show-overflow-tooltip />
|
<el-form-item label="创建时间to">
|
||||||
<el-table-column prop="goodsRelated.goodsName" label="料名" min-width="120px" show-overflow-tooltip />
|
<el-date-picker v-model="searchQueryFormEntity.toTime" type="datetime"
|
||||||
<el-table-column prop="taskGroup" label="任务组" min-width="120px" show-overflow-tooltip />
|
placeholder="请选择to时间" :shortcuts="shortcuts"
|
||||||
<el-table-column prop="origin" label="起点" min-width="120px" />
|
style="width: 196px;" clearable/>
|
||||||
<el-table-column prop="destination" label="终点" min-width="120px" />
|
</el-form-item>
|
||||||
<el-table-column prop="goodsRelated.opNum" label="操作数量" min-width="120px" />
|
</el-row>
|
||||||
<el-table-column prop="goodsRelated.originNum" label="库存数量" min-width="120px" />
|
<div style="align-content: center;">
|
||||||
<el-table-column prop="taskPriority" label="任务优先级" min-width="120px" />
|
<el-row>
|
||||||
<el-table-column prop="preTask" label="前置任务" min-width="120px" show-overflow-tooltip />
|
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||||
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px" show-overflow-tooltip />
|
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||||
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px"
|
</el-row>
|
||||||
show-overflow-tooltip />
|
<el-row>
|
||||||
<el-table-column prop="userName" label="操作人员姓名" min-width="120px" />
|
<el-button type="success" class="btn-search"
|
||||||
<el-table-column prop="taskStatus" label="任务状态" fixed="right" :formatter="taskStatusFormat"
|
@click="exportExcel()">导出excel
|
||||||
min-width="120px" />
|
</el-button>
|
||||||
</el-table>
|
</el-row>
|
||||||
<br />
|
</div>
|
||||||
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 25, 50]"
|
</div>
|
||||||
:small="false" :disabled="false" :background="false" :default-page-size="10"
|
</el-form>
|
||||||
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="search"
|
</fieldset>
|
||||||
@current-change="search" />
|
<div class="table-area">
|
||||||
</el-config-provider>
|
<el-table :data="tableData" stripe border v-loading="tableLoading" class="table-class"
|
||||||
</div>
|
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||||
|
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||||
|
@sort-change="handleSortChange">
|
||||||
|
<el-table-column width="65px" fixed="left">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-radio :label="scope.row.taskId" v-model="taskId"> </el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="taskId" label="任务号" fixed="left" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="taskType" label="任务类型" :formatter="taskTypeFormat" min-width="120px"
|
||||||
|
sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="taskStatus" label="任务状态" :formatter="taskStatusFormat" min-width="120px"
|
||||||
|
sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="taskPriority" label="优先级" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="goodsId" label="料号" min-width="120px" fixed="left" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="goodsDesc" label="物料描述"
|
||||||
|
min-width="120px" sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="opNum" label="操作数量" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="stockNum" label="库存数量" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="origin" label="起点" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="destination" label="终点" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="wcsTaskId" label="wcs任务号" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" fixed="right" min-width="120px"
|
||||||
|
sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" fixed="right" min-width="120px"
|
||||||
|
sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="opUser" label="操作用户" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="remark" label="备注" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="callStand" label="呼叫站台" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip/>
|
||||||
|
</el-table>
|
||||||
|
<br/>
|
||||||
|
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||||
|
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
||||||
|
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
||||||
|
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="baseTableQuery.total"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-container>
|
||||||
|
</el-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { getTaskRecords } from '@/api/record.js'
|
|
||||||
import { dateFormatter, taskStatusFormatter, timeFormatter } from '@/utils/formatter.js'
|
|
||||||
import { downloadOutRecordExcel } from '@/api/excel.js'
|
|
||||||
import { errorBox } from '@/utils/myMessageBox.js'
|
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
</script>
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
<script>
|
import {queryOutTaskRecordByPage} from '@/api/taskQuery.js'
|
||||||
export default {
|
import {exportOutTaskRecordExcel} from "@/api/excel"
|
||||||
name: 'outTaskRecord',
|
import {timeFormatter, wmsTaskTypeFormatter, wmsTaskStatusFormatter, dateFormatter} from '@/utils/formatter.js'
|
||||||
data() {
|
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||||
return {
|
import {ElMessage} from 'element-plus'
|
||||||
tasks: [],
|
import {genTableRequest} from '@/utils/generator.js'
|
||||||
currentPage: 1,
|
import {labelPosition, shortcuts} from '@/constant/form.js'
|
||||||
pageSize: 10,
|
|
||||||
total: 0,
|
|
||||||
goodsIdQuery: '',
|
|
||||||
vehicleIdQuery: '',
|
|
||||||
loading: true,
|
|
||||||
createTimeQuery: null,
|
|
||||||
finishTimeQuery: null,
|
|
||||||
shortcuts: [
|
|
||||||
{
|
|
||||||
text: '今天',
|
|
||||||
value: new Date(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '昨天',
|
|
||||||
value: () => {
|
|
||||||
const date = new Date()
|
|
||||||
date.setTime(date.getTime() - 3600 * 1000 * 24)
|
|
||||||
return date
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.search()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
dateFormat: (row, column, cellValue, index) => {
|
|
||||||
return dateFormatter(cellValue)
|
|
||||||
},
|
|
||||||
timeFormat: (row, column, cellValue, index) => {
|
|
||||||
return timeFormatter(cellValue)
|
|
||||||
},
|
|
||||||
taskStatusFormat: (row, column, cellValue, index) => {
|
|
||||||
return taskStatusFormatter(cellValue)
|
|
||||||
},
|
|
||||||
taskTypeFormat: (row, column, cellValue, index) => {
|
|
||||||
switch (cellValue) {
|
|
||||||
case 1: return '入库'
|
|
||||||
case 2: return '出库'
|
|
||||||
case 3: return '盘点'
|
|
||||||
case 9: return '移库'
|
|
||||||
default: return '未知'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
search() {
|
|
||||||
this.loading = true
|
|
||||||
const tableRequest = {
|
|
||||||
pageNo: this.currentPage,
|
|
||||||
pageSize: this.pageSize,
|
|
||||||
taskType: 2,
|
|
||||||
goodsId: this.goodsIdQuery.trim(),
|
|
||||||
vehicleId: this.vehicleIdQuery.trim(),
|
|
||||||
createTime: timeFormatter(this.createTimeQuery),
|
|
||||||
finishTime: timeFormatter(this.finishTimeQuery),
|
|
||||||
}
|
|
||||||
getTaskRecords(tableRequest).then(res => {
|
|
||||||
const tableResponse = res.data
|
|
||||||
if (tableResponse.code == 0) {
|
|
||||||
this.tasks = tableResponse.returnData.lists
|
|
||||||
this.total = tableResponse.returnData.total
|
|
||||||
} else {
|
|
||||||
ElMessage.error(tableResponse.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
errorBox('查询任务记录错误')
|
|
||||||
})
|
|
||||||
this.loading = false
|
|
||||||
},
|
|
||||||
reset() {
|
|
||||||
this.goodsIdQuery = ''
|
|
||||||
this.vehicleIdQuery = ''
|
|
||||||
this.createTimeQuery = null
|
|
||||||
this.finishTimeQuery = null
|
|
||||||
this.search()
|
|
||||||
},
|
|
||||||
exportExcel() {
|
|
||||||
const params = {
|
|
||||||
vehicleId: this.vehicleIdQuery.trim(),
|
|
||||||
goodsId: this.goodsIdQuery.trim(),
|
|
||||||
createTime: timeFormatter(this.createTimeQuery),
|
|
||||||
finishTime: timeFormatter(this.finishTimeQuery),
|
|
||||||
userName: store.getters.userName
|
|
||||||
}
|
|
||||||
downloadOutRecordExcel(params).then(res => {
|
|
||||||
const link = document.createElement('a');//创建a标签
|
|
||||||
try {
|
|
||||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
|
||||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
|
||||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
|
||||||
let _fileName = "导出出库记录" + dateFormatter(new Date) + ".xlsx"
|
|
||||||
link.style.display = 'none'//隐藏
|
|
||||||
|
|
||||||
// 兼容不同浏览器的URL对象
|
/**
|
||||||
const url = window.URL || window.webkitURL || window.moxURL
|
* 常量定义
|
||||||
link.href = url.createObjectURL(blob)
|
*/
|
||||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
const STAND_ID = store.getters.getStandId
|
||||||
document.body.appendChild(link)
|
const USER_NAME = store.getters.getUserName
|
||||||
link.click()
|
/**
|
||||||
document.body.removeChild(link)
|
* 变量定义
|
||||||
url.revokeObjectURL(link.href)//移除url对象
|
*/
|
||||||
} catch (e) {
|
let maxHeight = ref(window.innerHeight * 0.55)
|
||||||
console.log(e)
|
let tableLoading = ref(false)
|
||||||
errorBox('下载文件失败')
|
let tableData = ref([])
|
||||||
}
|
let baseTableQuery = reactive({
|
||||||
}).catch(err => {
|
currentPage: 1,
|
||||||
console.log(err)
|
pageSize: 10,
|
||||||
errorBox('导出失败')
|
total: 0,
|
||||||
})
|
sortBy: new Map([['createTime', false]]),// 按创建时间倒序
|
||||||
},
|
standId: STAND_ID,
|
||||||
},
|
userName: USER_NAME
|
||||||
|
})
|
||||||
|
let searchQueryFormEntity = reactive({
|
||||||
|
vehicleId: '',
|
||||||
|
goodsId: '',
|
||||||
|
fromTime: null,
|
||||||
|
toTime: null
|
||||||
|
})
|
||||||
|
let searchQueryFormRef = ref()
|
||||||
|
let taskId = ''
|
||||||
|
/**
|
||||||
|
* 系统方法
|
||||||
|
*/
|
||||||
|
onMounted(() => {
|
||||||
|
nextTick(() => {
|
||||||
|
window.addEventListener('resize', resizeHeight)
|
||||||
|
search()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
nextTick(() => {
|
||||||
|
window.removeEventListener('resize', resizeHeight)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
const resizeHeight = () => {
|
||||||
|
maxHeight.value = window.innerHeight * 0.55
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 自定义方法
|
||||||
|
*/
|
||||||
|
// 查询
|
||||||
|
const search = () => {
|
||||||
|
tableLoading.value = true
|
||||||
|
let request = genTableRequest(baseTableQuery)
|
||||||
|
// 设定查询参数
|
||||||
|
request.vehicleId = searchQueryFormEntity.vehicleId.trim()
|
||||||
|
request.goodsId = searchQueryFormEntity.goodsId.trim()
|
||||||
|
request.fromTime = searchQueryFormEntity.fromTime == null ? null : timeFormatter(searchQueryFormEntity.fromTime)
|
||||||
|
request.toTime = searchQueryFormEntity.toTime == null ? null : timeFormatter(searchQueryFormEntity.toTime)
|
||||||
|
queryOutTaskRecordByPage(request).then((res) => {
|
||||||
|
const response = res.data
|
||||||
|
if (response.code === 0) {
|
||||||
|
const data = response.data
|
||||||
|
if (data != null) {
|
||||||
|
tableData.value = data.lists
|
||||||
|
baseTableQuery.total = data.total
|
||||||
|
} else {
|
||||||
|
tableData.value = []
|
||||||
|
baseTableQuery.total = 0
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ElMessage.error(response.message)
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('查询数据异常。')
|
||||||
|
}).finally(() => {
|
||||||
|
tableLoading.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const clearQuery = () => {
|
||||||
|
searchQueryFormEntity.vehicleId = ''
|
||||||
|
searchQueryFormEntity.goodsId = ''
|
||||||
|
searchQueryFormEntity.fromTime = null
|
||||||
|
searchQueryFormEntity.toTime = null
|
||||||
|
}
|
||||||
|
const handleSortChange = (data) => {
|
||||||
|
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||||
|
baseTableQuery.sortBy.delete(data.prop)
|
||||||
|
}
|
||||||
|
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||||
|
search()
|
||||||
|
}
|
||||||
|
const getCurrentRow = (row) => {
|
||||||
|
taskId = row.taskId
|
||||||
|
}
|
||||||
|
const timeFormat = (row, column, cellValue, index) => {
|
||||||
|
return timeFormatter(cellValue)
|
||||||
|
}
|
||||||
|
const taskTypeFormat = (row, column, cellValue, index) => {
|
||||||
|
return wmsTaskTypeFormatter(cellValue)
|
||||||
|
}
|
||||||
|
const taskStatusFormat = (row, column, cellValue, index) => {
|
||||||
|
return wmsTaskStatusFormatter(cellValue)
|
||||||
|
}
|
||||||
|
const exportExcel = () => {
|
||||||
|
const params = {
|
||||||
|
goodsId: searchQueryFormEntity.goodsId,
|
||||||
|
vehicleId: searchQueryFormEntity.vehicleId,
|
||||||
|
fromTime: searchQueryFormEntity.fromTime == null ? null : timeFormatter(searchQueryFormEntity.fromTime),
|
||||||
|
toTime: searchQueryFormEntity.toTime == null ? null : timeFormatter(searchQueryFormEntity.toTime),
|
||||||
|
userName: USER_NAME
|
||||||
|
}
|
||||||
|
exportOutTaskRecordExcel(params).then(res => {
|
||||||
|
const link = document.createElement('a');//创建a标签
|
||||||
|
try {
|
||||||
|
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||||
|
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||||
|
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||||
|
let _fileName = '出库记录' + dateFormatter(new Date) + '.xlsx'
|
||||||
|
link.style.display = 'none'//隐藏
|
||||||
|
|
||||||
|
// 兼容不同浏览器的URL对象
|
||||||
|
const url = window.URL || window.webkitURL || window.moxURL
|
||||||
|
link.href = url.createObjectURL(blob)
|
||||||
|
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
document.body.removeChild(link)
|
||||||
|
url.revokeObjectURL(link.href)//移除url对象
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
ElMessage.error('下载文件失败')
|
||||||
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
ElMessage.error('导出失败')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.el-pagination {
|
.content {
|
||||||
padding-left: 5px;
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row .el-button {
|
.work-area {
|
||||||
width: 72px;
|
width: 100%;
|
||||||
margin-left: 0px;
|
/* padding: 5px; */
|
||||||
margin-right: 5px;
|
}
|
||||||
|
|
||||||
|
.search-area {
|
||||||
|
margin: auto;
|
||||||
|
min-height: fit-content;
|
||||||
|
max-height: 40%;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
min-width: inherit;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
|
overflow: auto;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-area {
|
||||||
|
margin: auto;
|
||||||
|
min-height: fit-content;
|
||||||
|
max-height: 60%;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
min-width: inherit;
|
||||||
|
border: solid 1px;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
|
overflow: auto;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item {
|
||||||
|
margin: 5px 5px 5px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item .el-input {
|
||||||
|
width: 196px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item .el-input-number {
|
||||||
|
width: 196px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item .el-select-v2 {
|
||||||
|
width: 196px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-class {
|
.table-class {
|
||||||
width: 100%;
|
margin: 5px 5px 5px 5px;
|
||||||
|
width: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-pagination {
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-autocomplete li {
|
||||||
|
width: 196px;
|
||||||
|
line-height: normal;
|
||||||
|
padding: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-autocomplete li .name {
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-autocomplete li .addr {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #b4b4b4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-autocomplete li .highlighted .addr {
|
||||||
|
color: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-autocomplete li .goods_id {
|
||||||
|
color: brown;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-autocomplete li .goods_name {
|
||||||
|
color: cornflowerblue;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-search {
|
||||||
|
height: 30px;
|
||||||
|
width: 80px;
|
||||||
|
margin: auto 5px 5px auto;
|
||||||
|
color: black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,84 +1,95 @@
|
||||||
<template>
|
<template>
|
||||||
<el-config-provider :locale="zhCn">
|
<el-config-provider :locale="zhCn">
|
||||||
<el-container class="content">
|
<el-container class="content">
|
||||||
<div class="work-area">
|
<div class="work-area">
|
||||||
<fieldset class="search-area">
|
<fieldset class="search-area">
|
||||||
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
<el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
|
||||||
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-input v-model="searchQueryFormEntity.goodsId" clearable />
|
<el-input v-model="searchQueryFormEntity.goodsId" clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="载具号">
|
<el-form-item label="载具号">
|
||||||
<el-input v-model="searchQueryFormEntity.vehicleId" clearable />
|
<el-input v-model="searchQueryFormEntity.vehicleId" clearable/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
<el-form-item label="创建时间from">
|
||||||
<div style="align-content: center;">
|
<el-date-picker v-model="searchQueryFormEntity.fromTime" type="datetime"
|
||||||
<el-row>
|
placeholder="请选择from时间" :shortcuts="shortcuts"
|
||||||
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
style="width: 196px;" clearable/>
|
||||||
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
</el-form-item>
|
||||||
</el-row>
|
<el-form-item label="创建时间to">
|
||||||
<el-row>
|
<el-date-picker v-model="searchQueryFormEntity.toTime" type="datetime"
|
||||||
<el-button type="success" class="btn-search"
|
placeholder="请选择to时间" :shortcuts="shortcuts"
|
||||||
@click="exportExcel()">导出excel</el-button>
|
style="width: 196px;" clearable/>
|
||||||
</el-row>
|
</el-form-item>
|
||||||
</div>
|
</el-row>
|
||||||
</div>
|
<div style="align-content: center;">
|
||||||
</el-form>
|
<el-row>
|
||||||
</fieldset>
|
<el-button type="primary" class="btn-search" @click="search()">查询</el-button>
|
||||||
<div class="table-area">
|
<el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
|
||||||
<el-table :data="tableData" stripe border v-loading="tableLoading" class="table-class"
|
</el-row>
|
||||||
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
<el-row>
|
||||||
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
<el-button type="success" class="btn-search"
|
||||||
@sort-change="handleSortChange">
|
@click="exportExcel()">导出excel
|
||||||
<el-table-column width="65px" fixed="left">
|
</el-button>
|
||||||
<template v-slot="scope">
|
</el-row>
|
||||||
<el-radio :label="scope.row.updateId" v-model="updateId"> </el-radio>
|
</div>
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="updateId" label="数据编号" fixed="left" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="goodsId" label="料号" fixed="left" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="firstInTime" label="初次入库时间" :formatter="timeFormat" min-width="120px"
|
|
||||||
sortable="custom" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="beforeNum" label="原数量" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="afterNum" label="新数量" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="reason" label="原因" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
<el-table-column prop="updateTime" label="更新时间" :formatter="timeFormat" min-width="120px"
|
|
||||||
sortable="custom" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="updateUser" label="更新用户" min-width="120px" sortable="custom"
|
|
||||||
show-overflow-tooltip />
|
|
||||||
</el-table>
|
|
||||||
<br />
|
|
||||||
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
|
||||||
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
|
||||||
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
|
||||||
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
:total="baseTableQuery.total" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</el-container>
|
</el-form>
|
||||||
</el-config-provider>
|
</fieldset>
|
||||||
|
<div class="table-area">
|
||||||
|
<el-table :data="tableData" stripe border v-loading="tableLoading" class="table-class"
|
||||||
|
:max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
|
||||||
|
:header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
||||||
|
@sort-change="handleSortChange">
|
||||||
|
<el-table-column width="65px" fixed="left">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-radio :label="scope.row.updateId" v-model="updateId"> </el-radio>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="updateId" label="数据编号" fixed="left" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="goodsId" label="料号" fixed="left" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="vehicleId" label="箱号" fixed="left" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="firstInTime" label="初次入库时间" :formatter="timeFormat" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="beforeNum" label="原数量" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="afterNum" label="新数量" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="reason" label="原因" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="updateTime" label="更新时间" :formatter="timeFormat" min-width="120px"
|
||||||
|
sortable="custom" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="updateUser" label="更新用户" min-width="120px" sortable="custom"
|
||||||
|
show-overflow-tooltip/>
|
||||||
|
</el-table>
|
||||||
|
<br/>
|
||||||
|
<el-pagination v-model:current-page="baseTableQuery.currentPage"
|
||||||
|
v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
|
||||||
|
:disabled="false" :background="false" :default-page-size="10" @size-change="search"
|
||||||
|
@current-change="search" layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="baseTableQuery.total"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-container>
|
||||||
|
</el-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||||
import { queryStockUpdateByPage } from '@/api/stock.js'
|
import {queryStockUpdateByPage} from '@/api/stock.js'
|
||||||
import { dateFormatter, timeFormatter } from '@/utils/formatter.js'
|
import {dateFormatter, timeFormatter} from '@/utils/formatter.js'
|
||||||
import { ref, reactive, onMounted, nextTick, onBeforeUnmount } from 'vue'
|
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import {ElMessage} from 'element-plus'
|
||||||
import { genTableRequest } from '@/utils/generator.js'
|
import {genTableRequest} from '@/utils/generator.js'
|
||||||
import { labelPosition } from '@/constant/form.js'
|
import {labelPosition, shortcuts} from '@/constant/form.js'
|
||||||
import { loading } from '@/utils/loading'
|
import {exportStockUpdateExcel} from '@/api/excel.js'
|
||||||
import { exportStockUpdateExcel } from '@/api/excel.js'
|
|
||||||
/**
|
/**
|
||||||
* 常量定义
|
* 常量定义
|
||||||
*/
|
*/
|
||||||
|
|
@ -91,16 +102,18 @@ let maxHeight = ref(window.innerHeight * 0.55)
|
||||||
let tableLoading = ref(false)
|
let tableLoading = ref(false)
|
||||||
let tableData = ref([])
|
let tableData = ref([])
|
||||||
let baseTableQuery = reactive({
|
let baseTableQuery = reactive({
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
sortBy: new Map([['updateTime', false]]),// 按照成品号顺序排序
|
sortBy: new Map([['updateTime', false]]),// 按照成品号顺序排序
|
||||||
standId: STAND_ID,
|
standId: STAND_ID,
|
||||||
userName: USER_NAME
|
userName: USER_NAME
|
||||||
})
|
})
|
||||||
let searchQueryFormEntity = reactive({
|
let searchQueryFormEntity = reactive({
|
||||||
vehicleId: '',
|
vehicleId: '',
|
||||||
goodsId: ''
|
goodsId: '',
|
||||||
|
fromTime: null,
|
||||||
|
toTime: null
|
||||||
})
|
})
|
||||||
let searchQueryFormRef = ref()
|
let searchQueryFormRef = ref()
|
||||||
let updateId = ''
|
let updateId = ''
|
||||||
|
|
@ -108,262 +121,199 @@ let updateId = ''
|
||||||
* 系统方法
|
* 系统方法
|
||||||
*/
|
*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
window.addEventListener('resize', resizeHeight)
|
window.addEventListener('resize', resizeHeight)
|
||||||
search()
|
search()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
window.removeEventListener('resize', resizeHeight)
|
window.removeEventListener('resize', resizeHeight)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
const resizeHeight = () => {
|
const resizeHeight = () => {
|
||||||
maxHeight.value = window.innerHeight * 0.55
|
maxHeight.value = window.innerHeight * 0.55
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 自定义方法
|
* 自定义方法
|
||||||
*/
|
*/
|
||||||
// 查询
|
// 查询
|
||||||
const search = () => {
|
const search = () => {
|
||||||
tableLoading.value = true
|
tableLoading.value = true
|
||||||
let request = genTableRequest(baseTableQuery)
|
let request = genTableRequest(baseTableQuery)
|
||||||
// 设定查询参数
|
// 设定查询参数
|
||||||
request.goodsId = searchQueryFormEntity.goodsId.trim()
|
request.goodsId = searchQueryFormEntity.goodsId.trim()
|
||||||
request.vehicleId = searchQueryFormEntity.vehicleId.trim()
|
request.vehicleId = searchQueryFormEntity.vehicleId.trim()
|
||||||
queryStockUpdateByPage(request).then((res) => {
|
request.fromTime = searchQueryFormEntity.fromTime == null ? null : timeFormatter(searchQueryFormEntity.fromTime)
|
||||||
const response = res.data
|
request.toTime = searchQueryFormEntity.toTime == null ? null : timeFormatter(searchQueryFormEntity.toTime)
|
||||||
if (response.code == 0) {
|
queryStockUpdateByPage(request).then((res) => {
|
||||||
const data = response.data
|
const response = res.data
|
||||||
if (data != null) {
|
if (response.code === 0) {
|
||||||
tableData.value = data.lists
|
const data = response.data
|
||||||
baseTableQuery.total = data.total
|
if (data != null) {
|
||||||
} else {
|
tableData.value = data.lists
|
||||||
tableData.value = []
|
baseTableQuery.total = data.total
|
||||||
baseTableQuery.total = 0
|
} else {
|
||||||
}
|
tableData.value = []
|
||||||
} else {
|
baseTableQuery.total = 0
|
||||||
ElMessage.error(response.message)
|
}
|
||||||
}
|
} else {
|
||||||
}).catch(err => {
|
ElMessage.error(response.message)
|
||||||
console.log(err)
|
}
|
||||||
ElMessage.error('查询数据异常。')
|
}).catch(err => {
|
||||||
}).finally(() => {
|
console.log(err)
|
||||||
tableLoading.value = false
|
ElMessage.error('查询数据异常。')
|
||||||
})
|
}).finally(() => {
|
||||||
|
tableLoading.value = false
|
||||||
|
})
|
||||||
}
|
}
|
||||||
const clearQuery = () => {
|
const clearQuery = () => {
|
||||||
searchQueryFormEntity.goodsId = ''
|
searchQueryFormEntity.goodsId = ''
|
||||||
searchQueryFormEntity.vehicleId = ''
|
searchQueryFormEntity.vehicleId = ''
|
||||||
}
|
}
|
||||||
const handleSortChange = (data) => {
|
const handleSortChange = (data) => {
|
||||||
if (baseTableQuery.sortBy.has(data.prop)) {
|
if (baseTableQuery.sortBy.has(data.prop)) {
|
||||||
baseTableQuery.sortBy.delete(data.prop)
|
baseTableQuery.sortBy.delete(data.prop)
|
||||||
}
|
}
|
||||||
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
|
||||||
search()
|
search()
|
||||||
}
|
}
|
||||||
const getCurrentRow = (row) => {
|
const getCurrentRow = (row) => {
|
||||||
updateId = row.updateId
|
updateId = row.updateId
|
||||||
}
|
}
|
||||||
const timeFormat = (row, column, cellValue, index) => {
|
const timeFormat = (row, column, cellValue, index) => {
|
||||||
return timeFormatter(cellValue)
|
return timeFormatter(cellValue)
|
||||||
}
|
}
|
||||||
const exportExcel = () => {
|
const exportExcel = () => {
|
||||||
const params = {
|
const params = {
|
||||||
goodsId: searchQueryFormEntity.goodsId.trim(),
|
goodsId: searchQueryFormEntity.goodsId.trim(),
|
||||||
vehicleId: searchQueryFormEntity.vehicleId.trim(),
|
vehicleId: searchQueryFormEntity.vehicleId.trim(),
|
||||||
standId: STAND_ID,
|
fromTime: searchQueryFormEntity.fromTime == null ? null : timeFormatter(searchQueryFormEntity.fromTime),
|
||||||
userName: USER_NAME
|
toTime: searchQueryFormEntity.toTime == null ? null : timeFormatter(searchQueryFormEntity.toTime),
|
||||||
}
|
standId: STAND_ID,
|
||||||
exportStockUpdateExcel(params).then(res => {
|
userName: USER_NAME
|
||||||
const link = document.createElement('a');//创建a标签
|
}
|
||||||
try {
|
exportStockUpdateExcel(params).then(res => {
|
||||||
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
const link = document.createElement('a');//创建a标签
|
||||||
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
try {
|
||||||
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
// let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'}); //如果后台返回的不是blob对象类型,先定义成blob对象格式,该type导出为xls格式,
|
||||||
let _fileName = '库存更新记录' + dateFormatter(new Date) + '.xlsx'
|
let blob = res.data //如果后台返回的直接是blob对象类型,直接获取数据
|
||||||
link.style.display = 'none'//隐藏
|
// let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名,如果后端有给返回文件名的话
|
||||||
|
let _fileName = '库存更新记录' + dateFormatter(new Date) + '.xlsx'
|
||||||
|
link.style.display = 'none'//隐藏
|
||||||
|
|
||||||
// 兼容不同浏览器的URL对象
|
// 兼容不同浏览器的URL对象
|
||||||
const url = window.URL || window.webkitURL || window.moxURL
|
const url = window.URL || window.webkitURL || window.moxURL
|
||||||
link.href = url.createObjectURL(blob)
|
link.href = url.createObjectURL(blob)
|
||||||
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
|
||||||
document.body.appendChild(link)
|
document.body.appendChild(link)
|
||||||
link.click()
|
link.click()
|
||||||
document.body.removeChild(link)
|
document.body.removeChild(link)
|
||||||
url.revokeObjectURL(link.href)//移除url对象
|
url.revokeObjectURL(link.href)//移除url对象
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
ElMessage.error('下载文件失败')
|
ElMessage.error('下载文件失败')
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
ElMessage.error('导出失败')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 编辑弹框
|
|
||||||
const editCurrentRowFormEntity = (row) => {
|
|
||||||
// 设置form值
|
|
||||||
rowFormEntity.workIndex = row.workIndex
|
|
||||||
rowFormEntity.workOrder = row.workOrder
|
|
||||||
rowFormEntity.productId = row.productId
|
|
||||||
rowFormEntity.singleProductId = row.singleProductId
|
|
||||||
rowFormEntity.boxNo = row.boxNo
|
|
||||||
rowFormEntity.goodsId = row.goodsId
|
|
||||||
rowFormEntity.needNum = row.needNum
|
|
||||||
rowFormEntity.distributeNum = row.distributeNum
|
|
||||||
rowFormEntity.finishNum = row.finishNum
|
|
||||||
rowFormEntity.workStatus = row.workStatus
|
|
||||||
rowFormEntity.lackStatus = row.lackStatus
|
|
||||||
// 弹出框
|
|
||||||
rowEditFlag.value = true
|
|
||||||
}
|
|
||||||
// 关闭当前缺料工作
|
|
||||||
const closeLackWork = (row) => {
|
|
||||||
const request = {
|
|
||||||
workIndex: row.workIndex,
|
|
||||||
standId: STAND_ID,
|
|
||||||
userName: USER_NAME
|
|
||||||
}
|
}
|
||||||
loading.open('关闭中...')
|
}).catch(err => {
|
||||||
closeCurrentWorks(request).then(res => {
|
console.log(err)
|
||||||
const response = res.data
|
ElMessage.error('导出失败')
|
||||||
if (response.code == 0) {
|
})
|
||||||
ElMessage.success(response.message)
|
|
||||||
search()
|
|
||||||
} else {
|
|
||||||
ElMessage.error(response.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
ElMessage.error('请求异常。')
|
|
||||||
}).finally(() => {
|
|
||||||
loading.close()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 更新当前行数据
|
|
||||||
const submitUpdateRow = (rowFormEntity) => {
|
|
||||||
const request = {
|
|
||||||
workIndex: rowFormEntity.workIndex,
|
|
||||||
distributeNum: rowFormEntity.distributeNum,
|
|
||||||
finishNum: rowFormEntity.finishNum,
|
|
||||||
workStatus: rowFormEntity.workStatus,
|
|
||||||
lackStatus: rowFormEntity.lackStatus,
|
|
||||||
standId: STAND_ID,
|
|
||||||
userName: USER_NAME
|
|
||||||
}
|
|
||||||
loading.open('更新中...')
|
|
||||||
updateKateWorks(request).then(res => {
|
|
||||||
if (res.data.code == 0) {
|
|
||||||
ElMessage.success('更新数据成功。')
|
|
||||||
rowEditFlag.value = false
|
|
||||||
search()
|
|
||||||
} else {
|
|
||||||
ElMessage.error('更新数据失败。')
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
console.log(err)
|
|
||||||
ElMessage.error('更新数据异常。')
|
|
||||||
}).finally(() => {
|
|
||||||
loading.close()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.content {
|
.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.work-area {
|
.work-area {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
/* padding: 5px; */
|
/* padding: 5px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-area {
|
.search-area {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
min-height: fit-content;
|
min-height: fit-content;
|
||||||
max-height: 40%;
|
max-height: 40%;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
min-width: inherit;
|
min-width: inherit;
|
||||||
border: solid 1px;
|
border: solid 1px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-area {
|
.table-area {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
min-height: fit-content;
|
min-height: fit-content;
|
||||||
max-height: 60%;
|
max-height: 60%;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
min-width: inherit;
|
min-width: inherit;
|
||||||
border: solid 1px;
|
border: solid 1px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0px 15px 10px -15px #000;
|
box-shadow: 0px 15px 10px -15px #000;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item {
|
.el-form-item {
|
||||||
margin: 5px 5px 5px 5px;
|
margin: 5px 5px 5px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item .el-input {
|
.el-form-item .el-input {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item .el-input-number {
|
.el-form-item .el-input-number {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-form-item .el-select-v2 {
|
.el-form-item .el-select-v2 {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-class {
|
.table-class {
|
||||||
margin: 5px 5px 5px 5px;
|
margin: 5px 5px 5px 5px;
|
||||||
width: inherit;
|
width: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-pagination {
|
.el-pagination {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li {
|
.my-autocomplete li {
|
||||||
width: 196px;
|
width: 196px;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
padding: 7px;
|
padding: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .name {
|
.my-autocomplete li .name {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .addr {
|
.my-autocomplete li .addr {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #b4b4b4;
|
color: #b4b4b4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .highlighted .addr {
|
.my-autocomplete li .highlighted .addr {
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .goods_id {
|
.my-autocomplete li .goods_id {
|
||||||
color: brown;
|
color: brown;
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-autocomplete li .goods_name {
|
.my-autocomplete li .goods_name {
|
||||||
color: cornflowerblue;
|
color: cornflowerblue;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-search {
|
.btn-search {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
width: 80px;
|
width: 80px;
|
||||||
margin: auto 5px 5px auto;
|
margin: auto 5px 5px auto;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -138,6 +138,15 @@ public class ExcelController {
|
||||||
exportExcelEasyPoi.doExportStocks(stockQuery, response);
|
exportExcelEasyPoi.doExportStocks(stockQuery, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出物料基础信息
|
||||||
|
* @param goodsQuery 请求
|
||||||
|
*/
|
||||||
|
@PostMapping("/exportGoodsExcel")
|
||||||
|
public void exportGoodsExcel(@RequestBody GoodsQuery goodsQuery, HttpServletResponse response) throws IOException {
|
||||||
|
exportExcelEasyPoi.doExportGoods(goodsQuery, response);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出库存更新记录
|
* 导出库存更新记录
|
||||||
* @param stockUpdateQuery 请求
|
* @param stockUpdateQuery 请求
|
||||||
|
|
@ -153,7 +162,7 @@ public class ExcelController {
|
||||||
*/
|
*/
|
||||||
@PostMapping("/exportWorkSummaryExcel")
|
@PostMapping("/exportWorkSummaryExcel")
|
||||||
public void exportWorkSummaryExcel(@RequestBody WorkSummaryQuery workSummaryQuery, HttpServletResponse response) throws IOException {
|
public void exportWorkSummaryExcel(@RequestBody WorkSummaryQuery workSummaryQuery, HttpServletResponse response) throws IOException {
|
||||||
exportExcelEasyPoi.exportWorkSummaryExcel(workSummaryQuery, response);
|
exportExcelEasyPoi.doExportWorkSummaryExcel(workSummaryQuery, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -162,6 +171,24 @@ public class ExcelController {
|
||||||
*/
|
*/
|
||||||
@PostMapping("/exportKanbanExcel")
|
@PostMapping("/exportKanbanExcel")
|
||||||
public void exportKanbanExcel(@RequestBody KanbanQuery kanbanQuery, HttpServletResponse response) throws IOException {
|
public void exportKanbanExcel(@RequestBody KanbanQuery kanbanQuery, HttpServletResponse response) throws IOException {
|
||||||
exportExcelEasyPoi.exportKanbanExcel(kanbanQuery, response);
|
exportExcelEasyPoi.doExportKanbanExcel(kanbanQuery, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出入库记录
|
||||||
|
* @param wmsTaskQuery 请求
|
||||||
|
*/
|
||||||
|
@PostMapping("/exportInTaskRecordExcel")
|
||||||
|
public void exportInTaskRecordExcel(@RequestBody WmsTaskQuery wmsTaskQuery, HttpServletResponse response) throws IOException {
|
||||||
|
exportExcelEasyPoi.doExportInTaskRecords(wmsTaskQuery, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出出库记录
|
||||||
|
* @param wmsTaskQuery 请求
|
||||||
|
*/
|
||||||
|
@PostMapping("/exportOutTaskRecordExcel")
|
||||||
|
public void exportOutTaskRecordExcel(@RequestBody WmsTaskQuery wmsTaskQuery, HttpServletResponse response) throws IOException {
|
||||||
|
exportExcelEasyPoi.doExportOutTaskRecords(wmsTaskQuery, response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.wms_main.controller.wms;
|
||||||
import com.wms_main.model.dto.query.WmsTaskQuery;
|
import com.wms_main.model.dto.query.WmsTaskQuery;
|
||||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
import com.wms_main.model.vo.wms.PageVo;
|
import com.wms_main.model.vo.wms.PageVo;
|
||||||
|
import com.wms_main.model.vo.wms.TaskRecordVo;
|
||||||
import com.wms_main.model.vo.wms.TaskVo;
|
import com.wms_main.model.vo.wms.TaskVo;
|
||||||
import com.wms_main.service.controller.ITaskQueryControllerService;
|
import com.wms_main.service.controller.ITaskQueryControllerService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
@ -30,4 +31,26 @@ public class TaskQueryController {
|
||||||
{
|
{
|
||||||
return taskQueryControllerService.queryTasksByPage(wmsTaskQuery);
|
return taskQueryControllerService.queryTasksByPage(wmsTaskQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wms入库记录查询
|
||||||
|
* @param wmsTaskQuery 查询参数
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/queryInTaskRecordByPage")
|
||||||
|
public WmsApiResponse<PageVo<TaskRecordVo>> queryInTaskRecordByPage(@RequestBody WmsTaskQuery wmsTaskQuery)
|
||||||
|
{
|
||||||
|
return taskQueryControllerService.queryInTaskRecordByPage(wmsTaskQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wms出库记录查询
|
||||||
|
* @param wmsTaskQuery 查询参数
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/queryOutTaskRecordByPage")
|
||||||
|
public WmsApiResponse<PageVo<TaskRecordVo>> queryOutTaskRecordByPage(@RequestBody WmsTaskQuery wmsTaskQuery)
|
||||||
|
{
|
||||||
|
return taskQueryControllerService.queryOutTaskRecordByPage(wmsTaskQuery);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,102 @@
|
||||||
|
package com.wms_main.excel.easypoi.excelTemplate;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务记录模版
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TaskRecordExcelTemplate {
|
||||||
|
/**
|
||||||
|
* 任务ID
|
||||||
|
*/
|
||||||
|
@Excel(name = "任务Id")
|
||||||
|
private String taskId;
|
||||||
|
/**
|
||||||
|
* 任务类型
|
||||||
|
*/
|
||||||
|
@Excel(name = "任务类型")
|
||||||
|
private Integer taskType;
|
||||||
|
/**
|
||||||
|
* 任务状态
|
||||||
|
*/
|
||||||
|
@Excel(name = "任务状态")
|
||||||
|
private Integer taskStatus;
|
||||||
|
/**
|
||||||
|
* 任务优先级
|
||||||
|
*/
|
||||||
|
@Excel(name = "任务优先级")
|
||||||
|
private Integer taskPriority;
|
||||||
|
/**
|
||||||
|
* 载具号
|
||||||
|
*/
|
||||||
|
@Excel(name = "载具号")
|
||||||
|
private String vehicleId;
|
||||||
|
/**
|
||||||
|
* 起点
|
||||||
|
*/
|
||||||
|
@Excel(name = "起点")
|
||||||
|
private String origin;
|
||||||
|
/**
|
||||||
|
* 终点
|
||||||
|
*/
|
||||||
|
@Excel(name = "终点")
|
||||||
|
private String destination;
|
||||||
|
/**
|
||||||
|
* wcs任务id
|
||||||
|
*/
|
||||||
|
@Excel(name = "wcs任务Id")
|
||||||
|
private String wcsTaskId;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
/**
|
||||||
|
* 完成时间
|
||||||
|
*/
|
||||||
|
@Excel(name = "完成时间", format = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime finishTime;
|
||||||
|
/**
|
||||||
|
* 料号
|
||||||
|
*/
|
||||||
|
@Excel(name = "料号")
|
||||||
|
private String goodsId;
|
||||||
|
/**
|
||||||
|
* 操作数量
|
||||||
|
*/
|
||||||
|
@Excel(name = "操作数量")
|
||||||
|
private Integer opNum;
|
||||||
|
/**
|
||||||
|
* 库存数量
|
||||||
|
*/
|
||||||
|
@Excel(name = "库存数量")
|
||||||
|
private Integer stockNum;
|
||||||
|
/**
|
||||||
|
* 操纵用户
|
||||||
|
*/
|
||||||
|
@Excel(name = "操作用户")
|
||||||
|
private String opUser;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@Excel(name = "备注")
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 申请出库的站台
|
||||||
|
*/
|
||||||
|
@Excel(name = "申请站台")
|
||||||
|
private String callStand;
|
||||||
|
/**
|
||||||
|
* 物料描述
|
||||||
|
*/
|
||||||
|
@Excel(name = "物料描述")
|
||||||
|
private String goodsDesc;
|
||||||
|
}
|
||||||
|
|
@ -33,11 +33,11 @@ public interface IExportExcelEasyPoi extends IBaseExportExcelEasyPoi {
|
||||||
* 导出工作详情
|
* 导出工作详情
|
||||||
* @param workSummaryQuery 查询条件
|
* @param workSummaryQuery 查询条件
|
||||||
*/
|
*/
|
||||||
void exportWorkSummaryExcel(@RequestBody WorkSummaryQuery workSummaryQuery, HttpServletResponse response) throws IOException;
|
void doExportWorkSummaryExcel(@RequestBody WorkSummaryQuery workSummaryQuery, HttpServletResponse response) throws IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出看板需求
|
* 导出看板需求
|
||||||
* @param kanbanQuery 查询条件
|
* @param kanbanQuery 查询条件
|
||||||
*/
|
*/
|
||||||
void exportKanbanExcel(@RequestBody KanbanQuery kanbanQuery, HttpServletResponse response) throws IOException;
|
void doExportKanbanExcel(@RequestBody KanbanQuery kanbanQuery, HttpServletResponse response) throws IOException;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
package com.wms_main.excel.easypoi.service.base;
|
package com.wms_main.excel.easypoi.service.base;
|
||||||
|
|
||||||
|
import com.wms_main.model.dto.query.GoodsQuery;
|
||||||
import com.wms_main.model.dto.query.StockQuery;
|
import com.wms_main.model.dto.query.StockQuery;
|
||||||
import com.wms_main.model.dto.query.StockUpdateQuery;
|
import com.wms_main.model.dto.query.StockUpdateQuery;
|
||||||
|
import com.wms_main.model.dto.query.WmsTaskQuery;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
|
@ -22,4 +24,22 @@ public interface IBaseExportExcelEasyPoi {
|
||||||
* @param stockUpdateQuery 查询条件
|
* @param stockUpdateQuery 查询条件
|
||||||
*/
|
*/
|
||||||
void doExportStockUpdate(@RequestBody StockUpdateQuery stockUpdateQuery, HttpServletResponse response) throws IOException;
|
void doExportStockUpdate(@RequestBody StockUpdateQuery stockUpdateQuery, HttpServletResponse response) throws IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出物料信息
|
||||||
|
* @param goodsQuery 查询
|
||||||
|
*/
|
||||||
|
void doExportGoods(@RequestBody GoodsQuery goodsQuery, HttpServletResponse response) throws IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出入库记录
|
||||||
|
* @param wmsTaskQuery 查询
|
||||||
|
*/
|
||||||
|
void doExportInTaskRecords(@RequestBody WmsTaskQuery wmsTaskQuery, HttpServletResponse response) throws IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出出库记录
|
||||||
|
* @param wmsTaskQuery 查询
|
||||||
|
*/
|
||||||
|
void doExportOutTaskRecords(@RequestBody WmsTaskQuery wmsTaskQuery, HttpServletResponse response) throws IOException;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,24 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.wms_main.constant.enums.wms.WmsTaskTypeEnums;
|
||||||
|
import com.wms_main.dao.ITAppGoodsService;
|
||||||
import com.wms_main.dao.ITAppStockService;
|
import com.wms_main.dao.ITAppStockService;
|
||||||
import com.wms_main.dao.ITAppStockUpdateService;
|
import com.wms_main.dao.ITAppStockUpdateService;
|
||||||
|
import com.wms_main.dao.ITAppTaskBakService;
|
||||||
|
import com.wms_main.excel.easypoi.excelTemplate.GoodsExcelTemplate;
|
||||||
import com.wms_main.excel.easypoi.excelTemplate.StockExcelTemplate;
|
import com.wms_main.excel.easypoi.excelTemplate.StockExcelTemplate;
|
||||||
import com.wms_main.excel.easypoi.excelTemplate.StockUpdateExcelTemplate;
|
import com.wms_main.excel.easypoi.excelTemplate.StockUpdateExcelTemplate;
|
||||||
|
import com.wms_main.excel.easypoi.excelTemplate.TaskRecordExcelTemplate;
|
||||||
import com.wms_main.excel.easypoi.service.base.IBaseExportExcelEasyPoi;
|
import com.wms_main.excel.easypoi.service.base.IBaseExportExcelEasyPoi;
|
||||||
|
import com.wms_main.model.dto.query.GoodsQuery;
|
||||||
import com.wms_main.model.dto.query.StockQuery;
|
import com.wms_main.model.dto.query.StockQuery;
|
||||||
import com.wms_main.model.dto.query.StockUpdateQuery;
|
import com.wms_main.model.dto.query.StockUpdateQuery;
|
||||||
|
import com.wms_main.model.dto.query.WmsTaskQuery;
|
||||||
|
import com.wms_main.model.po.TAppGoods;
|
||||||
import com.wms_main.model.po.TAppStock;
|
import com.wms_main.model.po.TAppStock;
|
||||||
import com.wms_main.model.po.TAppStockUpdate;
|
import com.wms_main.model.po.TAppStockUpdate;
|
||||||
|
import com.wms_main.model.po.TAppTaskBak;
|
||||||
import com.wms_main.repository.utils.StringUtils;
|
import com.wms_main.repository.utils.StringUtils;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -34,6 +43,10 @@ public class BaseExportExcelEasyPoi implements IBaseExportExcelEasyPoi {
|
||||||
protected ITAppStockService appStockService;// 库存服务
|
protected ITAppStockService appStockService;// 库存服务
|
||||||
@Autowired
|
@Autowired
|
||||||
protected ITAppStockUpdateService appStockUpdateService;// 库存更新服务
|
protected ITAppStockUpdateService appStockUpdateService;// 库存更新服务
|
||||||
|
@Autowired
|
||||||
|
protected ITAppGoodsService appGoodsService;// 物料服务
|
||||||
|
@Autowired
|
||||||
|
protected ITAppTaskBakService appTaskBakService;// 任务记录服务
|
||||||
|
|
||||||
public BaseExportExcelEasyPoi() {
|
public BaseExportExcelEasyPoi() {
|
||||||
|
|
||||||
|
|
@ -105,10 +118,22 @@ public class BaseExportExcelEasyPoi implements IBaseExportExcelEasyPoi {
|
||||||
if (stockUpdateQuery == null) {
|
if (stockUpdateQuery == null) {
|
||||||
throw new IOException("查询参数不能为NULL");
|
throw new IOException("查询参数不能为NULL");
|
||||||
}
|
}
|
||||||
|
// 查询参数
|
||||||
|
if (stockUpdateQuery.getFromTime() != null && stockUpdateQuery.getToTime() != null) {
|
||||||
|
if (stockUpdateQuery.getFromTime().isAfter(stockUpdateQuery.getToTime())) {
|
||||||
|
throw new IOException("from时间不能晚于to时间");
|
||||||
|
}
|
||||||
|
}
|
||||||
// 库存更新记录查询参数
|
// 库存更新记录查询参数
|
||||||
LambdaQueryWrapper<TAppStockUpdate> lambdaQueryWrapper = new LambdaQueryWrapper<TAppStockUpdate>()
|
LambdaQueryWrapper<TAppStockUpdate> lambdaQueryWrapper = new LambdaQueryWrapper<TAppStockUpdate>()
|
||||||
.like(StringUtils.isNotEmpty(stockUpdateQuery.getGoodsId()), TAppStockUpdate::getGoodsId, stockUpdateQuery.getGoodsId())
|
.like(StringUtils.isNotEmpty(stockUpdateQuery.getGoodsId()), TAppStockUpdate::getGoodsId, stockUpdateQuery.getGoodsId())
|
||||||
.like(StringUtils.isNotEmpty(stockUpdateQuery.getVehicleId()), TAppStockUpdate::getVehicleId, stockUpdateQuery.getVehicleId());
|
.like(StringUtils.isNotEmpty(stockUpdateQuery.getVehicleId()), TAppStockUpdate::getVehicleId, stockUpdateQuery.getVehicleId());
|
||||||
|
if (stockUpdateQuery.getFromTime() != null) {
|
||||||
|
lambdaQueryWrapper.ge(TAppStockUpdate::getUpdateTime, stockUpdateQuery.getFromTime());
|
||||||
|
}
|
||||||
|
if (stockUpdateQuery.getToTime() != null) {
|
||||||
|
lambdaQueryWrapper.le(TAppStockUpdate::getUpdateTime, stockUpdateQuery.getToTime());
|
||||||
|
}
|
||||||
List<TAppStockUpdate> stockUpdateList = appStockUpdateService.list(lambdaQueryWrapper);
|
List<TAppStockUpdate> stockUpdateList = appStockUpdateService.list(lambdaQueryWrapper);
|
||||||
// excel模版列表
|
// excel模版列表
|
||||||
List<StockUpdateExcelTemplate> resultList = new ArrayList<>();
|
List<StockUpdateExcelTemplate> resultList = new ArrayList<>();
|
||||||
|
|
@ -132,6 +157,162 @@ public class BaseExportExcelEasyPoi implements IBaseExportExcelEasyPoi {
|
||||||
doWriteExcel("库存更新记录", response, resultList, StockUpdateExcelTemplate.class);
|
doWriteExcel("库存更新记录", response, resultList, StockUpdateExcelTemplate.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出物料信息--实现
|
||||||
|
* @param goodsQuery 查询
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void doExportGoods(GoodsQuery goodsQuery, HttpServletResponse response) throws IOException {
|
||||||
|
if (goodsQuery == null) {
|
||||||
|
throw new IOException("查询参数不能为NULL");
|
||||||
|
}
|
||||||
|
// 查询参数
|
||||||
|
LambdaQueryWrapper<TAppGoods> lambdaQueryWrapper = new LambdaQueryWrapper<TAppGoods>()
|
||||||
|
.like(StringUtils.isNotEmpty(goodsQuery.getGoodsId()), TAppGoods::getGoodsId, goodsQuery.getGoodsId())
|
||||||
|
.like(StringUtils.isNotEmpty(goodsQuery.getGoodsDesc()), TAppGoods::getGoodsDescription, goodsQuery.getGoodsDesc());
|
||||||
|
List<TAppGoods> baseGoodsList = appGoodsService.list(lambdaQueryWrapper);
|
||||||
|
// excel模版列表
|
||||||
|
List<GoodsExcelTemplate> resultList = new ArrayList<>();
|
||||||
|
if (!baseGoodsList.isEmpty()) {
|
||||||
|
for (TAppGoods poData : baseGoodsList) {
|
||||||
|
resultList.add(new GoodsExcelTemplate(
|
||||||
|
poData.getPlant(),
|
||||||
|
poData.getGoodsId(),
|
||||||
|
poData.getGoodsDescription(),
|
||||||
|
poData.getVendorName(),
|
||||||
|
poData.getFeedingType(),
|
||||||
|
poData.getMaxBoxNum(),
|
||||||
|
poData.getBoxQty(),
|
||||||
|
poData.getHotPoint(),
|
||||||
|
poData.getPutArea(),
|
||||||
|
poData.getIsSled(),
|
||||||
|
poData.getSledDays()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resultList.add(new GoodsExcelTemplate());
|
||||||
|
}
|
||||||
|
doWriteExcel("物料基础信息", response, resultList, GoodsExcelTemplate.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出入库记录
|
||||||
|
* @param wmsTaskQuery 查询
|
||||||
|
* @param response 响应
|
||||||
|
* @throws IOException 异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void doExportInTaskRecords(WmsTaskQuery wmsTaskQuery, HttpServletResponse response) throws IOException {
|
||||||
|
if (wmsTaskQuery == null) {
|
||||||
|
throw new IOException("查询参数不能为NULL");
|
||||||
|
}
|
||||||
|
// 查询参数
|
||||||
|
if (wmsTaskQuery.getFromTime() != null && wmsTaskQuery.getToTime() != null) {
|
||||||
|
if (wmsTaskQuery.getFromTime().isAfter(wmsTaskQuery.getToTime())) {
|
||||||
|
throw new IOException("from时间不能晚于to时间");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<TAppTaskBak> lambdaQueryWrapper = new LambdaQueryWrapper<TAppTaskBak>()
|
||||||
|
.like(StringUtils.isNotEmpty(wmsTaskQuery.getTaskId()), TAppTaskBak::getTaskId, wmsTaskQuery.getTaskId())
|
||||||
|
.like(StringUtils.isNotEmpty(wmsTaskQuery.getGoodsId()), TAppTaskBak::getGoodsId, wmsTaskQuery.getGoodsId())
|
||||||
|
.like(StringUtils.isNotEmpty(wmsTaskQuery.getVehicleId()), TAppTaskBak::getVehicleId, wmsTaskQuery.getVehicleId())
|
||||||
|
.eq(TAppTaskBak::getTaskType, WmsTaskTypeEnums.IN.getCode());
|
||||||
|
if (wmsTaskQuery.getFromTime() != null) {
|
||||||
|
lambdaQueryWrapper.ge(TAppTaskBak::getCreateTime, wmsTaskQuery.getFromTime());
|
||||||
|
}
|
||||||
|
if (wmsTaskQuery.getToTime() != null) {
|
||||||
|
lambdaQueryWrapper.le(TAppTaskBak::getCreateTime, wmsTaskQuery.getToTime());
|
||||||
|
}
|
||||||
|
List<TAppTaskBak> inTaskRecordList = appTaskBakService.list(lambdaQueryWrapper);
|
||||||
|
// excel模版列表
|
||||||
|
List<TaskRecordExcelTemplate> resultList = new ArrayList<>();
|
||||||
|
if (!inTaskRecordList.isEmpty()) {
|
||||||
|
for (TAppTaskBak poData : inTaskRecordList) {
|
||||||
|
resultList.add(new TaskRecordExcelTemplate(
|
||||||
|
poData.getTaskId(),
|
||||||
|
poData.getTaskType(),
|
||||||
|
poData.getTaskStatus(),
|
||||||
|
poData.getTaskPriority(),
|
||||||
|
poData.getVehicleId(),
|
||||||
|
poData.getOrigin(),
|
||||||
|
poData.getDestination(),
|
||||||
|
poData.getWcsTaskId(),
|
||||||
|
poData.getCreateTime(),
|
||||||
|
poData.getFinishTime(),
|
||||||
|
poData.getGoodsId(),
|
||||||
|
poData.getOpNum(),
|
||||||
|
poData.getStockNum(),
|
||||||
|
poData.getOpUser(),
|
||||||
|
poData.getRemark(),
|
||||||
|
poData.getCallStand(),
|
||||||
|
poData.getGoodsDesc()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resultList.add(new TaskRecordExcelTemplate());
|
||||||
|
}
|
||||||
|
doWriteExcel("入库记录", response, resultList, TaskRecordExcelTemplate.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出出库任务记录--实现
|
||||||
|
* @param wmsTaskQuery 查询
|
||||||
|
* @param response 响应
|
||||||
|
* @throws IOException 异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void doExportOutTaskRecords(WmsTaskQuery wmsTaskQuery, HttpServletResponse response) throws IOException {
|
||||||
|
if (wmsTaskQuery == null) {
|
||||||
|
throw new IOException("查询参数不能为NULL");
|
||||||
|
}
|
||||||
|
// 查询参数
|
||||||
|
if (wmsTaskQuery.getFromTime() != null && wmsTaskQuery.getToTime() != null) {
|
||||||
|
if (wmsTaskQuery.getFromTime().isAfter(wmsTaskQuery.getToTime())) {
|
||||||
|
throw new IOException("from时间不能晚于to时间");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<TAppTaskBak> lambdaQueryWrapper = new LambdaQueryWrapper<TAppTaskBak>()
|
||||||
|
.like(StringUtils.isNotEmpty(wmsTaskQuery.getTaskId()), TAppTaskBak::getTaskId, wmsTaskQuery.getTaskId())
|
||||||
|
.like(StringUtils.isNotEmpty(wmsTaskQuery.getGoodsId()), TAppTaskBak::getGoodsId, wmsTaskQuery.getGoodsId())
|
||||||
|
.like(StringUtils.isNotEmpty(wmsTaskQuery.getVehicleId()), TAppTaskBak::getVehicleId, wmsTaskQuery.getVehicleId())
|
||||||
|
.eq(TAppTaskBak::getTaskType, WmsTaskTypeEnums.OUT.getCode());
|
||||||
|
if (wmsTaskQuery.getFromTime() != null) {
|
||||||
|
lambdaQueryWrapper.ge(TAppTaskBak::getCreateTime, wmsTaskQuery.getFromTime());
|
||||||
|
}
|
||||||
|
if (wmsTaskQuery.getToTime() != null) {
|
||||||
|
lambdaQueryWrapper.le(TAppTaskBak::getCreateTime, wmsTaskQuery.getToTime());
|
||||||
|
}
|
||||||
|
List<TAppTaskBak> outTaskRecordList = appTaskBakService.list(lambdaQueryWrapper);
|
||||||
|
// excel模版列表
|
||||||
|
List<TaskRecordExcelTemplate> resultList = new ArrayList<>();
|
||||||
|
if (!outTaskRecordList.isEmpty()) {
|
||||||
|
for (TAppTaskBak poData : outTaskRecordList) {
|
||||||
|
resultList.add(new TaskRecordExcelTemplate(
|
||||||
|
poData.getTaskId(),
|
||||||
|
poData.getTaskType(),
|
||||||
|
poData.getTaskStatus(),
|
||||||
|
poData.getTaskPriority(),
|
||||||
|
poData.getVehicleId(),
|
||||||
|
poData.getOrigin(),
|
||||||
|
poData.getDestination(),
|
||||||
|
poData.getWcsTaskId(),
|
||||||
|
poData.getCreateTime(),
|
||||||
|
poData.getFinishTime(),
|
||||||
|
poData.getGoodsId(),
|
||||||
|
poData.getOpNum(),
|
||||||
|
poData.getStockNum(),
|
||||||
|
poData.getOpUser(),
|
||||||
|
poData.getRemark(),
|
||||||
|
poData.getCallStand(),
|
||||||
|
poData.getGoodsDesc()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resultList.add(new TaskRecordExcelTemplate());
|
||||||
|
}
|
||||||
|
doWriteExcel("出库记录", response, resultList, TaskRecordExcelTemplate.class);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 写入excel
|
* 写入excel
|
||||||
* @param fileDesc 文件描述
|
* @param fileDesc 文件描述
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,7 @@ public class ExportExcelEasyPoi extends BaseExportExcelEasyPoi implements IExpor
|
||||||
* @throws IOException 异常
|
* @throws IOException 异常
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void exportWorkSummaryExcel(WorkSummaryQuery workSummaryQuery, HttpServletResponse response) throws IOException {
|
public void doExportWorkSummaryExcel(WorkSummaryQuery workSummaryQuery, HttpServletResponse response) throws IOException {
|
||||||
if (workSummaryQuery == null || workSummaryQuery.getSummaryType() == null) {
|
if (workSummaryQuery == null || workSummaryQuery.getSummaryType() == null) {
|
||||||
throw new IOException("查询参数为空,数据类型必须。");
|
throw new IOException("查询参数为空,数据类型必须。");
|
||||||
}
|
}
|
||||||
|
|
@ -258,7 +258,7 @@ public class ExportExcelEasyPoi extends BaseExportExcelEasyPoi implements IExpor
|
||||||
* @throws IOException 异常
|
* @throws IOException 异常
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void exportKanbanExcel(KanbanQuery kanbanQuery, HttpServletResponse response) throws IOException {
|
public void doExportKanbanExcel(KanbanQuery kanbanQuery, HttpServletResponse response) throws IOException {
|
||||||
if (kanbanQuery == null) {
|
if (kanbanQuery == null) {
|
||||||
throw new IOException("参数不能为空");
|
throw new IOException("参数不能为空");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,14 @@
|
||||||
package com.wms_main.model.dto.query;
|
package com.wms_main.model.dto.query;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 库存更新查询
|
* 库存更新查询
|
||||||
|
|
@ -24,4 +28,18 @@ public class StockUpdateQuery extends PageQuery {
|
||||||
*/
|
*/
|
||||||
@JsonProperty("vehicleId")
|
@JsonProperty("vehicleId")
|
||||||
private String vehicleId;
|
private String vehicleId;
|
||||||
|
/**
|
||||||
|
* 筛选时间从
|
||||||
|
*/
|
||||||
|
@JsonProperty("fromTime")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime fromTime;
|
||||||
|
/**
|
||||||
|
* 筛选时间-至
|
||||||
|
*/
|
||||||
|
@JsonProperty("toTime")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime toTime;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,14 @@
|
||||||
package com.wms_main.model.dto.query;
|
package com.wms_main.model.dto.query;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wms任务查询
|
* wms任务查询
|
||||||
|
|
@ -39,4 +43,18 @@ public class WmsTaskQuery extends PageQuery {
|
||||||
*/
|
*/
|
||||||
@JsonProperty("taskStatus")
|
@JsonProperty("taskStatus")
|
||||||
private Integer taskStatus;
|
private Integer taskStatus;
|
||||||
|
/**
|
||||||
|
* 筛选时间-从
|
||||||
|
*/
|
||||||
|
@JsonProperty("fromTime")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime fromTime;
|
||||||
|
/**
|
||||||
|
* 筛选时间-到
|
||||||
|
*/
|
||||||
|
@JsonProperty("toTime")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime toTime;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.wms_main.model.vo.wms;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.wms_main.model.po.TAppTaskBak;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
@ -105,4 +106,34 @@ public class TaskRecordVo {
|
||||||
*/
|
*/
|
||||||
@JsonProperty("goodsDesc")
|
@JsonProperty("goodsDesc")
|
||||||
private String goodsDesc;
|
private String goodsDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将po转换为vo
|
||||||
|
* @param po po对象
|
||||||
|
* @return vo对象
|
||||||
|
*/
|
||||||
|
public static TaskRecordVo of(TAppTaskBak po) {
|
||||||
|
if (po == null) {
|
||||||
|
return new TaskRecordVo();
|
||||||
|
}
|
||||||
|
return new TaskRecordVo(
|
||||||
|
po.getTaskId(),
|
||||||
|
po.getTaskType(),
|
||||||
|
po.getTaskStatus(),
|
||||||
|
po.getTaskPriority(),
|
||||||
|
po.getVehicleId(),
|
||||||
|
po.getOrigin(),
|
||||||
|
po.getDestination(),
|
||||||
|
po.getWcsTaskId(),
|
||||||
|
po.getCreateTime(),
|
||||||
|
po.getFinishTime(),
|
||||||
|
po.getGoodsId(),
|
||||||
|
po.getOpNum(),
|
||||||
|
po.getStockNum(),
|
||||||
|
po.getOpUser(),
|
||||||
|
po.getRemark(),
|
||||||
|
po.getCallStand(),
|
||||||
|
po.getGoodsDesc()
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,6 @@ import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
|
||||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
import com.wms_main.model.vo.wms.TaskConfirmVo;
|
import com.wms_main.model.vo.wms.TaskConfirmVo;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务控制类 服务接口
|
* 任务控制类 服务接口
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.wms_main.service.controller;
|
||||||
import com.wms_main.model.dto.query.WmsTaskQuery;
|
import com.wms_main.model.dto.query.WmsTaskQuery;
|
||||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
import com.wms_main.model.vo.wms.PageVo;
|
import com.wms_main.model.vo.wms.PageVo;
|
||||||
|
import com.wms_main.model.vo.wms.TaskRecordVo;
|
||||||
import com.wms_main.model.vo.wms.TaskVo;
|
import com.wms_main.model.vo.wms.TaskVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -15,4 +16,18 @@ public interface ITaskQueryControllerService {
|
||||||
* @return 查询结果---分页
|
* @return 查询结果---分页
|
||||||
*/
|
*/
|
||||||
WmsApiResponse<PageVo<TaskVo>> queryTasksByPage(WmsTaskQuery wmsTaskQuery);
|
WmsApiResponse<PageVo<TaskVo>> queryTasksByPage(WmsTaskQuery wmsTaskQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询入库记录信息---分页
|
||||||
|
* @param wmsTaskQuery 查询参数
|
||||||
|
* @return 查询结果---分页
|
||||||
|
*/
|
||||||
|
WmsApiResponse<PageVo<TaskRecordVo>> queryInTaskRecordByPage(WmsTaskQuery wmsTaskQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询出库记录信息---分页
|
||||||
|
* @param wmsTaskQuery 查询参数
|
||||||
|
* @return 查询结果---分页
|
||||||
|
*/
|
||||||
|
WmsApiResponse<PageVo<TaskRecordVo>> queryOutTaskRecordByPage(WmsTaskQuery wmsTaskQuery);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -394,7 +394,7 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
||||||
}
|
}
|
||||||
// 当前站台到达的拣选任务
|
// 当前站台到达的拣选任务
|
||||||
TAppPickTask thisPickTask = pickTaskList.getFirst();
|
TAppPickTask thisPickTask = pickTaskList.getFirst();
|
||||||
if (confirmWorkRequest.getOrderConfirm() != null) {
|
if (confirmWorkRequest.getOrderConfirm() != null && StringUtils.isNotEmpty(confirmWorkRequest.getOrderConfirm().getWorkIndex())) {
|
||||||
// 更新工作信息
|
// 更新工作信息
|
||||||
String updateWorkResult = updateWorkInfo(confirmWorkRequest);
|
String updateWorkResult = updateWorkInfo(confirmWorkRequest);
|
||||||
if (StringUtils.isNotEmpty(updateWorkResult)) {
|
if (StringUtils.isNotEmpty(updateWorkResult)) {
|
||||||
|
|
@ -676,42 +676,43 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
||||||
Map<String, Map<String, Integer>> goodsRequireByProductMap = new HashMap<>();
|
Map<String, Map<String, Integer>> goodsRequireByProductMap = new HashMap<>();
|
||||||
// 迭代计划表,获取
|
// 迭代计划表,获取
|
||||||
for (TAppDbs dbs : dbsList) {
|
for (TAppDbs dbs : dbsList) {
|
||||||
Map<String, Integer> goodsRequireMap;
|
Map<String, Integer> goodsRequireOfDbsMap = new HashMap<>();// 当前dbs的物料需求
|
||||||
|
Map<String, Integer> goodsRequireOfProductMap;// 当前成品的物料需求
|
||||||
// 获得物料需求
|
// 获得物料需求
|
||||||
if (dbs.getDbsStatus() == 0) {
|
if (dbs.getDbsStatus() == 0) {
|
||||||
if (goodsRequireByProductMap.containsKey(dbs.getProductIdOrigin())) {
|
if (goodsRequireByProductMap.containsKey(dbs.getProductIdOrigin())) {
|
||||||
// 包含原始成品号
|
// 包含原始成品号
|
||||||
goodsRequireMap = goodsRequireByProductMap.get(dbs.getProductIdOrigin());
|
goodsRequireOfProductMap = goodsRequireByProductMap.get(dbs.getProductIdOrigin());
|
||||||
} else {
|
} else {
|
||||||
goodsRequireMap = getGoodsRequireMapOfServiceProduct(dbs.getProductIdOrigin());
|
goodsRequireOfProductMap = getGoodsRequireMapOfServiceProduct(dbs.getProductIdOrigin());
|
||||||
if (!goodsRequireMap.isEmpty()) {
|
if (!goodsRequireOfProductMap.isEmpty()) {
|
||||||
// 存在服务件配料单,添加这个总成的Map
|
// 存在服务件配料单,添加这个总成的Map
|
||||||
goodsRequireByProductMap.put(dbs.getProductIdOrigin(), goodsRequireMap);
|
goodsRequireByProductMap.put(dbs.getProductIdOrigin(), goodsRequireOfProductMap);
|
||||||
} else {
|
} else {
|
||||||
if (goodsRequireByProductMap.containsKey(dbs.getProductId())) {
|
if (goodsRequireByProductMap.containsKey(dbs.getProductId())) {
|
||||||
// 直接获得当前总成的物料需求
|
// 直接获得当前总成的物料需求
|
||||||
goodsRequireMap = goodsRequireByProductMap.get(dbs.getProductId());
|
goodsRequireOfProductMap = goodsRequireByProductMap.get(dbs.getProductId());
|
||||||
} else {
|
} else {
|
||||||
// 去查询非服务件配料单
|
// 去查询非服务件配料单
|
||||||
goodsRequireMap = getGoodsRequireMapOfNonServiceProduct(dbs.getProductId());
|
goodsRequireOfProductMap = getGoodsRequireMapOfNonServiceProduct(dbs.getProductId());
|
||||||
if (goodsRequireMap.isEmpty()) {
|
if (goodsRequireOfProductMap.isEmpty()) {
|
||||||
return BaseWmsApiResponse.error("工单" + dbs.getWorkOrder() + "的物料需求为空,请检查数据。");
|
return BaseWmsApiResponse.error("工单" + dbs.getWorkOrder() + "的物料需求为空,请检查数据。");
|
||||||
}
|
}
|
||||||
// 添加这个非服务件配件清单的map
|
// 添加这个非服务件配件清单的map
|
||||||
goodsRequireByProductMap.put(dbs.getProductId(), goodsRequireMap);
|
goodsRequireByProductMap.put(dbs.getProductId(), goodsRequireOfProductMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 需求*产量
|
// 需求*产量
|
||||||
for (String goodsId : goodsRequireMap.keySet()) {
|
for (String goodsId : goodsRequireOfProductMap.keySet()) {
|
||||||
goodsRequireMap.replace(goodsId, goodsRequireMap.get(goodsId) * dbs.getPlanProduction());
|
goodsRequireOfDbsMap.put(goodsId, goodsRequireOfProductMap.get(goodsId) * dbs.getPlanProduction());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 查询已经生成的工作清单里面的物料需求
|
// 查询已经生成的工作清单里面的物料需求
|
||||||
goodsRequireMap = getRemainRequireMapOfOrder(dbs.getWorkOrder());
|
goodsRequireOfDbsMap = getRemainRequireMapOfOrder(dbs.getWorkOrder());
|
||||||
}
|
}
|
||||||
// 合并需求
|
// 合并需求
|
||||||
mergeRequire(totalGoodsRequireMap, goodsRequireMap);
|
mergeRequire(totalGoodsRequireMap, goodsRequireOfDbsMap);
|
||||||
}
|
}
|
||||||
// 获取需要的物料的基本信息
|
// 获取需要的物料的基本信息
|
||||||
List<String> goodsIds = new ArrayList<>(totalGoodsRequireMap.keySet());
|
List<String> goodsIds = new ArrayList<>(totalGoodsRequireMap.keySet());
|
||||||
|
|
@ -726,8 +727,8 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
||||||
// 所有的非库外料且看板维护的料
|
// 所有的非库外料且看板维护的料
|
||||||
List<TAppGoods> goodsList = appGoodsService.list(new LambdaQueryWrapper<TAppGoods>()
|
List<TAppGoods> goodsList = appGoodsService.list(new LambdaQueryWrapper<TAppGoods>()
|
||||||
.in(TAppGoods::getGoodsId, goodsIds)
|
.in(TAppGoods::getGoodsId, goodsIds)
|
||||||
.eq(TAppGoods::getPutArea, "ASRS")
|
.like(TAppGoods::getPutArea, "ASRS")
|
||||||
.eq(TAppGoods::getFeedingType, "Kanban"));
|
.like(TAppGoods::getFeedingType, "Kanban"));
|
||||||
// 整合物料信息为map
|
// 整合物料信息为map
|
||||||
Map<String, TAppGoods> filterGoodsMap = goodsList.stream().collect(Collectors.toMap(TAppGoods::getGoodsId, goods -> goods));
|
Map<String, TAppGoods> filterGoodsMap = goodsList.stream().collect(Collectors.toMap(TAppGoods::getGoodsId, goods -> goods));
|
||||||
// 获取筛选过的需要的物料的库存信息
|
// 获取筛选过的需要的物料的库存信息
|
||||||
|
|
@ -738,9 +739,9 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
||||||
Map<String, Integer> stockByGoodsMap = new HashMap<>();
|
Map<String, Integer> stockByGoodsMap = new HashMap<>();
|
||||||
for (TAppStock stock : stockList) {
|
for (TAppStock stock : stockList) {
|
||||||
if (stockByGoodsMap.containsKey(stock.getGoodsId())) {
|
if (stockByGoodsMap.containsKey(stock.getGoodsId())) {
|
||||||
stockByGoodsMap.replace(stock.getGoodsId(), stockByGoodsMap.get(stock.getGoodsId()) + stock.getRealNum());
|
stockByGoodsMap.replace(stock.getGoodsId(), stockByGoodsMap.get(stock.getGoodsId()) + stock.getRemainNum());
|
||||||
} else {
|
} else {
|
||||||
stockByGoodsMap.put(stock.getGoodsId(), stock.getRealNum());
|
stockByGoodsMap.put(stock.getGoodsId(), stock.getRemainNum());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 生成看板需求
|
// 生成看板需求
|
||||||
|
|
|
||||||
|
|
@ -67,12 +67,24 @@ public class StockControllerServiceImpl implements IStockControllerService {
|
||||||
if (stockUpdateQuery == null) {
|
if (stockUpdateQuery == null) {
|
||||||
return WmsApiResponse.error("查询参数不能为NULL", null);
|
return WmsApiResponse.error("查询参数不能为NULL", null);
|
||||||
}
|
}
|
||||||
|
if (stockUpdateQuery.getFromTime() != null && stockUpdateQuery.getToTime() != null) {
|
||||||
|
if (stockUpdateQuery.getFromTime().isAfter(stockUpdateQuery.getToTime())) {
|
||||||
|
return WmsApiResponse.error("from时间不能晚于to时间。", null);
|
||||||
|
}
|
||||||
|
}
|
||||||
Page<TAppStockUpdate> page = stockUpdateQuery.toMpPage();
|
Page<TAppStockUpdate> page = stockUpdateQuery.toMpPage();
|
||||||
LambdaQueryWrapper<TAppStockUpdate> lambdaQueryWrapper = new LambdaQueryWrapper<TAppStockUpdate>()
|
LambdaQueryWrapper<TAppStockUpdate> lambdaQueryWrapper = new LambdaQueryWrapper<TAppStockUpdate>()
|
||||||
.like(StringUtils.isNotEmpty(stockUpdateQuery.getGoodsId()), TAppStockUpdate::getGoodsId, stockUpdateQuery.getGoodsId())
|
.like(StringUtils.isNotEmpty(stockUpdateQuery.getGoodsId()), TAppStockUpdate::getGoodsId, stockUpdateQuery.getGoodsId())
|
||||||
.like(StringUtils.isNotEmpty(stockUpdateQuery.getVehicleId()), TAppStockUpdate::getVehicleId, stockUpdateQuery.getVehicleId());
|
.like(StringUtils.isNotEmpty(stockUpdateQuery.getVehicleId()), TAppStockUpdate::getVehicleId, stockUpdateQuery.getVehicleId());
|
||||||
|
// 时间范围查询
|
||||||
|
if (stockUpdateQuery.getFromTime() != null) {
|
||||||
|
lambdaQueryWrapper.ge(TAppStockUpdate::getUpdateTime, stockUpdateQuery.getFromTime());
|
||||||
|
}
|
||||||
|
if (stockUpdateQuery.getToTime() != null) {
|
||||||
|
lambdaQueryWrapper.le(TAppStockUpdate::getUpdateTime, stockUpdateQuery.getToTime());
|
||||||
|
}
|
||||||
|
// 查询库存更新记录
|
||||||
Page<TAppStockUpdate> stockUpdatePage = appStockUpdateService.page(page, lambdaQueryWrapper);
|
Page<TAppStockUpdate> stockUpdatePage = appStockUpdateService.page(page, lambdaQueryWrapper);
|
||||||
|
|
||||||
PageVo<StockUpdateVo> pageVo = PageVo.of(stockUpdatePage, StockUpdateVo::of);
|
PageVo<StockUpdateVo> pageVo = PageVo.of(stockUpdatePage, StockUpdateVo::of);
|
||||||
return WmsApiResponse.success("查询库存更新记录成功", pageVo);
|
return WmsApiResponse.success("查询库存更新记录成功", pageVo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,10 +99,19 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
if (stockInRequest.isEmptyTask() && stockInRequest.getGoodsInfo() != null && !stockInRequest.getGoodsInfo().isEmpty()) {
|
if (stockInRequest.isEmptyTask() && stockInRequest.getGoodsInfo() != null && !stockInRequest.getGoodsInfo().isEmpty()) {
|
||||||
stockInRequest.setEmptyTask(false);
|
stockInRequest.setEmptyTask(false);
|
||||||
}
|
}
|
||||||
// 查询当前载具的库存信息
|
// 判断是否同种类料入库
|
||||||
List<TAppStock> thisVehicleStocks = appStockService.list(
|
String thisTimeInGoodsId = "";// 本次入库物料
|
||||||
new LambdaQueryWrapper<TAppStock>()
|
if (stockInRequest.getGoodsInfo() != null && !stockInRequest.getGoodsInfo().isEmpty()) {
|
||||||
.eq(TAppStock::getVehicleId, stockInRequest.getVehicleId()));
|
for (GoodsInfoForTask goodsInfoForTask : stockInRequest.getGoodsInfo()) {
|
||||||
|
if (StringUtils.isEmpty(thisTimeInGoodsId)) {
|
||||||
|
thisTimeInGoodsId = goodsInfoForTask.getGoodsId();
|
||||||
|
} else {
|
||||||
|
if (!thisTimeInGoodsId.equals(goodsInfoForTask.getGoodsId())) {
|
||||||
|
return BaseWmsApiResponse.error("一个载具中只能入一种料。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (stockInRequest.isEmptyTask()) {
|
if (stockInRequest.isEmptyTask()) {
|
||||||
// 创建空载具入库任务
|
// 创建空载具入库任务
|
||||||
TAppTask task = new TAppTask(
|
TAppTask task = new TAppTask(
|
||||||
|
|
@ -131,6 +140,18 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
return BaseWmsApiResponse.error("创建空载具入库任务失败。");
|
return BaseWmsApiResponse.error("创建空载具入库任务失败。");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// 查询当前载具的库存信息
|
||||||
|
List<TAppStock> thisVehicleStocks = appStockService.list(
|
||||||
|
new LambdaQueryWrapper<TAppStock>()
|
||||||
|
.eq(TAppStock::getVehicleId, stockInRequest.getVehicleId()));
|
||||||
|
// 判断入库物料是否在库存中
|
||||||
|
if (StringUtils.isNotEmpty(thisTimeInGoodsId) && thisVehicleStocks != null && !thisVehicleStocks.isEmpty()) {
|
||||||
|
for (TAppStock stock : thisVehicleStocks) {
|
||||||
|
if (!Objects.equals(stock.getGoodsId(), thisTimeInGoodsId)) {
|
||||||
|
return BaseWmsApiResponse.error("当前载具已经绑定其他种类物料。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Map<String, TAppTask> goodsIdTaskMap = new HashMap<>();
|
Map<String, TAppTask> goodsIdTaskMap = new HashMap<>();
|
||||||
Map<String, TAppGoods> goodsMap = new HashMap<>();
|
Map<String, TAppGoods> goodsMap = new HashMap<>();
|
||||||
// 循环物料生成入库任务
|
// 循环物料生成入库任务
|
||||||
|
|
@ -681,7 +702,7 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
}
|
}
|
||||||
// 当前站台到达的拣选任务
|
// 当前站台到达的拣选任务
|
||||||
TAppPickTask thisPickTask = pickTaskList.getFirst();
|
TAppPickTask thisPickTask = pickTaskList.getFirst();
|
||||||
if (confirmTaskRequest.getTaskConfirm() != null) {
|
if (confirmTaskRequest.getTaskConfirm() != null && StringUtils.isNotEmpty(confirmTaskRequest.getTaskConfirm().getTaskId())) {
|
||||||
// 更新工作信息
|
// 更新工作信息
|
||||||
String updateTaskResult = updateTaskInfo(confirmTaskRequest);
|
String updateTaskResult = updateTaskInfo(confirmTaskRequest);
|
||||||
if (StringUtils.isNotEmpty(updateTaskResult)) {
|
if (StringUtils.isNotEmpty(updateTaskResult)) {
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,15 @@ package com.wms_main.service.controller.serviceImpl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.wms_main.constant.enums.wms.WmsTaskTypeEnums;
|
||||||
|
import com.wms_main.dao.ITAppTaskBakService;
|
||||||
import com.wms_main.dao.ITAppTaskService;
|
import com.wms_main.dao.ITAppTaskService;
|
||||||
import com.wms_main.model.dto.query.WmsTaskQuery;
|
import com.wms_main.model.dto.query.WmsTaskQuery;
|
||||||
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
import com.wms_main.model.dto.response.wms.WmsApiResponse;
|
||||||
import com.wms_main.model.po.TAppTask;
|
import com.wms_main.model.po.TAppTask;
|
||||||
|
import com.wms_main.model.po.TAppTaskBak;
|
||||||
import com.wms_main.model.vo.wms.PageVo;
|
import com.wms_main.model.vo.wms.PageVo;
|
||||||
|
import com.wms_main.model.vo.wms.TaskRecordVo;
|
||||||
import com.wms_main.model.vo.wms.TaskVo;
|
import com.wms_main.model.vo.wms.TaskVo;
|
||||||
import com.wms_main.repository.utils.StringUtils;
|
import com.wms_main.repository.utils.StringUtils;
|
||||||
import com.wms_main.service.controller.ITaskQueryControllerService;
|
import com.wms_main.service.controller.ITaskQueryControllerService;
|
||||||
|
|
@ -20,6 +24,7 @@ import org.springframework.stereotype.Service;
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class TaskQueryControllerServiceImpl implements ITaskQueryControllerService {
|
public class TaskQueryControllerServiceImpl implements ITaskQueryControllerService {
|
||||||
private final ITAppTaskService appTaskService;// 任务服务
|
private final ITAppTaskService appTaskService;// 任务服务
|
||||||
|
private final ITAppTaskBakService appTaskBakService;// 任务记录服务
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询wms任务监控---分页
|
* 查询wms任务监控---分页
|
||||||
|
|
@ -43,4 +48,70 @@ public class TaskQueryControllerServiceImpl implements ITaskQueryControllerServi
|
||||||
PageVo<TaskVo> pageVo = PageVo.of(tasksPage, TaskVo::of);
|
PageVo<TaskVo> pageVo = PageVo.of(tasksPage, TaskVo::of);
|
||||||
return WmsApiResponse.success("查询任务成功。", pageVo);
|
return WmsApiResponse.success("查询任务成功。", pageVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询入库记录(分页)---实现
|
||||||
|
* @param wmsTaskQuery 查询参数
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WmsApiResponse<PageVo<TaskRecordVo>> queryInTaskRecordByPage(WmsTaskQuery wmsTaskQuery) {
|
||||||
|
if (wmsTaskQuery == null) {
|
||||||
|
return WmsApiResponse.error("查询参数不能为NULL", null);
|
||||||
|
}
|
||||||
|
if (wmsTaskQuery.getFromTime() != null && wmsTaskQuery.getToTime() != null) {
|
||||||
|
if (wmsTaskQuery.getFromTime().isAfter(wmsTaskQuery.getToTime())) {
|
||||||
|
return WmsApiResponse.error("from时间不能晚于to时间。", null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Page<TAppTaskBak> page = wmsTaskQuery.toMpPage();
|
||||||
|
LambdaQueryWrapper<TAppTaskBak> lambdaQueryWrapper = new LambdaQueryWrapper<TAppTaskBak>()
|
||||||
|
.like(StringUtils.isNotEmpty(wmsTaskQuery.getTaskId()), TAppTaskBak::getTaskId, wmsTaskQuery.getTaskId())
|
||||||
|
.like(StringUtils.isNotEmpty(wmsTaskQuery.getGoodsId()), TAppTaskBak::getGoodsId, wmsTaskQuery.getGoodsId())
|
||||||
|
.like(StringUtils.isNotEmpty(wmsTaskQuery.getVehicleId()), TAppTaskBak::getVehicleId, wmsTaskQuery.getVehicleId())
|
||||||
|
.eq(TAppTaskBak::getTaskType, WmsTaskTypeEnums.IN.getCode());
|
||||||
|
if (wmsTaskQuery.getFromTime() != null) {
|
||||||
|
lambdaQueryWrapper.ge(TAppTaskBak::getCreateTime, wmsTaskQuery.getFromTime());
|
||||||
|
}
|
||||||
|
if (wmsTaskQuery.getToTime() != null) {
|
||||||
|
lambdaQueryWrapper.le(TAppTaskBak::getCreateTime, wmsTaskQuery.getToTime());
|
||||||
|
}
|
||||||
|
Page<TAppTaskBak> inTaskRecordsPage = appTaskBakService.page(page, lambdaQueryWrapper);
|
||||||
|
|
||||||
|
PageVo<TaskRecordVo> pageVo = PageVo.of(inTaskRecordsPage, TaskRecordVo::of);
|
||||||
|
return WmsApiResponse.success("查询入库记录成功。", pageVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询出库记录(分页)---实现
|
||||||
|
* @param wmsTaskQuery 查询参数
|
||||||
|
* @return 查询结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WmsApiResponse<PageVo<TaskRecordVo>> queryOutTaskRecordByPage(WmsTaskQuery wmsTaskQuery) {
|
||||||
|
if (wmsTaskQuery == null) {
|
||||||
|
return WmsApiResponse.error("查询参数不能为NULL", null);
|
||||||
|
}
|
||||||
|
if (wmsTaskQuery.getFromTime() != null && wmsTaskQuery.getToTime() != null) {
|
||||||
|
if (wmsTaskQuery.getFromTime().isAfter(wmsTaskQuery.getToTime())) {
|
||||||
|
return WmsApiResponse.error("from时间不能晚于to时间。", null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Page<TAppTaskBak> page = wmsTaskQuery.toMpPage();
|
||||||
|
LambdaQueryWrapper<TAppTaskBak> lambdaQueryWrapper = new LambdaQueryWrapper<TAppTaskBak>()
|
||||||
|
.like(StringUtils.isNotEmpty(wmsTaskQuery.getTaskId()), TAppTaskBak::getTaskId, wmsTaskQuery.getTaskId())
|
||||||
|
.like(StringUtils.isNotEmpty(wmsTaskQuery.getGoodsId()), TAppTaskBak::getGoodsId, wmsTaskQuery.getGoodsId())
|
||||||
|
.like(StringUtils.isNotEmpty(wmsTaskQuery.getVehicleId()), TAppTaskBak::getVehicleId, wmsTaskQuery.getVehicleId())
|
||||||
|
.eq(TAppTaskBak::getTaskType, WmsTaskTypeEnums.OUT.getCode());
|
||||||
|
if (wmsTaskQuery.getFromTime() != null) {
|
||||||
|
lambdaQueryWrapper.ge(TAppTaskBak::getCreateTime, wmsTaskQuery.getFromTime());
|
||||||
|
}
|
||||||
|
if (wmsTaskQuery.getToTime() != null) {
|
||||||
|
lambdaQueryWrapper.le(TAppTaskBak::getCreateTime, wmsTaskQuery.getToTime());
|
||||||
|
}
|
||||||
|
Page<TAppTaskBak> outTaskRecordsPage = appTaskBakService.page(page, lambdaQueryWrapper);
|
||||||
|
|
||||||
|
PageVo<TaskRecordVo> pageVo = PageVo.of(outTaskRecordsPage, TaskRecordVo::of);
|
||||||
|
return WmsApiResponse.success("查询出库记录成功。", pageVo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -741,6 +741,11 @@ public class OutsExecutorServiceImpl implements IOutsExecutorService {
|
||||||
workRecords.add(RecordOfWork(work));
|
workRecords.add(RecordOfWork(work));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (work.getWorkStatus() == 2 && work.getLackStatus() == 1) {
|
||||||
|
// 缺料,添加记录
|
||||||
|
workRecords.add(RecordOfWork(work));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// 判断库内料分配的数量是否需要修正
|
// 判断库内料分配的数量是否需要修正
|
||||||
if (work.getIsOut() != 1) {
|
if (work.getIsOut() != 1) {
|
||||||
List<TAppStock> thisGoodsOutStocks = allStocks.stream().filter(stock -> stock.getGoodsId().equals(work.getGoodsId())).toList();
|
List<TAppStock> thisGoodsOutStocks = allStocks.stream().filter(stock -> stock.getGoodsId().equals(work.getGoodsId())).toList();
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,6 @@ spring:
|
||||||
# url: jdbc:mysql://112.4.208.194:3001/wms_kate_wuxi?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
# url: jdbc:mysql://112.4.208.194:3001/wms_kate_wuxi?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||||
# username: developer
|
# username: developer
|
||||||
# password: developer
|
# password: developer
|
||||||
# 本地
|
|
||||||
# url: jdbc:mysql://localhost:3306/wms_kate_wuxi_test?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
|
||||||
# username: root
|
|
||||||
# password: liangzhou
|
|
||||||
# 卡特服务器
|
# 卡特服务器
|
||||||
url: jdbc:mysql://10.90.83.37:3306/wms_kate_wuxi?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
url: jdbc:mysql://10.90.83.37:3306/wms_kate_wuxi?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||||
username: developer
|
username: developer
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user