forked from BaoKaiWms/202501-Wms-Kate-Wuxi
1. 增加导入配料单的数量提示。
2. 减去配料单物料描述的非空筛选。 3. 增加拣选界面的盘点任务遗留查询。
This commit is contained in:
parent
f60c8c6295
commit
e41905ab78
|
|
@ -1,95 +1,92 @@
|
||||||
<template>
|
<template>
|
||||||
<el-upload ref="uploadRef" :on-preview="previewFile" :limit="1" :on-change="changeFile" :auto-upload="false"
|
<el-upload ref="uploadRef" :on-preview="previewFile" :limit="1" :on-change="changeFile" :auto-upload="false"
|
||||||
:data="uploadForm.data">
|
:data="uploadForm.data">
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<el-button type="primary">选取非服务件配料单文件</el-button>
|
<el-button type="primary">选取非服务件配料单文件</el-button>
|
||||||
</template>
|
</template>
|
||||||
<el-button style="margin-left: 10px;" type="success" @click="uploadProduct">上传非服务件配料清单</el-button>
|
<el-button style="margin-left: 10px;" type="success" @click="uploadProduct">上传非服务件配料清单</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { ref, reactive } from 'vue';
|
import {ref, reactive} from 'vue';
|
||||||
import { uploadExcelProduct } from '@/api/excel.js'
|
import {uploadExcelProduct} from '@/api/excel.js'
|
||||||
import { ElMessage } from 'element-plus'
|
import {errorBox, successBox} from '@/utils/myMessageBox';
|
||||||
import { errorBox } from '@/utils/myMessageBox';
|
import {sizeFormatter} from '@/utils/formatter.js'
|
||||||
import { sizeFormatter } from '@/utils/formatter.js'
|
import {loading} from '@/utils/loading.js'
|
||||||
import { loading } from '@/utils/loading.js'
|
import {getHashString} from '@/utils/hashUtils.js'
|
||||||
import { getHashString } from '@/utils/hashUtils.js'
|
|
||||||
var currentHash = ''
|
var currentHash = ''
|
||||||
const file = ref()
|
const file = ref()
|
||||||
const uploadForm = reactive({
|
const uploadForm = reactive({
|
||||||
data: {
|
data: {
|
||||||
fileId: '',
|
fileId: '',
|
||||||
name: '',
|
name: '',
|
||||||
type: '',
|
type: '',
|
||||||
size: null,
|
size: null,
|
||||||
hash: '',
|
hash: '',
|
||||||
userName: store.getters.getUserName
|
userName: store.getters.getUserName
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const changeFile = (uploadFile) => {
|
const changeFile = (uploadFile) => {
|
||||||
file.value = uploadFile
|
file.value = uploadFile
|
||||||
uploadForm.data = {
|
uploadForm.data = {
|
||||||
fileId: file.value.raw.uid,
|
fileId: file.value.raw.uid,
|
||||||
name: file.value.raw.name,
|
name: file.value.raw.name,
|
||||||
type: file.value.raw.type,
|
type: file.value.raw.type,
|
||||||
size: sizeFormatter(file.value.raw.size),
|
size: sizeFormatter(file.value.raw.size),
|
||||||
hash: getHashString(uploadFile),
|
hash: getHashString(uploadFile),
|
||||||
userName: store.getters.getUserName
|
userName: store.getters.getUserName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const uploadRef = ref()
|
const uploadRef = ref()
|
||||||
const uploadProduct = () => {
|
const uploadProduct = () => {
|
||||||
if (uploadForm == undefined || file.value == undefined) {
|
if (uploadForm == undefined || file.value == undefined) {
|
||||||
errorBox('请选择文件之后再上传')
|
errorBox('请选择文件之后再上传')
|
||||||
return
|
return
|
||||||
|
}
|
||||||
|
if (currentHash != '' && currentHash == uploadForm.data.hash) {
|
||||||
|
errorBox('请勿重复上传')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
currentHash = uploadForm.data.hash
|
||||||
|
const jsonStr = JSON.stringify(uploadForm.data);
|
||||||
|
const blob = new Blob([jsonStr], {
|
||||||
|
type: 'application/json'
|
||||||
|
});
|
||||||
|
let formData = new FormData();
|
||||||
|
// 这里很重要 file.value.raw才是真实的file文件,file.value只是一个Proxy代理对象
|
||||||
|
formData.append("fileVo", blob);
|
||||||
|
formData.append("file", file.value.raw);
|
||||||
|
loading.open('导入中...')
|
||||||
|
uploadExcelProduct(formData).then(res => {
|
||||||
|
loading.close()
|
||||||
|
currentHash = ''
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
successBox(res.data.message)
|
||||||
|
clearFileInfos()
|
||||||
|
} else {
|
||||||
|
errorBox(res.data.message)
|
||||||
}
|
}
|
||||||
if (currentHash != '' && currentHash == uploadForm.data.hash) {
|
}).catch(err => {
|
||||||
errorBox('请勿重复上传')
|
loading.close()
|
||||||
return
|
currentHash = ''
|
||||||
}
|
console.log(err)
|
||||||
currentHash = uploadForm.data.hash
|
errorBox('上传错误')
|
||||||
const jsonStr = JSON.stringify(uploadForm.data);
|
})
|
||||||
const blob = new Blob([jsonStr], {
|
|
||||||
type: 'application/json'
|
|
||||||
});
|
|
||||||
let formData = new FormData();
|
|
||||||
// 这里很重要 file.value.raw才是真实的file文件,file.value只是一个Proxy代理对象
|
|
||||||
formData.append("fileVo", blob);
|
|
||||||
formData.append("file", file.value.raw);
|
|
||||||
loading.open('导入中...')
|
|
||||||
uploadExcelProduct(formData).then(res => {
|
|
||||||
loading.close()
|
|
||||||
currentHash = ''
|
|
||||||
if (res.data.code == 0) {
|
|
||||||
ElMessage({
|
|
||||||
message: '上传成功',
|
|
||||||
type: 'success',
|
|
||||||
})
|
|
||||||
clearFileInfos()
|
|
||||||
} else {
|
|
||||||
errorBox(res.data.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
loading.close()
|
|
||||||
currentHash = ''
|
|
||||||
console.log(err)
|
|
||||||
errorBox('上传错误')
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
const clearFileInfos = () => {
|
const clearFileInfos = () => {
|
||||||
// 清空选择的文件项
|
// 清空选择的文件项
|
||||||
uploadRef.value.clearFiles()
|
uploadRef.value.clearFiles()
|
||||||
uploadForm.data = {
|
uploadForm.data = {
|
||||||
fileId: '',
|
fileId: '',
|
||||||
name: '',
|
name: '',
|
||||||
type: '',
|
type: '',
|
||||||
size: null,
|
size: null,
|
||||||
hash: '',
|
hash: '',
|
||||||
userName: store.getters.getUserName
|
userName: store.getters.getUserName
|
||||||
}
|
}
|
||||||
file.value = undefined
|
file.value = undefined
|
||||||
}
|
}
|
||||||
const previewFile = () => {
|
const previewFile = () => {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,95 +1,92 @@
|
||||||
<template>
|
<template>
|
||||||
<el-upload ref="uploadRef" :on-preview="previewFile" :limit="1" :on-change="changeFile" :auto-upload="false"
|
<el-upload ref="uploadRef" :on-preview="previewFile" :limit="1" :on-change="changeFile" :auto-upload="false"
|
||||||
:data="uploadForm.data">
|
:data="uploadForm.data">
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<el-button type="primary">选取服务件配料单文件</el-button>
|
<el-button type="primary">选取服务件配料单文件</el-button>
|
||||||
</template>
|
</template>
|
||||||
<el-button style="margin-left: 10px;" type="success" @click="uploadSingleProduct">上传服务件配料单</el-button>
|
<el-button style="margin-left: 10px;" type="success" @click="uploadSingleProduct">上传服务件配料单</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { ref, reactive } from 'vue';
|
import {ref, reactive} from 'vue';
|
||||||
import { uploadExcelSingleProduct } from '@/api/excel.js'
|
import {uploadExcelSingleProduct} from '@/api/excel.js'
|
||||||
import { ElMessage } from 'element-plus'
|
import {errorBox, successBox} from '@/utils/myMessageBox';
|
||||||
import { errorBox } from '@/utils/myMessageBox';
|
import {sizeFormatter} from '@/utils/formatter.js'
|
||||||
import { sizeFormatter } from '@/utils/formatter.js'
|
import {loading} from '@/utils/loading.js'
|
||||||
import { loading } from '@/utils/loading.js'
|
import {getHashString} from '@/utils/hashUtils.js'
|
||||||
import { getHashString } from '@/utils/hashUtils.js'
|
|
||||||
var currentHash = ''
|
var currentHash = ''
|
||||||
const file = ref()
|
const file = ref()
|
||||||
const uploadForm = reactive({
|
const uploadForm = reactive({
|
||||||
data: {
|
data: {
|
||||||
fileId: '',
|
fileId: '',
|
||||||
name: '',
|
name: '',
|
||||||
type: '',
|
type: '',
|
||||||
size: null,
|
size: null,
|
||||||
hash: '',
|
hash: '',
|
||||||
userName: store.getters.getUserName
|
userName: store.getters.getUserName
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const changeFile = (uploadFile) => {
|
const changeFile = (uploadFile) => {
|
||||||
file.value = uploadFile
|
file.value = uploadFile
|
||||||
uploadForm.data = {
|
uploadForm.data = {
|
||||||
fileId: file.value.raw.uid,
|
fileId: file.value.raw.uid,
|
||||||
name: file.value.raw.name,
|
name: file.value.raw.name,
|
||||||
type: file.value.raw.type,
|
type: file.value.raw.type,
|
||||||
size: sizeFormatter(file.value.raw.size),
|
size: sizeFormatter(file.value.raw.size),
|
||||||
hash: getHashString(uploadFile),
|
hash: getHashString(uploadFile),
|
||||||
userName: store.getters.getUserName
|
userName: store.getters.getUserName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const uploadRef = ref()
|
const uploadRef = ref()
|
||||||
const uploadSingleProduct = () => {
|
const uploadSingleProduct = () => {
|
||||||
if (uploadForm == undefined || file.value == undefined) {
|
if (uploadForm == undefined || file.value == undefined) {
|
||||||
errorBox('请选择文件之后再上传')
|
errorBox('请选择文件之后再上传')
|
||||||
return
|
return
|
||||||
|
}
|
||||||
|
if (currentHash != '' && currentHash == uploadForm.data.hash) {
|
||||||
|
errorBox('请勿重复上传')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
currentHash = uploadForm.data.hash
|
||||||
|
const jsonStr = JSON.stringify(uploadForm.data);
|
||||||
|
const blob = new Blob([jsonStr], {
|
||||||
|
type: 'application/json'
|
||||||
|
});
|
||||||
|
let formData = new FormData();
|
||||||
|
// 这里很重要 file.value.raw才是真实的file文件,file.value只是一个Proxy代理对象
|
||||||
|
formData.append("fileVo", blob);
|
||||||
|
formData.append("file", file.value.raw);
|
||||||
|
loading.open('导入中...')
|
||||||
|
uploadExcelSingleProduct(formData).then(res => {
|
||||||
|
loading.close()
|
||||||
|
currentHash = ''
|
||||||
|
if (res.data.code == 0) {
|
||||||
|
successBox(res.data.message)
|
||||||
|
clearFileInfos()
|
||||||
|
} else {
|
||||||
|
errorBox(res.data.message)
|
||||||
}
|
}
|
||||||
if (currentHash != '' && currentHash == uploadForm.data.hash) {
|
}).catch(err => {
|
||||||
errorBox('请勿重复上传')
|
loading.close()
|
||||||
return
|
currentHash = ''
|
||||||
}
|
console.log(err)
|
||||||
currentHash = uploadForm.data.hash
|
errorBox('上传错误')
|
||||||
const jsonStr = JSON.stringify(uploadForm.data);
|
})
|
||||||
const blob = new Blob([jsonStr], {
|
|
||||||
type: 'application/json'
|
|
||||||
});
|
|
||||||
let formData = new FormData();
|
|
||||||
// 这里很重要 file.value.raw才是真实的file文件,file.value只是一个Proxy代理对象
|
|
||||||
formData.append("fileVo", blob);
|
|
||||||
formData.append("file", file.value.raw);
|
|
||||||
loading.open('导入中...')
|
|
||||||
uploadExcelSingleProduct(formData).then(res => {
|
|
||||||
loading.close()
|
|
||||||
currentHash = ''
|
|
||||||
if (res.data.code == 0) {
|
|
||||||
ElMessage({
|
|
||||||
message: '上传成功',
|
|
||||||
type: 'success',
|
|
||||||
})
|
|
||||||
clearFileInfos()
|
|
||||||
} else {
|
|
||||||
errorBox(res.data.message)
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
loading.close()
|
|
||||||
currentHash = ''
|
|
||||||
console.log(err)
|
|
||||||
errorBox('上传错误')
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
const clearFileInfos = () => {
|
const clearFileInfos = () => {
|
||||||
// 清空选择的文件项
|
// 清空选择的文件项
|
||||||
uploadRef.value.clearFiles()
|
uploadRef.value.clearFiles()
|
||||||
uploadForm.data = {
|
uploadForm.data = {
|
||||||
fileId: '',
|
fileId: '',
|
||||||
name: '',
|
name: '',
|
||||||
type: '',
|
type: '',
|
||||||
size: null,
|
size: null,
|
||||||
hash: '',
|
hash: '',
|
||||||
userName: store.getters.getUserName
|
userName: store.getters.getUserName
|
||||||
}
|
}
|
||||||
file.value = undefined
|
file.value = undefined
|
||||||
}
|
}
|
||||||
const previewFile = () => {
|
const previewFile = () => {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,6 @@ public class ImportExcelEasyPoi extends BaseImportExcelEasyPoi implements IImpor
|
||||||
|| StringUtils.isEmpty(productRawData.getProductId())
|
|| StringUtils.isEmpty(productRawData.getProductId())
|
||||||
|| productRawData.getQuantity1Pair() == null
|
|| productRawData.getQuantity1Pair() == null
|
||||||
|| StringUtils.isEmpty(productRawData.getGoodsId())
|
|| StringUtils.isEmpty(productRawData.getGoodsId())
|
||||||
|| StringUtils.isEmpty(productRawData.getGoodsDesc())
|
|
||||||
|| productRawData.getQuantityOfPairs() == null
|
|| productRawData.getQuantityOfPairs() == null
|
||||||
|| StringUtils.isEmpty(productRawData.getBoxNo())) {
|
|| StringUtils.isEmpty(productRawData.getBoxNo())) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -210,7 +209,8 @@ public class ImportExcelEasyPoi extends BaseImportExcelEasyPoi implements IImpor
|
||||||
tAppImageService.saveOrUpdateBatch(imageList);
|
tAppImageService.saveOrUpdateBatch(imageList);
|
||||||
// 保存导入file记录
|
// 保存导入file记录
|
||||||
saveFileVo(fileVo);
|
saveFileVo(fileVo);
|
||||||
return BaseWmsApiResponse.success("导入配料单成功。");
|
return BaseWmsApiResponse.success("导入配料单成功。\n原始:" + productRawDatas.size() + "条,成功:" + productList.size()
|
||||||
|
+ "条。\n图纸原始:" + imageRawDatas.size() + "条,成功:" + imageList.size() + "条。");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// 回滚事务
|
// 回滚事务
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
|
|
@ -245,7 +245,6 @@ public class ImportExcelEasyPoi extends BaseImportExcelEasyPoi implements IImpor
|
||||||
|| StringUtils.isEmpty(productRawData.getSingleProductId())
|
|| StringUtils.isEmpty(productRawData.getSingleProductId())
|
||||||
|| productRawData.getQuantity1Pair() == null
|
|| productRawData.getQuantity1Pair() == null
|
||||||
|| StringUtils.isEmpty(productRawData.getGoodsId())
|
|| StringUtils.isEmpty(productRawData.getGoodsId())
|
||||||
|| StringUtils.isEmpty(productRawData.getGoodsDesc())
|
|
||||||
|| productRawData.getQuantityOfPairs() == null
|
|| productRawData.getQuantityOfPairs() == null
|
||||||
|| StringUtils.isEmpty(productRawData.getBoxNo())) {
|
|| StringUtils.isEmpty(productRawData.getBoxNo())) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -289,7 +288,8 @@ public class ImportExcelEasyPoi extends BaseImportExcelEasyPoi implements IImpor
|
||||||
tAppImageService.saveOrUpdateBatch(imageList);
|
tAppImageService.saveOrUpdateBatch(imageList);
|
||||||
// 保存导入file记录
|
// 保存导入file记录
|
||||||
saveFileVo(fileVo);
|
saveFileVo(fileVo);
|
||||||
return BaseWmsApiResponse.success("导入服务件配料单成功。");
|
return BaseWmsApiResponse.success("导入服务件配料单成功。\n原始:" + productRawDatas.size() + "条,成功:" + productList.size()
|
||||||
|
+ "条。\n图纸原始:" + imageRawDatas.size() + "条,成功:" + imageList.size() + "条。");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// 回滚事务
|
// 回滚事务
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
||||||
private final ITAppKanbanService appKanbanService;// 看板服务
|
private final ITAppKanbanService appKanbanService;// 看板服务
|
||||||
private final ITAppWorkRecordService appWorkRecordService;// 工作记录服务
|
private final ITAppWorkRecordService appWorkRecordService;// 工作记录服务
|
||||||
private final ITAppPickPlanService appPickPlanService;// 拣选计划服务
|
private final ITAppPickPlanService appPickPlanService;// 拣选计划服务
|
||||||
|
private final ITAppInventoryService appInventoryService;// 盘点任务服务
|
||||||
private final AppCommon appCommon;
|
private final AppCommon appCommon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -419,6 +420,14 @@ public class KateWorkControllerServiceImpl implements IKateWorkControllerService
|
||||||
if (taskConfirmVo != null) {
|
if (taskConfirmVo != null) {
|
||||||
return BaseWmsApiResponse.warn("当前载具还有其他拣选任务,请切换到出库界面进行拣配。");
|
return BaseWmsApiResponse.warn("当前载具还有其他拣选任务,请切换到出库界面进行拣配。");
|
||||||
}
|
}
|
||||||
|
// 判断当前载具是否还有盘点任务
|
||||||
|
List<String> goodsIds = stockList.stream().map(TAppStock::getGoodsId).distinct().toList();
|
||||||
|
List<TAppInventory> inventoryTasks = appInventoryService.list(new LambdaQueryWrapper<TAppInventory>()
|
||||||
|
.eq(TAppInventory::getVehicleId, thisPickTask.getVehicleId())
|
||||||
|
.in(TAppInventory::getGoodsId, goodsIds));
|
||||||
|
if (inventoryTasks != null && !inventoryTasks.isEmpty()) {
|
||||||
|
return BaseWmsApiResponse.warn("当前载具还有盘点任务,请切换到盘点界面进行拣配。");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 取消后续拣选任务
|
// 取消后续拣选任务
|
||||||
conveyTaskService.cancelOtherStandPickTasks(thisPickTask.getVehicleId(), thisPickTask.getPickStand());
|
conveyTaskService.cancelOtherStandPickTasks(thisPickTask.getVehicleId(), thisPickTask.getPickStand());
|
||||||
|
|
|
||||||
|
|
@ -737,6 +737,14 @@ public class TaskControllerServiceImpl implements ITaskControllerService {
|
||||||
if (resultVo != null) {
|
if (resultVo != null) {
|
||||||
return BaseWmsApiResponse.warn("当前载具还有工作,请切换到拣配界面进行拣配。");
|
return BaseWmsApiResponse.warn("当前载具还有工作,请切换到拣配界面进行拣配。");
|
||||||
}
|
}
|
||||||
|
// 判断当前载具是否还有盘点任务
|
||||||
|
List<String> goodsIds = stockList.stream().map(TAppStock::getGoodsId).distinct().toList();
|
||||||
|
List<TAppInventory> inventoryTasks = appInventoryService.list(new LambdaQueryWrapper<TAppInventory>()
|
||||||
|
.eq(TAppInventory::getVehicleId, thisPickTask.getVehicleId())
|
||||||
|
.in(TAppInventory::getGoodsId, goodsIds));
|
||||||
|
if (inventoryTasks != null && !inventoryTasks.isEmpty()) {
|
||||||
|
return BaseWmsApiResponse.warn("当前载具还有盘点任务,请切换到盘点界面进行拣配。");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 取消后续拣选任务
|
// 取消后续拣选任务
|
||||||
conveyTaskService.cancelOtherStandPickTasks(thisPickTask.getVehicleId(), thisPickTask.getPickStand());
|
conveyTaskService.cancelOtherStandPickTasks(thisPickTask.getVehicleId(), thisPickTask.getPickStand());
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ spring:
|
||||||
# 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
|
# url: jdbc:mysql://localhost:3306/wms_kate_wuxi?characterEncoding=utf8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&rewriteBatchedStatements=true
|
||||||
# username: root
|
# username: root
|
||||||
# password: liangzhou
|
# password: liangzhou
|
||||||
# 卡特服务器
|
# 卡特服务器
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user