change - 修改原材料退库审核(参照原材料出库审核)

master
yinq 3 months ago
parent 26788889e5
commit 83b4ef2ab9

@ -94,14 +94,15 @@ public class WmsRawReturnController extends BaseController
/**
* 退
* 退
*/
@RequiresPermissions("wms:rawreturn:audit:list")
@GetMapping("/auditList")
public TableDataInfo auditList(WmsRawReturn wmsRawReturn)
{
startPage();
List<WmsRawReturn> list = wmsRawReturnService.selectWmsRawReturnJoinList(wmsRawReturn);
// List<WmsRawReturn> list = wmsRawReturnService.selectWmsRawReturnJoinList(wmsRawReturn); //旧版不group by
List<WmsRawReturn> list = wmsRawReturnService.selectWmsAuditList(wmsRawReturn);
return getDataTable(list);
}
@ -135,4 +136,17 @@ public class WmsRawReturnController extends BaseController
List<WmsBaseWarehouse> warehouses = wmsBaseWarehouseService.selectWmsBaseWarehouseList(queryWarehouse);
return success(warehouses);
}
/**
* 退
*
* @param taskCode 退
* @return 退VO
*/
@RequiresPermissions("wms:rawreturn:audit:query")
@GetMapping(value = "/getRawReturnByTaskCode/{taskCode}")
public AjaxResult getRawReturnByTaskCode(@PathVariable("taskCode") String taskCode) {
return success(wmsRawReturnService.selectGetRawReturnByTaskCode(taskCode));
}
}

@ -0,0 +1,23 @@
package com.hw.wms.domain.vo;
import com.hw.wms.domain.WmsRawReturn;
import lombok.Data;
import java.util.List;
/**
* 退VO
*/
@Data
public class WmsRawReturnAuditReturnVo {
private String taskCode;
private WmsRawReturn wmsRawReturn;
/**
* 退
*/
private List<WmsRawReturn> wmsRawReturnDetailList;
}

@ -112,4 +112,19 @@ public interface WmsRawReturnMapper
*/
public int batchWmsRawReturn(List<WmsRawReturn> wmsRawReturnList);
/**
* 退
*
* @param wmsRawReturn 退
* @return 退
*/
List<WmsRawReturn> selectWmsAuditList(WmsRawReturn wmsRawReturn);
/**
* 退
*
* @param queryRawReturn 退
* @return 退VO
*/
List<WmsRawReturn> selectGetRawReturnByTaskCode(WmsRawReturn queryRawReturn);
}

@ -3,6 +3,7 @@ package com.hw.wms.service;
import java.util.List;
import com.hw.wms.domain.WmsRawReturn;
import com.hw.wms.domain.WmsRawReturnDetail;
import com.hw.wms.domain.vo.WmsRawReturnAuditReturnVo;
import com.hw.wms.domain.vo.WmsRawReturnAuditVo;
import com.hw.wms.domain.vo.WmsRawReturnConfirmVo;
import org.springframework.transaction.annotation.Transactional;
@ -119,4 +120,20 @@ public interface IWmsRawReturnService
* @return
*/
public int directRawReturn(WmsRawReturn wmsRawReturn);
/**
* 退
*
* @param taskCode 退
* @return 退VO
*/
public WmsRawReturnAuditReturnVo selectGetRawReturnByTaskCode(String taskCode);
/**
* 退
*
* @param wmsRawReturn 退
* @return 退
*/
List<WmsRawReturn> selectWmsAuditList(WmsRawReturn wmsRawReturn);
}

@ -15,10 +15,7 @@ import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.api.domain.vo.MesBaseMaterialInfoVo;
import com.hw.wms.domain.*;
import com.hw.wms.domain.vo.WmsRawOutstockAuditVo;
import com.hw.wms.domain.vo.WmsRawOutstockConfirmVo;
import com.hw.wms.domain.vo.WmsRawReturnAuditVo;
import com.hw.wms.domain.vo.WmsRawReturnConfirmVo;
import com.hw.wms.domain.vo.*;
import com.hw.wms.mapper.*;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -589,4 +586,36 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
return 1;
}
/**
* 退
*
* @param wmsRawReturn 退
* @return 退
*/
@Override
public List<WmsRawReturn> selectWmsAuditList(WmsRawReturn wmsRawReturn) {
return wmsRawReturnMapper.selectWmsAuditList(wmsRawReturn);
}
/**
* 退
*
* @param taskCode 退
* @return 退VO
*/
@Override
public WmsRawReturnAuditReturnVo selectGetRawReturnByTaskCode(String taskCode) {
WmsRawReturnAuditReturnVo wmsRawReturnAuditReturnVo = new WmsRawReturnAuditReturnVo();
WmsRawReturn queryRawReturn = new WmsRawReturn();
queryRawReturn.setTaskCode(taskCode);
List<WmsRawReturn> wmsRawReturnList = wmsRawReturnMapper.selectGetRawReturnByTaskCode(queryRawReturn);
if (wmsRawReturnList.size() > 0){
WmsRawReturn wmsRawReturn = wmsRawReturnList.get(0);
wmsRawReturnAuditReturnVo.setWmsRawReturn(wmsRawReturn);
wmsRawReturnAuditReturnVo.setWmsRawReturnDetailList(wmsRawReturnList);
}
return wmsRawReturnAuditReturnVo;
}
}

