change - add原材料退库记录明细
parent
9abc8cf69c
commit
d41883ce35
@ -0,0 +1,105 @@
|
||||
package com.hw.wms.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.hw.common.log.annotation.Log;
|
||||
import com.hw.common.log.enums.BusinessType;
|
||||
import com.hw.common.security.annotation.RequiresPermissions;
|
||||
import com.hw.wms.domain.WmsRawReturnDetail;
|
||||
import com.hw.wms.service.IWmsRawReturnDetailService;
|
||||
import com.hw.common.core.web.controller.BaseController;
|
||||
import com.hw.common.core.web.domain.AjaxResult;
|
||||
import com.hw.common.core.utils.poi.ExcelUtil;
|
||||
import com.hw.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 原材料退库记录明细Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-09-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/rawReturnDetail")
|
||||
public class WmsRawReturnDetailController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IWmsRawReturnDetailService wmsRawReturnDetailService;
|
||||
|
||||
/**
|
||||
* 查询原材料退库记录明细列表
|
||||
*/
|
||||
@RequiresPermissions("wms:rawReturnDetail:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WmsRawReturnDetail wmsRawReturnDetail)
|
||||
{
|
||||
startPage();
|
||||
List<WmsRawReturnDetail> list = wmsRawReturnDetailService.selectWmsRawReturnDetailList(wmsRawReturnDetail);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出原材料退库记录明细列表
|
||||
*/
|
||||
@RequiresPermissions("wms:rawReturnDetail:export")
|
||||
@Log(title = "原材料退库记录明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WmsRawReturnDetail wmsRawReturnDetail)
|
||||
{
|
||||
List<WmsRawReturnDetail> list = wmsRawReturnDetailService.selectWmsRawReturnDetailList(wmsRawReturnDetail);
|
||||
ExcelUtil<WmsRawReturnDetail> util = new ExcelUtil<WmsRawReturnDetail>(WmsRawReturnDetail.class);
|
||||
util.exportExcel(response, list, "原材料退库记录明细数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取原材料退库记录明细详细信息
|
||||
*/
|
||||
@RequiresPermissions("wms:rawReturnDetail:query")
|
||||
@GetMapping(value = "/{rawReturnDetailId}")
|
||||
public AjaxResult getInfo(@PathVariable("rawReturnDetailId") Long rawReturnDetailId)
|
||||
{
|
||||
return success(wmsRawReturnDetailService.selectWmsRawReturnDetailByRawReturnDetailId(rawReturnDetailId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增原材料退库记录明细
|
||||
*/
|
||||
@RequiresPermissions("wms:rawReturnDetail:add")
|
||||
@Log(title = "原材料退库记录明细", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody WmsRawReturnDetail wmsRawReturnDetail)
|
||||
{
|
||||
return toAjax(wmsRawReturnDetailService.insertWmsRawReturnDetail(wmsRawReturnDetail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改原材料退库记录明细
|
||||
*/
|
||||
@RequiresPermissions("wms:rawReturnDetail:edit")
|
||||
@Log(title = "原材料退库记录明细", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody WmsRawReturnDetail wmsRawReturnDetail)
|
||||
{
|
||||
return toAjax(wmsRawReturnDetailService.updateWmsRawReturnDetail(wmsRawReturnDetail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除原材料退库记录明细
|
||||
*/
|
||||
@RequiresPermissions("wms:rawReturnDetail:remove")
|
||||
@Log(title = "原材料退库记录明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{rawReturnDetailIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] rawReturnDetailIds)
|
||||
{
|
||||
return toAjax(wmsRawReturnDetailService.deleteWmsRawReturnDetailByRawReturnDetailIds(rawReturnDetailIds));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询原材料退库记录明细列表
|
||||
export function listRawReturnDetail(query) {
|
||||
return request({
|
||||
url: '/wms/rawReturnDetail/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询原材料退库记录明细详细
|
||||
export function getRawReturnDetail(rawReturnDetailId) {
|
||||
return request({
|
||||
url: '/wms/rawReturnDetail/' + rawReturnDetailId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增原材料退库记录明细
|
||||
export function addRawReturnDetail(data) {
|
||||
return request({
|
||||
url: '/wms/rawReturnDetail',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改原材料退库记录明细
|
||||
export function updateRawReturnDetail(data) {
|
||||
return request({
|
||||
url: '/wms/rawReturnDetail',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除原材料退库记录明细
|
||||
export function delRawReturnDetail(rawReturnDetailId) {
|
||||
return request({
|
||||
url: '/wms/rawReturnDetail/' + rawReturnDetailId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,372 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
||||
label-width="120px">
|
||||
<el-form-item label="任务编号" prop="taskCode">
|
||||
<el-input
|
||||
v-model="queryParams.taskCode"
|
||||
placeholder="请输入任务编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="warehouseId">
|
||||
<el-select v-model="queryParams.warehouseId" clearable>
|
||||
<el-option
|
||||
v-for="item in warehouseOptions"
|
||||
:key="item.warehouseId"
|
||||
:label="item.warehouseName"
|
||||
:value="item.warehouseId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划编号" prop="planCode">
|
||||
<el-input
|
||||
v-model="queryParams.planCode"
|
||||
placeholder="请输入计划编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="采购订单编号" prop="poNo">
|
||||
<el-input
|
||||
v-model="queryParams.poNo"
|
||||
placeholder="请输入计划明细编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料条码" prop="materialBarcode">
|
||||
<el-input
|
||||
v-model="queryParams.materialBarcode"
|
||||
placeholder="请输入物料条码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编号" prop="materialCode">
|
||||
<el-input
|
||||
v-model="queryParams.materialCode"
|
||||
placeholder="请输入物料条码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="materialName">
|
||||
<el-input
|
||||
v-model="queryParams.materialName"
|
||||
placeholder="请输入物料条码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="退库类型" prop="taskType">-->
|
||||
<!-- <el-select-->
|
||||
<!-- v-model="queryParams.taskType"-->
|
||||
<!-- placeholder="请选择退库类型"-->
|
||||
<!-- clearable-->
|
||||
<!-- style="width: 240px"-->
|
||||
<!-- >-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="dict in dict.type.wms_raw_return_task_type"-->
|
||||
<!-- :key="dict.value"-->
|
||||
<!-- :label="dict.label"-->
|
||||
<!-- :value="dict.value"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<!-- <el-form-item label="申请人" prop="applyBy">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.applyBy"-->
|
||||
<!-- 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="['wms:rawReturnDetail:export']"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="rawReturnDetailList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="任务编号" align="center" prop="taskCode"
|
||||
v-if="columns[0].visible"/>
|
||||
<el-table-column label="计划编号" align="center" prop="planCode"
|
||||
v-if="columns[22].visible"/>
|
||||
<el-table-column label="采购订单编号" align="center" prop="poNo"
|
||||
v-if="columns[24].visible"/>
|
||||
<el-table-column label="仓库名称" align="center" prop="warehouseName"
|
||||
v-if="columns[1].visible"/>
|
||||
<el-table-column label="库位编码" align="center" prop="locationCode"
|
||||
v-if="columns[2].visible"/>
|
||||
<el-table-column label="物料条码" align="center" prop="materialBarcode"
|
||||
v-if="columns[3].visible"/>
|
||||
<el-table-column label="物料编码" align="center" prop="materialCode"
|
||||
v-if="columns[4].visible"/>
|
||||
<el-table-column label="物料名称" align="center" prop="materialName"
|
||||
v-if="columns[5].visible"/>
|
||||
<el-table-column label="物料规格" align="center" prop="materialSpec"
|
||||
v-if="columns[6].visible"/>
|
||||
<el-table-column label="计划数量" align="center" prop="planAmount"
|
||||
v-if="columns[7].visible"/>
|
||||
<el-table-column label="已退库数量" align="center" prop="returnAmount"
|
||||
v-if="columns[8].visible"/>
|
||||
<el-table-column label="单位" align="center" prop="unitName"
|
||||
v-if="columns[23].visible"/>
|
||||
<el-table-column label="执行状态" align="center" prop="executeStatus"
|
||||
v-if="columns[9].visible">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.wms_execute_status" :value="scope.row.executeStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="同步ERP状态" align="center" prop="erpStatus"
|
||||
v-if="columns[10].visible">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.wms_erp_status" :value="scope.row.erpStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="同步给ERP的数量" align="center" prop="erpAmount"
|
||||
v-if="columns[11].visible"/>
|
||||
<el-table-column label="退库人" align="center" prop="returnPerson"
|
||||
v-if="columns[12].visible"/>
|
||||
<el-table-column label="退库时间" align="center" prop="returnTime" width="180"
|
||||
v-if="columns[13].visible">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.returnTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退库方式" align="center" prop="returnWay"
|
||||
v-if="columns[14].visible"/>
|
||||
<el-table-column label="使用机台名称" align="center" prop="machineName"
|
||||
v-if="columns[15].visible"/>
|
||||
<el-table-column label="质检状态" align="center" prop="qualityStatus"
|
||||
v-if="columns[16].visible"/>
|
||||
<el-table-column label="创建时间" align="center" prop="createDate" width="180"
|
||||
v-if="columns[18].visible">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最后更新时间" align="center" prop="updateDate" width="180"
|
||||
v-if="columns[20].visible">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.updateDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="每托数量" align="center" prop="stackAmount"
|
||||
v-if="columns[21].visible"/>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listRawReturnDetail,
|
||||
getRawReturnDetail,
|
||||
} from "@/api/wms/rawReturnDetail";
|
||||
import {getWarehouses} from "@/api/wms/rawreturn";
|
||||
|
||||
export default {
|
||||
name: "RawReturnDetail",
|
||||
dicts: ['wms_audit_status', 'wms_execute_status', 'wms_raw_return_task_type', "wms_erp_status"],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 原材料退库记录明细表格数据
|
||||
rawReturnDetailList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
rawReturnId: null,
|
||||
locationCode: null,
|
||||
materialBarcode: null,
|
||||
materialId: null,
|
||||
instockBatch: null,
|
||||
materialProductionDate: null,
|
||||
planAmount: null,
|
||||
returnAmount: null,
|
||||
executeStatus: null,
|
||||
erpStatus: null,
|
||||
erpAmount: null,
|
||||
returnPerson: null,
|
||||
returnTime: null,
|
||||
returnWay: null,
|
||||
machineName: null,
|
||||
qualityStatus: null,
|
||||
createDate: null,
|
||||
updateDate: null,
|
||||
stackAmount: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
columns: [
|
||||
{key: 0, label: `任务编号`, visible: true},
|
||||
{key: 1, label: `仓库名称`, visible: true},
|
||||
{key: 2, label: `库位编码`, visible: true},
|
||||
{key: 3, label: `物料条码`, visible: true},
|
||||
{key: 4, label: `物料编码`, visible: true},
|
||||
{key: 5, label: `物料名称`, visible: true},
|
||||
{key: 6, label: `物料规格`, visible: true},
|
||||
{key: 7, label: `计划数量`, visible: true},
|
||||
{key: 8, label: `退库数量`, visible: true},
|
||||
{key: 9, label: `执行状态`, visible: true},
|
||||
{key: 10, label: `同步ERP状态`, visible: true},
|
||||
{key: 11, label: `同步给ERP的数量`, visible: true},
|
||||
{key: 12, label: `退库人`, visible: true},
|
||||
{key: 13, label: `退库时间`, visible: true},
|
||||
{key: 14, label: `退库方式`, visible: false},
|
||||
{key: 15, label: `使用机台名称`, visible: false},
|
||||
{key: 16, label: `质检状态`, visible: false},
|
||||
{key: 17, label: `创建人`, visible: true},
|
||||
{key: 18, label: `创建时间`, visible: true},
|
||||
{key: 19, label: `最后更新人`, visible: true},
|
||||
{key: 20, label: `最后更新时间`, visible: true},
|
||||
{key: 21, label: `每托数量`, visible: true},
|
||||
{key: 22, label: `计划编号`, visible: true},
|
||||
{key: 23, label: `单位`, visible: true},
|
||||
{key: 24, label: `采购订单编号`, visible: true},
|
||||
],
|
||||
// 仓库列表
|
||||
warehouseOptions: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getWarehouseList();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询原材料退库记录明细列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listRawReturnDetail(this.queryParams).then(response => {
|
||||
this.rawReturnDetailList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
rawReturnDetailId: null,
|
||||
rawReturnId: null,
|
||||
locationCode: null,
|
||||
materialBarcode: null,
|
||||
materialId: null,
|
||||
instockBatch: null,
|
||||
materialProductionDate: null,
|
||||
planAmount: null,
|
||||
returnAmount: null,
|
||||
executeStatus: null,
|
||||
erpStatus: null,
|
||||
erpAmount: null,
|
||||
returnPerson: null,
|
||||
returnTime: null,
|
||||
returnWay: null,
|
||||
machineName: null,
|
||||
qualityStatus: null,
|
||||
createBy: null,
|
||||
createDate: null,
|
||||
updateBy: null,
|
||||
updateDate: null,
|
||||
stackAmount: 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.rawReturnDetailId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加原材料退库记录明细";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const rawReturnDetailId = row.rawReturnDetailId || this.ids
|
||||
getRawReturnDetail(rawReturnDetailId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改原材料退库记录明细";
|
||||
});
|
||||
},
|
||||
/** 查询仓库列表 */
|
||||
getWarehouseList() {
|
||||
getWarehouses().then(response => {
|
||||
this.warehouseOptions = response.data;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('wms/rawReturnDetail/export', {
|
||||
...this.queryParams
|
||||
}, `rawReturnDetail_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
</script>
|
||||
Loading…
Reference in New Issue