diff --git a/src/layout/clcNoPlan.vue b/src/layout/clcNoPlan.vue index c1b2382..0372b5f 100644 --- a/src/layout/clcNoPlan.vue +++ b/src/layout/clcNoPlan.vue @@ -201,6 +201,7 @@ import { errorBox, successBox } from '@/utils/myMessageBox.js' import { getStockNumByGoodsId } from '@/api/stock' import { reactive, ref } from 'vue' import { ElMessage } from 'element-plus' +import loading from '@/utils/loading.js' import zhCn from 'element-plus/dist/locale/zh-cn.mjs' @@ -299,6 +300,7 @@ export default { }, // 确认完成工作 createTask() { + loading.open('处理中,请稍等...') if (this.standId == '' || this.workFormEntity.goodsId == '') { errorBox('站台号和料号不可缺少') return @@ -314,6 +316,7 @@ export default { userName: store.getters.getUserName } clcNoPlan(requestParams).then(res => { + loading.close() const response = res.data if (response.code == 0) { successBox(response.message) @@ -322,6 +325,7 @@ export default { errorBox(response.message) } }).catch(err => { + loading.close() console.log(err) errorBox('请求时发生异常。') }) diff --git a/src/layout/goodsIn.vue b/src/layout/goodsIn.vue index 49bbb33..7021e7a 100644 --- a/src/layout/goodsIn.vue +++ b/src/layout/goodsIn.vue @@ -49,9 +49,8 @@
- +
PC @@ -158,7 +157,7 @@ export default { this.workFormEntity.vehicleId = vehicleIdString } } - if (this.workFormEntity.goodsNum != ''){ + if (this.workFormEntity.goodsNum != '') { if (isNaN(Number.parseInt(this.workFormEntity.goodsNum))) { errorBox('数量格式不正确') return @@ -193,17 +192,22 @@ export default { type: 'warning', } ).then(() => { - const sameIndex = this.tempTasks.findIndex(task => task.goodsId == this.workFormEntity.goodsId) - if (sameIndex != -1) {// 绑定过相同物料 - var sameGoods = this.tempTasks[sameIndex] - sameGoods.goodsNum = sameGoods.goodsNum + this.workFormEntity.goodsNum - } else { - this.tempTasks.push({ - vehicleId: this.workFormEntity.vehicleId, - goodsId: this.workFormEntity.goodsId, - goodsNum: this.workFormEntity.goodsNum - }) - } + // const sameIndex = this.tempTasks.findIndex(task => task.goodsId == this.workFormEntity.goodsId) + // if (sameIndex != -1) {// 绑定过相同物料 + // var sameGoods = this.tempTasks[sameIndex] + // sameGoods.goodsNum = sameGoods.goodsNum + this.workFormEntity.goodsNum + // } else { + // this.tempTasks.push({ + // vehicleId: this.workFormEntity.vehicleId, + // goodsId: this.workFormEntity.goodsId, + // goodsNum: this.workFormEntity.goodsNum + // }) + // } + this.tempTasks.push({ + vehicleId: this.workFormEntity.vehicleId, + goodsId: this.workFormEntity.goodsId, + goodsNum: this.workFormEntity.goodsNum + }) this.currentVehicleId = this.workFormEntity.vehicleId this.workFormEntity.goodsId = '' this.workFormEntity.goodsNum = '' @@ -216,17 +220,22 @@ export default { return }) } else { - const sameIndex = this.tempTasks.findIndex(task => task.goodsId == this.workFormEntity.goodsId) - if (sameIndex != -1) {// 绑定过相同物料 - var sameGoods = this.tempTasks[sameIndex] - sameGoods.goodsNum = sameGoods.goodsNum + this.workFormEntity.goodsNum - } else { - this.tempTasks.push({ - vehicleId: this.workFormEntity.vehicleId, - goodsId: this.workFormEntity.goodsId, - goodsNum: this.workFormEntity.goodsNum - }) - } + // const sameIndex = this.tempTasks.findIndex(task => task.goodsId == this.workFormEntity.goodsId) + // if (sameIndex != -1) {// 绑定过相同物料 + // var sameGoods = this.tempTasks[sameIndex] + // sameGoods.goodsNum = sameGoods.goodsNum + this.workFormEntity.goodsNum + // } else { + // this.tempTasks.push({ + // vehicleId: this.workFormEntity.vehicleId, + // goodsId: this.workFormEntity.goodsId, + // goodsNum: this.workFormEntity.goodsNum + // }) + // } + this.tempTasks.push({ + vehicleId: this.workFormEntity.vehicleId, + goodsId: this.workFormEntity.goodsId, + goodsNum: this.workFormEntity.goodsNum + }) this.currentVehicleId = this.workFormEntity.vehicleId this.workFormEntity.goodsId = '' this.workFormEntity.goodsNum = '' @@ -251,7 +260,7 @@ export default { deleteRowTask(row) {// 删除当前行的入库任务 this.tempTasks.splice(this.tempTasks.indexOf(row), 1) if (this.tempTasks.length == 0) { - this.tempVehicleNo = '' + this.currentVehicleId = '' } }, confirmTask() { @@ -261,10 +270,25 @@ export default { errorBox('必须输入料箱号') return } + // 处理相同料号合并 + var taskList = [] + for (var i = 0; i < this.tempTasks.length; i++) { + var sameIndex = taskList.findIndex(task => task.goodsId == this.tempTasks[i].goodsId) + if (sameIndex != -1) {// 绑定过相同物料 + var sameGoods = taskList[sameIndex] + sameGoods.goodsNum = sameGoods.goodsNum + this.tempTasks[i].goodsNum + } else { + taskList.push({ + vehicleId: this.tempTasks[i].vehicleId, + goodsId: this.tempTasks[i].goodsId, + goodsNum: this.tempTasks[i].goodsNum + }) + } + } const request = { vehicleId: this.currentVehicleId, userName: store.getters.getUserName, - goodsList: this.tempTasks.length > 0 ? this.tempTasks : [], + goodsList: taskList.length > 0 ? taskList : [], } sendGoodsInTask(request).then(res => { loading.close() diff --git a/src/layout/goodsInQR.vue b/src/layout/goodsInQR.vue index a2b00dd..fa9217f 100644 --- a/src/layout/goodsInQR.vue +++ b/src/layout/goodsInQR.vue @@ -216,17 +216,22 @@ export default { type: 'warning', } ).then(() => { - const sameIndex = this.tempTasks.findIndex(task => task.goodsId == this.workFormEntity.goodsId) - if (sameIndex != -1) {// 绑定过相同物料 - var sameGoods = this.tempTasks[sameIndex] - sameGoods.goodsNum = sameGoods.goodsNum + this.workFormEntity.goodsNum - } else { - this.tempTasks.push({ + // const sameIndex = this.tempTasks.findIndex(task => task.goodsId == this.workFormEntity.goodsId) + // if (sameIndex != -1) {// 绑定过相同物料 + // var sameGoods = this.tempTasks[sameIndex] + // sameGoods.goodsNum = sameGoods.goodsNum + this.workFormEntity.goodsNum + // } else { + // this.tempTasks.push({ + // vehicleId: this.workFormEntity.vehicleId, + // goodsId: this.workFormEntity.goodsId, + // goodsNum: this.workFormEntity.goodsNum + // }) + // } + this.tempTasks.push({ vehicleId: this.workFormEntity.vehicleId, goodsId: this.workFormEntity.goodsId, goodsNum: this.workFormEntity.goodsNum }) - } this.currentVehicleId = this.workFormEntity.vehicleId this.workFormEntity.goodsId = '' this.workFormEntity.goodsNum = null @@ -240,17 +245,22 @@ export default { return }) } else { - const sameIndex = this.tempTasks.findIndex(task => task.goodsId == this.workFormEntity.goodsId) - if (sameIndex != -1) {// 绑定过相同物料 - var sameGoods = this.tempTasks[sameIndex] - sameGoods.goodsNum = sameGoods.goodsNum + this.workFormEntity.goodsNum - } else { - this.tempTasks.push({ + // const sameIndex = this.tempTasks.findIndex(task => task.goodsId == this.workFormEntity.goodsId) + // if (sameIndex != -1) {// 绑定过相同物料 + // var sameGoods = this.tempTasks[sameIndex] + // sameGoods.goodsNum = sameGoods.goodsNum + this.workFormEntity.goodsNum + // } else { + // this.tempTasks.push({ + // vehicleId: this.workFormEntity.vehicleId, + // goodsId: this.workFormEntity.goodsId, + // goodsNum: this.workFormEntity.goodsNum + // }) + // } + this.tempTasks.push({ vehicleId: this.workFormEntity.vehicleId, goodsId: this.workFormEntity.goodsId, goodsNum: this.workFormEntity.goodsNum }) - } this.currentVehicleId = this.workFormEntity.vehicleId this.workFormEntity.goodsId = '' this.workFormEntity.goodsNum = null @@ -272,7 +282,7 @@ export default { deleteRowTask(row) {// 删除当前行的入库任务 this.tempTasks.splice(this.tempTasks.indexOf(row), 1) if (this.tempTasks.length == 0) { - this.tempVehicleNo = '' + this.currentVehicleId = '' } }, confirmTask() { @@ -282,10 +292,25 @@ export default { errorBox('必须输入料箱号') return } + // 处理相同料号合并 + var taskList = [] + for (var i = 0; i < this.tempTasks.length; i++) { + var sameIndex = taskList.findIndex(task => task.goodsId == this.tempTasks[i].goodsId) + if (sameIndex != -1) {// 绑定过相同物料 + var sameGoods = taskList[sameIndex] + sameGoods.goodsNum = sameGoods.goodsNum + this.tempTasks[i].goodsNum + } else { + taskList.push({ + vehicleId: this.tempTasks[i].vehicleId, + goodsId: this.tempTasks[i].goodsId, + goodsNum: this.tempTasks[i].goodsNum + }) + } + } const request = { vehicleId: this.currentVehicleId, userName: store.getters.getUserName, - goodsList: this.tempTasks.length > 0 ? this.tempTasks : [], + goodsList: taskList.length > 0 ? taskList : [], } sendGoodsInTask(request).then(res => { loading.close() diff --git a/src/layout/inTaskRecord.vue b/src/layout/inTaskRecord.vue index 579c43c..a58d272 100644 --- a/src/layout/inTaskRecord.vue +++ b/src/layout/inTaskRecord.vue @@ -2,8 +2,12 @@
- - + + + + 搜索 重置 导出记录 @@ -13,8 +17,9 @@ class="table-class" :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"> - - + + @@ -24,7 +29,10 @@ - + + @@ -58,6 +66,22 @@ export default { 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() { @@ -89,7 +113,9 @@ export default { pageSize: this.pageSize, taskType: 1, goodsId: this.goodsIdQuery.trim(), - vehicleId: this.vehicleIdQuery.trim() + vehicleId: this.vehicleIdQuery.trim(), + createTime: timeFormatter(this.createTimeQuery), + finishTime: timeFormatter(this.finishTimeQuery), } getTaskRecords(tableRequest).then(res => { const tableResponse = res.data @@ -108,12 +134,16 @@ export default { 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 => { diff --git a/src/layout/outTaskRecord.vue b/src/layout/outTaskRecord.vue index 53244a1..26bbb86 100644 --- a/src/layout/outTaskRecord.vue +++ b/src/layout/outTaskRecord.vue @@ -3,8 +3,12 @@
- - + + + + 搜索 重置 导出记录 @@ -25,6 +29,8 @@ + @@ -58,7 +64,23 @@ export default { total: 0, goodsIdQuery: '', vehicleIdQuery: '', - loading: true + 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() { @@ -90,7 +112,9 @@ export default { pageSize: this.pageSize, taskType: 2, goodsId: this.goodsIdQuery.trim(), - vehicleId: this.vehicleIdQuery.trim() + vehicleId: this.vehicleIdQuery.trim(), + createTime: timeFormatter(this.createTimeQuery), + finishTime: timeFormatter(this.finishTimeQuery), } getTaskRecords(tableRequest).then(res => { const tableResponse = res.data @@ -102,19 +126,23 @@ export default { } }).catch(err => { console.log(err) - ElMessage.error('查询任务记录错误') + errorBox('查询任务记录错误') }) this.loading = false }, reset() { - this.goodsTypeQuery = '' - this.specificationQuery = '' + 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 => { @@ -135,18 +163,12 @@ export default { document.body.removeChild(link) url.revokeObjectURL(link.href)//移除url对象 } catch (e) { - ElMessage({ - message: '下载文件失败:: ' + e, - type: 'error', - showClose: true - }) + console.log(e) + errorBox('下载文件失败') } }).catch(err => { - ElMessage({ - message: '导出失败:: ' + err, - type: 'error', - showClose: true - }) + console.log(err) + errorBox('导出失败') }) }, }, diff --git a/src/layout/stock.vue b/src/layout/stock.vue index b816f89..1bd9d11 100644 --- a/src/layout/stock.vue +++ b/src/layout/stock.vue @@ -18,6 +18,8 @@ :suffix-icon="Search" /> + 搜索 重置 @@ -28,18 +30,20 @@
+ :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }" + @sort-change="handleSortChange"> - + + sortable="custom" show-overflow-tooltip /> @@ -48,10 +52,10 @@ - - + +