@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="erpAmount" column="erp_amount" />
<result property="warehouseName" column="warehouse_name" />
<result property="materialName" column="material_name" />
</resultMap>
<resultMap id="WmsRawReturnWmsRawReturnDetailResult" type="WmsRawReturn" extends="WmsRawReturnResult">
@ -273,6 +274,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where wrr.raw_return_id = #{rawReturnId}
</select>
<select id="selectWmsAuditList" parameterType="WmsRawReturn" resultMap="WmsRawReturnResult">
select wro.task_code,
wro.warehouse_id,
wbw.warehouse_name,
wro.plan_code,
wro.plan_detail_code,
wro.material_barcode,
wro.plan_amount,
wro.task_type,
wro.apply_reason,
wro.apply_by,
wro.apply_date,
wro.audit_status
from wms_raw_return wro
left join wms_base_warehouse wbw on wro.warehouse_id = wbw.warehouse_id
<where>
<if test="taskCode != null and taskCode != ''"> and wro.task_code like concat('%', #{taskCode}, '%')</if>
<if test="warehouseId != null "> and wro.warehouse_id = #{warehouseId}</if>
<if test="planCode != null "> and wro.plan_code like concat('%', #{planCode}, '%')</if>
<if test="planDetailCode != null "> and wro.plan_detail_code like concat('%', #{planDetailCode}, '%')</if>
<if test="materialBarcode != null and materialBarcode != '' "> and wro.material_barcode like concat('%', #{materialBarcode}, '%')</if>
<if test="applyReason != null and applyReason != ''"> and wro.apply_reason like concat('%', #{applyReason}, '%')</if>
<if test="auditStatus != null and auditStatus != ''"> and wro.audit_status = #{auditStatus}</if>
<if test="taskType != null and taskType != ''"> and wro.task_type = #{taskType}</if>
<if test="applyBy != null and applyBy != ''"> and wro.apply_by like concat('%', #{applyBy}, '%')</if>
</where>
group by wro.task_code, wro.warehouse_id, wbw.warehouse_name, wro.plan_code, wro.plan_detail_code,
wro.material_barcode, wro.plan_amount, wro.task_type, wro.apply_reason, wro.apply_by, wro.apply_date,
wro.audit_status
</select>
<select id="selectGetRawReturnByTaskCode" parameterType="WmsRawReturn" resultMap="WmsRawReturnResult">
select wrr.raw_return_id,
wrr.task_code,
wrr.warehouse_id,
wrr.location_code,
wrr.material_id,
mbmi.material_name,
wrr.batch_code,
wrr.plan_amount,
wrr.return_amount,
wrr.execute_status,
wrr.apply_reason,
wrr.apply_by,
wrr.apply_date,
wrr.plan_code,
wrr.plan_detail_code,
wrr.audit_status,
wrr.task_type,
wbw.warehouse_name
from wms_raw_return wrr
left join mes_base_material_info mbmi on wrr.material_id = mbmi.material_id
left join wms_base_warehouse wbw on wrr.warehouse_id = wbw.warehouse_id
<where>
<if test="taskCode != null and taskCode != ''"> and wrr.task_code like concat('%', #{taskCode}, '%')</if>
<if test="warehouseId != null "> and wrr.warehouse_id = #{warehouseId}</if>
<if test="planCode != null "> and wrr.plan_code like concat('%', #{planCode}, '%')</if>
<if test="auditStatus != null and auditStatus != ''"> and wrr.audit_status = #{auditStatus}</if>
<if test="applyBy != null and applyBy != ''"> and wrr.apply_by like concat('%', #{applyBy}, '%')</if>
</where>
</select>
<insert id="batchWmsRawReturn">
insert into wms_raw_return( raw_return_id, task_code, warehouse_id, location_code, plan_code, plan_detail_code, product_id, material_id, plan_amount, return_amount, operation_type, task_type, apply_reason, audit_reason, audit_status, execute_status, apply_by, apply_date, audit_by, audit_date, update_by, update_date, begin_time, end_time, material_barcode, end_station_code, batch_code) values
<foreach item="item" index="index" collection="list" separator=",">

@ -94,3 +94,11 @@ export function getWarehouses() {
method: 'get'
})
}
// 查询原材料退库记录
export function getRawReturnByTaskCode(taskCode) {
return request({
url: '/wms/rawreturn/getRawReturnByTaskCode/' + taskCode,
method: 'get'
})
}

@ -77,10 +77,10 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="任务编号" align="center" prop="taskCode" />
<el-table-column label="仓库" align="center" prop="warehouseName" />
<el-table-column label="计划编号" align="center" prop="planCode" />
<el-table-column label="计划明细编号" align="center" prop="planDetailCode" />
<el-table-column label="物料条码" align="center" prop="materialBarcode" />
<el-table-column label="计划退库数量" align="center" prop="planAmount" />
<el-table-column label="计划编号" align="center" prop="planCode" width="100"/>
<el-table-column label="计划明细编号" align="center" prop="planDetailCode" width="100"/>
<el-table-column label="物料条码" align="center" prop="materialBarcode" width="100"/>
<el-table-column label="计划退库数量" align="center" prop="planAmount" width="100"/>
<el-table-column label="任务类型" align="center" prop="taskType" >
<template slot-scope="scope">
<dict-tag :options="dict.type.wms_raw_return_task_type" :value="scope.row.taskType"/>
@ -92,6 +92,11 @@
<span>{{ parseTime(scope.row.applyDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="审核状态" align="center" prop="auditStatus" >
<template slot-scope="scope">
<dict-tag :options="dict.type.wms_audit_status" :value="scope.row.auditStatus"/>
</template>
</el-table-column>
<el-table-column label="申请原因" align="center" prop="applyReason" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
@ -239,7 +244,7 @@ export default {
const rawReturnId = row.rawReturnId
const taskCode = row.taskCode
const warehouseName = row.warehouseName;
const params = {pageNum: this.queryParams.pageNum};
const params = {pageNum: this.queryParams.pageNum, taskCode: taskCode};
this.$tab.openPage("退库审核[" + taskCode + "]", '/wms/raw-return/audit/' + rawReturnId+'/0/'+warehouseName, params);
},

@ -27,45 +27,6 @@
</el-col>
</el-row>
<el-row>
<el-col :span="8" :offset="2">
<el-form-item label="成品名称" prop="productName">
<el-input v-model="form.productName" disabled/>
</el-form-item>
</el-col>
<el-col :span="8" :offset="2">
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="form.materialName" disabled/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8" :offset="2">
<el-form-item label="物料条码" prop="materialBarcode">
<el-input v-model="form.materialBarcode" disabled/>
</el-form-item>
</el-col>
<el-col :span="8" :offset="2">
<el-form-item label="批次码" prop="batchCode">
<el-input v-model="form.batchCode" disabled/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8" :offset="2">
<el-form-item label="计划退库数量" prop="planAmount">
<el-input v-model="form.planAmount" disabled/>
</el-form-item>
</el-col>
<el-col :span="8" :offset="2" v-if="detailFlag">
<el-form-item label="已退库数量" prop="returnAmount">
<el-input v-model="form.returnAmount" disabled/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8" :offset="2">
<el-form-item label="申请人" prop="applyBy">
@ -142,7 +103,27 @@
</el-col>
</el-row>
<el-divider content-position="center">原材料退库明细信息</el-divider>
<el-table :data="wmsRawReturnDetailList" :row-class-name="rowWmsRawReturnDetailIndex"
ref="wmsRawReturnDetail">
<el-table-column label="序号" align="center" prop="index" width="50"/>
<el-table-column label="库位编码" prop="locationCode"/>
<el-table-column label="物料名称" prop="materialName"/>
<el-table-column label="物料批次" prop="batchCode"/>
<el-table-column label="计划数量" prop="planAmount"/>
<el-table-column label="已退库数量" prop="returnAmount" v-if="detailFlag"/>
<el-table-column label="执行状态" prop="executeStatus" v-if="detailFlag">
<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状态" prop="erpStatus" v-if="detailFlag">
<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数量" prop="erpAmount" v-if="detailFlag"/>
</el-table>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="auditPass" v-if="!detailFlag"></el-button>
@ -153,7 +134,7 @@
</template>
<script>
import {auditRawReturn, getRawreturn4Audit} from "@/api/wms/rawreturn";
import {auditRawReturn, getRawReturnByTaskCode} from "@/api/wms/rawreturn";
export default {
name: "Rawreturn",
@ -184,15 +165,13 @@ export default {
open: false,
//
form: {},
//
detailFlag: true,
rawReturnId: null,
};
},
created() {
const rawReturnId = this.$route.params && this.$route.params.rawReturnId;
const taskCode = this.$route.params && this.$route.params.taskCode;
const taskCode = this.$route.query && this.$route.query.taskCode;
const detailFlag = this.$route.params && this.$route.params.detailFlag;
const warehouseName = this.$route.params && this.$route.params.warehouseName;
this.detailFlag = detailFlag == "1";
@ -205,8 +184,10 @@ export default {
/** 查询原材料退库记录列表 */
getRawReturn() {
this.loading = true;
getRawreturn4Audit(this.rawReturnId).then(response => {
this.form = response.data;
getRawReturnByTaskCode(this.form.taskCode).then(response => {
this.form = response.data.wmsRawReturn;
this.wmsRawReturnDetailList = response.data.wmsRawReturnDetailList;
console.log(this.wmsRawReturnDetailList)
this.form.warehouseName = this.warehouseName;
this.loading = false;
});
@ -257,7 +238,10 @@ export default {
this.form.auditStatus = "1";
this.submitForm();
},
/** 原材料出库记录明细序号 */
rowWmsRawReturnDetailIndex({row, rowIndex}) {
row.index = rowIndex + 1;
},
auditFail() {
this.form.auditStatus = "2";
if (!this.form.auditReason || this.form.auditReason == "" || this.form.auditReason == undefined) {

Loading…
Cancel
Save