This commit is contained in:
15066119699 2025-03-13 15:13:51 +08:00
parent a5e190a98d
commit 622f507f6a
6 changed files with 317 additions and 224 deletions

View File

@ -59,3 +59,13 @@ export function createOutRequestByPmsOrders(data){
data: data
})
}
//生成波次
export function createWaveRequestByOrders(data){
return request({
url: '/app/task/createWaveRequestByOrders',
method: 'post',
data: data
})
}

View File

@ -0,0 +1,10 @@
import request from '@/utils/request'
// 查询波次构成列表
export function listWaveConstitute(query) {
return request({
url: '/system/waveConstitute/list',
method: 'get',
params: query
})
}

View File

@ -1,214 +0,0 @@
<!-- 物料出库弹窗 -->
<template>
<el-dialog
title="物料出库"
:visible.sync="visible"
width="900px"
append-to-body
destroy-on-close
>
<div class="outbound-table">
<el-table :data="tableData" size="small" border>
<el-table-column label="物料编码" width="280">
<template slot-scope="scope">
<el-autocomplete
v-model="scope.row.materialCode"
:fetch-suggestions="searchMaterials"
:trigger-on-focus="false"
@select="(item) => handleMaterialSelect(item, scope.$index)"
placeholder="请输入物料编码或名称"
clearable
>
<template slot-scope="{ item }">
<div class="material-item">
<div class="material-code">{{ item.code }}</div>
<div class="material-desc">{{ item.description }}</div>
</div>
</template>
</el-autocomplete>
</template>
</el-table-column>
<el-table-column label="物料描述" prop="materialDescription">
<template slot-scope="scope">
<el-input v-model="scope.row.materialDescription" readonly placeholder="物料描述" />
</template>
</el-table-column>
<el-table-column label="出库数量" width="150">
<template slot-scope="scope">
<el-input-number
v-model="scope.row.quantity"
:min="1"
controls-position="right"
placeholder="请输入数量"
/>
</template>
</el-table-column>
<el-table-column label="操作" width="80" align="center">
<template slot-scope="scope">
<el-button
type="text"
icon="el-icon-delete"
@click="removeRow(scope.$index)"
:disabled="tableData.length === 1"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-footer">
<el-button type="primary" icon="el-icon-plus" @click="addRow">新增行</el-button>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="handleSubmit"> </el-button>
</div>
</el-dialog>
</template>
<script>
export default {
name: 'OutboundDialog',
props: {
visible: {
type: Boolean,
default: false
}
},
data() {
return {
tableData: [
{
id: Date.now(),
materialCode: '',
materialDescription: '',
quantity: 1
}
]
}
},
methods: {
//
async searchMaterials(query, callback) {
if (query.length < 2) {
callback([])
return
}
try {
// API
// const { data } = await getMaterialList({ keyword: query })
// callback(data.map(item => ({
// code: item.materialCode,
// description: item.materialName,
// value: item.materialCode
// })))
// 使API
const mockData = [
{ code: 'MAT001', description: '钢板', value: 'MAT001' },
{ code: 'MAT002', description: '铝板', value: 'MAT002' },
{ code: 'MAT003', description: '铜线', value: 'MAT003' }
].filter(item =>
item.code.toLowerCase().includes(query.toLowerCase()) ||
item.description.includes(query)
)
callback(mockData)
} catch (error) {
this.$message.error('获取物料列表失败')
callback([])
}
},
//
handleMaterialSelect(item, index) {
this.$set(this.tableData[index], 'materialCode', item.code)
this.$set(this.tableData[index], 'materialDescription', item.description)
},
//
addRow() {
this.tableData.push({
id: Date.now(),
materialCode: '',
materialDescription: '',
quantity: 1
})
},
//
removeRow(index) {
if (this.tableData.length > 1) {
this.tableData.splice(index, 1)
}
},
//
handleCancel() {
this.$emit('update:visible', false)
this.resetForm()
},
//
handleSubmit() {
//
const invalidRow = this.tableData.find(item =>
!item.materialCode ||
!item.materialDescription ||
!item.quantity ||
item.quantity < 1
)
if (invalidRow) {
this.$message.warning('请填写完整的出库信息')
return
}
//
this.$emit('submit', this.tableData)
this.handleCancel()
},
//
resetForm() {
this.tableData = [
{
id: Date.now(),
materialCode: '',
materialDescription: '',
quantity: 1
}
]
}
}
}
</script>
<style lang="scss" scoped>
.outbound-table {
.material-item {
.material-code {
font-weight: bold;
}
.material-desc {
font-size: 12px;
color: #666;
}
}
.table-footer {
margin-top: 15px;
display: flex;
justify-content: flex-start;
}
}
.el-autocomplete {
width: 100%;
}
.el-input-number {
width: 100%;
}
</style>

