diff --git a/src/api/system/pmsOrderOut.js b/src/api/system/pmsOrderOut.js index cb77da4..cbaeb8b 100644 --- a/src/api/system/pmsOrderOut.js +++ b/src/api/system/pmsOrderOut.js @@ -17,6 +17,13 @@ export function getPmsOrderOut(recordId) { }) } +export function selectList(orderWave) { + return request({ + url: '/app/pmsOrderOut/selectList/' + orderWave, + method: 'get' + }) +} + // 新增出库单 export function addPmsOrderOut(data) { return request({ diff --git a/src/api/system/task.js b/src/api/system/task.js index 154b1d7..8105250 100644 --- a/src/api/system/task.js +++ b/src/api/system/task.js @@ -68,4 +68,11 @@ export function createWaveRequestByOrders(data){ data: data }) } - +//执行波次 +export function createWaveOutRequest(data){ + return request({ + url: '/app/task/createWaveOutRequest', + method: 'post', + data: data + }) +} diff --git a/src/views/system/location/index.vue b/src/views/system/location/index.vue index c875f77..8178307 100644 --- a/src/views/system/location/index.vue +++ b/src/views/system/location/index.vue @@ -33,6 +33,14 @@
diff --git a/src/views/system/wave/index.vue b/src/views/system/wave/index.vue index 03ffa78..7876641 100644 --- a/src/views/system/wave/index.vue +++ b/src/views/system/wave/index.vue @@ -9,15 +9,8 @@ @keyup.enter.native="handleQuery" /> - - - - + + - - - + 搜索 重置 @@ -42,11 +28,11 @@ 执行出库 @@ -85,7 +71,7 @@ - + @@ -100,7 +86,7 @@ @@ -130,7 +116,21 @@ - + + + + + + + + + + + + + import { listWave, getWave, delWave, addWave, updateWave } from "@/api/system/wave"; - +import { selectList } from "@/api/system/pmsOrderOut" +import { createWaveOutRequest } from "@/api/system/task" export default { name: "Wave", - dicts: ["wave_destination", "out_rule", "out_order_status","cut_in_line"], + dicts: ["wave_destination", "out_rule", "wave_status","cut_in_line"], data() { return { // 遮罩层 @@ -188,6 +189,8 @@ export default { total: 0, // 【请填写功能名称】表格数据 waveList: [], + materialList: [], // 出库物料明细 + selectedWaveId: null, // 选中的波次单号 // 弹出层标题 title: "", // 是否显示弹出层 @@ -225,6 +228,66 @@ export default { this.getList(); }, methods: { + handleOut(row){ + const waveIds = row.waveId || this.ids; + if (waveIds == "" || waveIds == undefined || waveIds.length == 0) { + this.$modal.msgError("请选择要出库的波次单!"); + return; + } + if(waveIds.length > 1){ + this.$modal.msgError("只能选择一个波次单进行出库!"); + return; + } + var reqArr = {}; + var error = false; + + for (var j = 0; j < waveIds.length; j++) { + for (var i = 0; i < this.waveList.length; i++) { + if (waveIds[j] == this.waveList[i].waveId) { + if(this.waveList[i].waveStatus !== 0){ + this.$modal.msgError("波次号为" + this.waveList[i].waveId + "已执行出库!"); + error = true; + break; + } + + reqArr = this.waveList[i]; + break; + } + } + } + if (error) { + return; + } + + this.$modal + .confirm("请确认是否执行该波次?") + .then(function () { + return createWaveOutRequest(reqArr); + }) + .then(() => { + this.getList(); + this.$modal.msgSuccess("波次出库任务创建成功"); + }) + .catch(() => { + this.$modal.msgSuccess("波次出库任务创建异常"); + }); + }, + // 处理行点击事件 + handleRowClick(row) { + this.selectedWaveId = row.waveId; // 记录选中的波次单号 + this.getMaterialList(row.waveId); // 获取物料明细 + }, + + // 获取出库物料明细 + getMaterialList(waveId) { + + selectList(waveId).then(response => { + this.materialList = response.data || []; + }).catch(error => { + this.$message.error("获取物料明细失败:" + error.message); + }); + }, + /** 查询【请填写功能名称】列表 */ getList() { this.loading = true; diff --git a/src/views/system/waveConstitute/index.vue b/src/views/system/waveConstitute/index.vue index 9d40472..394b57d 100644 --- a/src/views/system/waveConstitute/index.vue +++ b/src/views/system/waveConstitute/index.vue @@ -40,6 +40,7 @@ +