View File

@ -101,6 +101,15 @@
@click="handleOut"
>出库</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-coin"
size="mini"
@click="generateWave"
>生成波次</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -133,10 +142,16 @@
<el-table-column label="库存数量" align="center" prop="stockNum" />
<el-table-column label="物料描述" align="center" prop="goodsDesc" />
<el-table-column label="订单状态" align="center" prop="orderStatus" >
<template slot-scope="scope">
<dict-tag :options="dict.type.out_order_status" :value="scope.row.orderStatus"/>
</template>
</el-table-column>
<el-table-column label="生成波次" align="center" prop="generateWave" >
<template slot-scope="scope">
<dict-tag :options="dict.type.generate_wave" :value="scope.row.generateWave"/>
</template>
</el-table-column>
<el-table-column label="是否锁定" align="center" prop="isLock" >
<template slot-scope="scope">
<dict-tag :options="dict.type.stock_or_order_status" :value="scope.row.isLock"/>
@ -227,7 +242,7 @@
<script>
import { listPmsOrderOut, getPmsOrderOut, delPmsOrderOut, addPmsOrderOut, updatePmsOrderOut,createOrderOut,updateOrderOut } from "@/api/system/pmsOrderOut";
import {createOutRequestByPmsOrders} from "@/api/system/task";
import {createOutRequestByPmsOrders,createWaveRequestByOrders} from "@/api/system/task";
import OutboundDialog from './components/OutboundDialog'
import {getToken} from "@/utils/auth";
import { queryListByGoodsId } from "@/api/system/stock";
@ -236,7 +251,7 @@ export default {
components: {
OutboundDialog
},
dicts: ["out_order_type", "out_order_status","stock_or_order_status"],
dicts: ["out_order_type", "out_order_status","stock_or_order_status","generate_wave"],
data() {
return {
@ -455,6 +470,53 @@ export default {
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
generateWave(row){
const recordIds = row.recordId || this.ids;
if (recordIds == "" || recordIds == undefined || recordIds.length == 0) {
this.$modal.msgError("请选择要出库的通知单列表!");
return;
}
var reqArr = [];
var error = false;
for (var j = 0; j < recordIds.length; j++) {
for (var i = 0; i < this.pmsOrderOutList.length; i++) {
if (recordIds[j] == this.pmsOrderOutList[i].recordId) {
if(this.pmsOrderOutList[i].shelvesNum ==0){
this.$modal.msgError("物料号为" + this.pmsOrderOutList[i].goodsId + "已出库完成!");
error = true;
break;
}
if(this.pmsOrderOutList[i].generateWave ==1){
this.$modal.msgError("物料号为" + this.pmsOrderOutList[i].goodsId + "已生成波次!");
error = true;
break;
}
//
this.pmsOrderOutList[i].pickNum = this.pmsOrderOutList[i].goodsNum;
reqArr.push(this.pmsOrderOutList[i]);
break;
}
}
}
if (error) {
return;
}
this.$modal
.confirm("请确认是否生成波次?")
.then(function () {
return createWaveRequestByOrders(reqArr);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("生成波次成功");
})
.catch(() => {
this.$modal.msgSuccess("生成波次异常");
});
},
handleOut(row){
const recordIds = row.recordId || this.ids;
if (recordIds == "" || recordIds == undefined || recordIds.length == 0) {

View File

@ -44,13 +44,13 @@
<el-button
type="primary"
plain
icon="el-icon-plus"
icon="el-icon-user-solid"
size="mini"
@click="handleAdd"
v-hasPermi="['app:wave:add']"
>新增</el-button>
>执行出库</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
@ -71,7 +71,7 @@
@click="handleDelete"
v-hasPermi="['app:wave:remove']"
>删除</el-button>
</el-col>
</el-col> -->
<el-col :span="1.5">
<el-button
type="warning"
@ -88,12 +88,29 @@
<el-table v-loading="loading" :data="waveList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="波次单号" align="center" prop="waveId" />
<el-table-column label="出库规则" align="center" prop="outRule" />
<el-table-column label="是否插队" align="center" prop="isChad" />
<el-table-column label="状态" align="center" prop="waveStatus" />
<el-table-column label="出库规则" align="center" prop="outRule" >
<template slot-scope="scope">
<dict-tag :options="dict.type.out_rule" :value="scope.row.outRule"/>
</template>
</el-table-column>
<el-table-column label="是否插队" align="center" prop="isChad" >
<template slot-scope="scope">
<dict-tag :options="dict.type.cut_in_line" :value="scope.row.isChad"/>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="waveStatus" >
<template slot-scope="scope">
<dict-tag :options="dict.type.out_order_status" :value="scope.row.waveStatus"/>
</template>
</el-table-column>
<el-table-column label="订单WBS" align="center" prop="orderWbs" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="出库口" align="center" prop="waveDestination" />
<el-table-column label="出库口" align="center" prop="waveDestination" >
<template slot-scope="scope">
<dict-tag :options="dict.type.wave_destination" :value="scope.row.waveDestination"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -154,6 +171,7 @@ import { listWave, getWave, delWave, addWave, updateWave } from "@/api/system/wa
export default {
name: "Wave",
dicts: ["wave_destination", "out_rule", "out_order_status","cut_in_line"],
data() {
return {
//

View File

@ -0,0 +1,207 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="波次号" prop="orderWave">
<el-input
v-model="queryParams.orderWave"
placeholder="请输入波次号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料号" prop="goodsId">
<el-input
v-model="queryParams.goodsId"
placeholder="请输入物料号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:waveConstitute:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="waveConstituteList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="波次号" align="center" prop="orderWave" />
<!--<el-table-column label="记录号" align="center" prop="recordId" />-->
<el-table-column label="wms订单号" align="center" prop="orderId" />
<el-table-column label="物料编码" align="center" prop="goodsId" />
<el-table-column label="出库单号" align="center" prop="listId" />
<el-table-column label="出库单类型" align="center" prop="orderType" >
<template slot-scope="scope">
<dict-tag :options="dict.type.out_order_type" :value="scope.row.orderType"/>
</template>
</el-table-column>
<el-table-column label="客户名称" align="center" prop="customerId" />
<el-table-column label="订单出库数量" align="center" prop="goodsNum" />
<el-table-column label="总出库数量" align="center" prop="pickNum" />
<el-table-column label="确认出库数量" align="center" prop="trNum" />
<el-table-column label="确认出库数量" align="center" prop="shelvesNum" />
<el-table-column label="库存数量" align="center" prop="stockNum" />
<el-table-column label="物料描述" align="center" prop="goodsDesc" />
<el-table-column label="订单状态" align="center" prop="orderStatus" >
<template slot-scope="scope">
<dict-tag :options="dict.type.out_order_status" :value="scope.row.orderStatus"/>
</template>
</el-table-column>
<el-table-column label="是否锁定" align="center" prop="isLock" >
<template slot-scope="scope">
<dict-tag :options="dict.type.stock_or_order_status" :value="scope.row.isLock"/>
</template>
</el-table-column>
<!--<el-table-column label="0未生成 1生成波次" align="center" prop="generateWave" />-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listWaveConstitute} from "@/api/system/waveConstitute";
export default {
name: "WaveConstitute",
dicts: ["out_order_type", "out_order_status","stock_or_order_status"],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
waveConstituteList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
generateWave: 1,
goodsId: null,
orderWave: null
},
//
form: {},
//
rules: {
listId: [
{ required: true, message: "出库单号不能为空", trigger: "blur" }
],
orderType: [
{ required: true, message: "出库单类型不能为空", trigger: "change" }
],
goodsId: [
{ required: true, message: "物料号不能为空", trigger: "blur" }
],
goodsNum: [
{ required: true, message: "订单出库数量不能为空", trigger: "blur" }
],
goodsDesc: [
{ required: true, message: "物料描述不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询波次构成列表 */
getList() {
this.loading = true;
listWaveConstitute(this.queryParams).then(response => {
this.waveConstituteList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
recordId: null,
orderId: null,
listId: null,
orderType: null,
customerId: null,
goodsId: null,
goodsNum: null,
pickNum: null,
trNum: null,
shelvesNum: null,
stockNum: null,
goodsDesc: null,
spare1: null,
spare2: null,
orderStatus: null,
isLock: null,
createTime: null,
createBy: null,
updateTime: null,
generateWave: 1,
orderWave: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.recordId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 导出按钮操作 */
handleExport() {
this.download('system/waveConstitute/export', {
...this.queryParams
}, `waveConstitute_${new Date().getTime()}.xlsx`)
}
}
};
</script>