change - add成品出库审核

master
yinq 3 months ago
parent 67f59a344c
commit ed0dc9fcdf

@ -3,7 +3,10 @@ package com.hw.wms.controller;
import java.util.List; import java.util.List;
import java.io.IOException; import java.io.IOException;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.hw.wms.domain.vo.WmsProductOutstockAuditVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
@ -102,4 +105,40 @@ public class WmsProductOutstockController extends BaseController
{ {
return toAjax(wmsProductOutstockService.deleteWmsProductOutstockByProductOutstockIds(productOutstockIds)); return toAjax(wmsProductOutstockService.deleteWmsProductOutstockByProductOutstockIds(productOutstockIds));
} }
/**
* 使
* @param wmsProductOutstock
* @return
*/
@RequiresPermissions("wms:productoutstock:audit:list")
@GetMapping("/auditList")
public TableDataInfo auditList(WmsProductOutstock wmsProductOutstock)
{
startPage();
List<WmsProductOutstock> list = wmsProductOutstockService.selectWmsProductOutstockListAudit(wmsProductOutstock);
return getDataTable(list);
}
/**
* 使
* @param productOutstockId
* @return
*/
@RequiresPermissions("wms:productoutstock:audit:query")
@GetMapping(value = "/getProductOutstockAudit/{productOutstockId}")
public AjaxResult getProductOutstockAudit(@PathVariable("productOutstockId") Long productOutstockId)
{
return success(wmsProductOutstockService.selectGetProductOutstockAuditByProductOutstockId(productOutstockId));
}
/**
*
*/
@RequiresPermissions("wms:productoutstock:audit:audit")
@Log(title = "成品出库记录", businessType = BusinessType.AUDIT)
@PostMapping(("/auditProductOutstock"))
public AjaxResult auditProductOutstock(@Validated @RequestBody WmsProductOutstockAuditVo wmsProductOutstockAuditVo) {
return success(wmsProductOutstockService.auditProductOutstock(wmsProductOutstockAuditVo));
}
} }

@ -0,0 +1,27 @@
package com.hw.wms.domain.vo;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @Description: VO
* @ClassName: WmsRawOutstockAuditVo
* @Author : xins
* @Date :2023-12-21 16:33
* @Version :1.0
*/
@Data
public class WmsProductOutstockAuditVo {
//审核状态
@NotBlank(message = "任务编号必须输入")
private String taskCode;
//审核状态
@NotBlank(message = "审核状态必须输入")
private String auditStatus;
//审核意见
private String auditReason;
}

@ -119,4 +119,26 @@ public interface WmsProductOutstockMapper
* @return * @return
*/ */
List<WmsProductOutstock> selectWmsProductOutstockERPNotSynchronized(WmsProductOutstock wmsProductOutstock); List<WmsProductOutstock> selectWmsProductOutstockERPNotSynchronized(WmsProductOutstock wmsProductOutstock);
/**
* 使
* @param wmsProductOutstock
* @return
*/
List<WmsProductOutstock> selectWmsProductOutstockListAudit(WmsProductOutstock wmsProductOutstock);
/**
*
*
* @param wmsProductOutstock
* @return
*/
public int auditWmsProductOutstockByTaskCode(WmsProductOutstock wmsProductOutstock);
/**
* 使
* @param productOutstockId
* @return
*/
WmsProductOutstock selectGetProductOutstockAuditByProductOutstockId(Long productOutstockId);
} }

@ -3,6 +3,7 @@ package com.hw.wms.service;
import java.util.List; import java.util.List;
import com.hw.wms.domain.WmsProductOutstock; import com.hw.wms.domain.WmsProductOutstock;
import com.hw.wms.domain.vo.WmsProduceInstockVo; import com.hw.wms.domain.vo.WmsProduceInstockVo;
import com.hw.wms.domain.vo.WmsProductOutstockAuditVo;
import com.hw.wms.domain.vo.WmsProductOutstockConfirmVo; import com.hw.wms.domain.vo.WmsProductOutstockConfirmVo;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -94,4 +95,26 @@ public interface IWmsProductOutstockService
* @return * @return
*/ */
public int fourthFloorProduceOutstock(WmsProduceInstockVo wmsProduceInstockVo); public int fourthFloorProduceOutstock(WmsProduceInstockVo wmsProduceInstockVo);
/**
* 使
* @param wmsProductOutstock
* @return
*/
List<WmsProductOutstock> selectWmsProductOutstockListAudit(WmsProductOutstock wmsProductOutstock);
/**
* 使
* @param productOutstockId
* @return
*/
WmsProductOutstock selectGetProductOutstockAuditByProductOutstockId(Long productOutstockId);
/**
*
* @param wmsProductOutstockAuditVo
* @return
*/
public int auditProductOutstock(WmsProductOutstockAuditVo wmsProductOutstockAuditVo);
} }

@ -16,6 +16,7 @@ import com.hw.wms.config.WmsConfig;
import com.hw.wms.domain.WmsBaseWarehouse; import com.hw.wms.domain.WmsBaseWarehouse;
import com.hw.wms.domain.WmsProductStock; import com.hw.wms.domain.WmsProductStock;
import com.hw.wms.domain.vo.WmsProduceInstockVo; import com.hw.wms.domain.vo.WmsProduceInstockVo;
import com.hw.wms.domain.vo.WmsProductOutstockAuditVo;
import com.hw.wms.domain.vo.WmsProductOutstockConfirmVo; import com.hw.wms.domain.vo.WmsProductOutstockConfirmVo;
import com.hw.wms.mapper.WmsBaseWarehouseMapper; import com.hw.wms.mapper.WmsBaseWarehouseMapper;
import com.hw.wms.mapper.WmsProductOutstockDetailMapper; import com.hw.wms.mapper.WmsProductOutstockDetailMapper;
@ -326,6 +327,65 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
} }
/**
* 使
* @param wmsProductOutstock
* @return
*/
@Override
public List<WmsProductOutstock> selectWmsProductOutstockListAudit(WmsProductOutstock wmsProductOutstock) {
return wmsProductOutstockMapper.selectWmsProductOutstockListAudit(wmsProductOutstock);
}
/**
* 使
* @param productOutstockId
* @return
*/
@Override
public WmsProductOutstock selectGetProductOutstockAuditByProductOutstockId(Long productOutstockId) {
WmsProductOutstock wmsProductOutstock = wmsProductOutstockMapper.selectGetProductOutstockAuditByProductOutstockId(productOutstockId);
return wmsProductOutstock;
}
/**
*
* @param wmsProductOutstockAuditVo
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int auditProductOutstock(WmsProductOutstockAuditVo wmsProductOutstockAuditVo) {
String auditStatus = wmsProductOutstockAuditVo.getAuditStatus();
String auditReason = wmsProductOutstockAuditVo.getAuditReason();
String taskCode = wmsProductOutstockAuditVo.getTaskCode();
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
WmsProductOutstock queryProductOutstock = new WmsProductOutstock();
queryProductOutstock.setTaskCode(taskCode);
queryProductOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_TOAUDIT);
List<WmsProductOutstock> wmsProductOutstocks = wmsProductOutstockMapper.selectWmsProductOutstockList(queryProductOutstock);
if (wmsProductOutstocks == null || wmsProductOutstocks.isEmpty()) {
throw new ServiceException("无待审核成品出库记录");
}
//审核不通过,需要有审核意见
if (auditStatus.equalsIgnoreCase(WmsConstants.WMS_AUDIT_STATUS_FAIL)) {
if (StringUtils.isEmpty(auditReason)) {
throw new ServiceException("请输入审核意见");
}
}
WmsProductOutstock wmsProductOutstock = new WmsProductOutstock();
wmsProductOutstock.setAuditStatus(auditStatus);
wmsProductOutstock.setAuditReason(auditReason);
wmsProductOutstock.setAuditBy(userName);
wmsProductOutstock.setAuditDate(currentDate);
wmsProductOutstock.setTaskCode(taskCode);
return wmsProductOutstockMapper.auditWmsProductOutstockByTaskCode(wmsProductOutstock);
}
private static BigDecimal getAvailableAmount(WmsProductStock productStock) { private static BigDecimal getAvailableAmount(WmsProductStock productStock) {
if (productStock == null) { if (productStock == null) {
throw new ServiceException("没有库存信息"); throw new ServiceException("没有库存信息");

@ -325,4 +325,79 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
</select> </select>
<select id="selectWmsProductOutstockListAudit" parameterType="WmsProductOutstock" resultMap="WmsProductOutstockResult">
select wro.product_outstock_id,
wro.task_code,
wro.warehouse_id,
wro.apply_reason,
wro.apply_by,
wro.apply_date,
wro.plan_code,
wro.plan_detail_code,
wro.product_type,
wro.outstock_type,
wro.audit_status,
wbw.warehouse_name
from wms_product_outstock 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="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="applyBy != null and applyBy != ''"> and wro.apply_by like concat('%', #{applyBy}, '%')</if>
</where>
</select>
<select id="selectGetProductOutstockAuditByProductOutstockId" parameterType="Long" resultMap="WmsProductOutstockResult">
select wro.product_outstock_id,
wro.task_code,
wro.warehouse_id,
wro.location_code,
wro.product_type,
wro.operation_type,
wro.outstock_type,
wro.plan_code,
wro.plan_detail_code,
wro.sale_order_id,
wro.saleorder_code,
wro.project_no,
wro.product_id,
wro.product_batch,
wro.apply_qty,
wro.outstock_qty,
wro.apply_reason,
wro.audit_reason,
wro.audit_status,
wro.execute_status,
wro.apply_by,
wro.apply_date,
wro.audit_by,
wro.audit_date,
wro.erp_status,
wro.erp_amount,
wbw.warehouse_name,
mbmi.material_code,
mbmi.material_name
from wms_product_outstock wro
left join wms_base_warehouse wbw on wro.warehouse_id = wbw.warehouse_id
left join mes_base_material_info mbmi on wro.product_id = mbmi.material_id
where wro.product_outstock_id = #{productOutstockId}
</select>
<update id="auditWmsProductOutstockByTaskCode" parameterType="WmsProductOutstock">
update wms_product_outstock
<trim prefix="SET" suffixOverrides=",">
<if test="auditReason != null">audit_reason = #{auditReason},</if>
<if test="auditStatus != null and auditStatus != ''">audit_status = #{auditStatus},</if>
<if test="auditBy != null">audit_by = #{auditBy},</if>
<if test="auditDate != null">audit_date = #{auditDate},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateDate != null">update_date = #{updateDate},</if>
</trim>
where task_code = #{taskCode}
</update>
</mapper> </mapper>

@ -0,0 +1,27 @@
import request from '@/utils/request'
// 查询成品出库记录列表,提供审核使用
export function auditListProductoutstock(query) {
return request({
url: '/wms/productoutstock/auditList',
method: 'get',
params: query
})
}
// 获取成品出库记录详细信息,供审核使用
export function getProductOutstockAudit(productOutstockId) {
return request({
url: '/wms/productoutstock/getProductOutstockAudit/' + productOutstockId,
method: 'get'
})
}
// 审核成品出库记录
export function auditProductOutstock(data) {
return request({
url: '/wms/productoutstock/auditProductOutstock',
method: 'post',
data: data
})
}

@ -525,6 +525,21 @@ export const dynamicRoutes = [
] ]
}, },
{
path: '/wms/product-outstock',
component: Layout,
hidden: true,
permissions: ['wms:productoutstock:info'],
children: [
{
path: 'audit/:taskCode',
component: () => import('@/views/wms/productmanagement/productoutstock/productoutstockDetail'),
name: 'ProductOutStockDetail',
meta: { title: '成品出库审核', activeMenu: '/wms/productmanagement/productoutstock' }
}
]
},
{ {
path: '/wms/raw-outstock', path: '/wms/raw-outstock',
component: Layout, component: Layout,

@ -0,0 +1,288 @@
<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="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="planDetailCode">
<el-input
v-model="queryParams.planDetailCode"
placeholder="请输入计划明细编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="出库类型" prop="outstockType">
<el-select
v-model="queryParams.outstockType"
placeholder="请选择出库类型"
clearable
style="width: 240px"
>
<el-option
v-for="dict in dict.type.wms_product_outstock_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-table v-loading="loading" :data="productoutstockList" @selection-change="handleSelectionChange">
<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="outstockType" >
<template slot-scope="scope">
<dict-tag :options="dict.type.wms_product_outstock_task_type" :value="scope.row.outstockType"/>
</template>
</el-table-column>
<el-table-column label="申请人" align="center" prop="applyBy" />
<el-table-column label="申请原因" align="center" prop="applyReason" />
<el-table-column label="申请时间" align="center" prop="applyDate" width="180">
<template slot-scope="scope">
<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" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-lock"
@click="handleAudit(scope.row)"
v-hasPermi="['wms:rawoutstock:audit:query']"
v-if="scope.row.auditStatus=='0'"
>审核</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { auditListRawoutstock,getWarehouses4Audit } from "@/api/wms/rawoutstock";
import {auditListProductoutstock} from "@/api/wms/productoutstock";
export default {
name: "Productoutstock",
dicts: ['wms_audit_status', 'wms_execute_status', 'wms_product_outstock_task_type'],
data() {
return {
//
loading: true,
//
ids: [],
//
checkedWmsRawOutstockDetail: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
productoutstockList: [],
//
wmsRawOutstockDetailList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
taskCode: null,
warehouseId: null,
locationCode: null,
orderId: null,
planCode: null,
planDetailCode: null,
stationId: null,
productId: null,
materialBatch: null,
palletInfoCode: null,
outstockAmount: null,
realOutstockAmount: null,
endStationCode: null,
operationType: null,
taskType: null,
outstockType: null,
applyReason: null,
auditReason: null,
auditStatus: '0',
executeStatus: null,
applyBy: null,
applyDate: null,
auditBy: null,
auditDate: null,
updateDate: null,
beginTime: null,
endTime: null
},
//
form: {},
//
warehouseOptions: [],
};
},
created() {
this.getList();
this.getWarehouseList();
},
activated() {
const time = this.$route.query.t;
if (time != null && time != this.uniqueId) {
this.uniqueId = time;
this.queryParams.pageNum = Number(this.$route.query.pageNum);
this.getList();
}
},
methods: {
/** 查询成品出库记录列表 */
getList() {
this.loading = true;
auditListProductoutstock(this.queryParams).then(response => {
this.productoutstockList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 查询仓库列表 */
getWarehouseList() {
getWarehouses4Audit().then(response => {
this.warehouseOptions = response.data;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
rawOutstockId: null,
taskCode: null,
warehouseId: null,
locationCode: null,
orderId: null,
planCode: null,
planDetailCode: null,
stationId: null,
productId: null,
materialBatch: null,
palletInfoCode: null,
outstockAmount: null,
realOutstockAmount: null,
endStationCode: null,
operationType: null,
taskType: null,
applyReason: null,
auditReason: null,
auditStatus: null,
executeStatus: null,
applyBy: null,
applyDate: null,
auditBy: null,
auditDate: null,
updateBy: null,
updateDate: null,
beginTime: null,
endTime: null
};
this.wmsRawOutstockDetailList = [];
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.rawOutstockId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加成品出库记录";
},
/** 审核按钮操作 */
handleAudit(row) {
this.reset();
const productOutstockId = row.productOutstockId
const taskCode = row.taskCode
const warehouseName = row.warehouseName;
const params = {pageNum: this.queryParams.pageNum, warehouseName: warehouseName, detailFlag: '0',productOutstockId: productOutstockId};
this.$tab.openPage("成品出库审核[" + taskCode + "]", '/wms/product-outstock/audit/' + taskCode, params);
},
}
};
</script>

@ -0,0 +1,276 @@
<template>
<div class="app-container">
<el-form ref="form" :model="form" label-width="100px">
<el-row>
<el-col :span="8" :offset="2">
<el-form-item label="任务编号" prop="taskCode">
<el-input v-model="form.taskCode" disabled/>
</el-form-item>
</el-col>
<el-col :span="8" :offset="2">
<el-form-item label="仓库" prop="warehouseName">
<el-input v-model="form.warehouseName" disabled/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8" :offset="2">
<el-form-item label="计划编号" prop="planCode">
<el-input v-model="form.planCode" disabled/>
</el-form-item>
</el-col>
<el-col :span="8" :offset="2">
<el-form-item label="明细编号" prop="planDetailCode">
<el-input v-model="form.planDetailCode" disabled/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8" :offset="2">
<el-form-item label="成品编码" prop="materialCode">
<el-input v-model="form.materialCode" 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="productBatch">
<el-input v-model="form.productBatch" disabled/>
</el-form-item>
</el-col>
<el-col :span="8" :offset="2">
<el-form-item label="销售订单编号" prop="saleorderCode">
<el-input v-model="form.saleorderCode" disabled/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8" :offset="2">
<el-form-item label="申请出库数量" prop="applyQty">
<el-input v-model="form.applyQty" disabled/>
</el-form-item>
</el-col>
<el-col :span="8" :offset="2" v-if="detailFlag">
<el-form-item label="已出库数量" prop="outstockQty">
<el-input v-model="form.outstockQty" disabled/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8" :offset="2">
<el-form-item label="申请人" prop="applyBy">
<el-input v-model="form.applyBy" disabled/>
</el-form-item>
</el-col>
<el-col :span="8" :offset="2">
<el-form-item label="申请时间" prop="applyDate">
<el-input v-model="form.applyDate" disabled/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16" :offset="2">
<el-form-item label="申请原因" prop="applyReason">
<el-input v-model="form.applyReason" type="textarea" disabled/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16" :offset="2">
<el-form-item label="出库类型" prop="outstockType">
<template slot-scope="scope">
<dict-tag :options="dict.type.wms_product_outstock_task_type" :value="form.outstockType"/>
</template>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="detailFlag">
<el-col :span="8" :offset="2">
<el-form-item label="审核人" prop="auditBy">
<el-input v-model="form.auditBy" disabled/>
</el-form-item>
</el-col>
<el-col :span="8" :offset="2">
<el-form-item label="审核时间" prop="auditDate">
<el-input v-model="form.auditDate" disabled/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16" :offset="2">
<el-form-item label="审核原因" prop="auditReason">
<el-input v-model="form.auditReason" type="textarea" :disabled="detailFlag"/>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="detailFlag">
<el-col :span="16" :offset="2">
<el-form-item label="同步ERP数量" prop="erpAmount">
<el-input v-model="form.erpAmount" disabled/>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="detailFlag">
<el-col :span="8" :offset="2">
<el-form-item label="审核状态" prop="auditStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.wms_audit_status" :value="form.auditStatus"/>
</template>
</el-form-item>
</el-col>
<el-col :span="8" :offset="2">
<el-form-item label="执行状态" prop="executeStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.wms_execute_status" :value="form.executeStatus"/>
</template>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="auditPass" v-if="!detailFlag"></el-button>
<el-button type="primary" @click="auditFail" v-if="!detailFlag"></el-button>
<el-button @click="cancel"> </el-button>
</div>
</div>
</template>
<script>
import {auditProductOutstock, getProductOutstockAudit} from "@/api/wms/productoutstock";
export default {
name: "ProductoutstockDetail",
dicts: ["wms_audit_status","wms_erp_status","wms_execute_status","wms_product_outstock_task_type"],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
wmsProductOutstockDetailList: [],
//
title: "",
//
open: false,
//
form: {},
//
detailFlag: true
};
},
created() {
const taskCode = this.$route.params && this.$route.params.taskCode;
const productOutstockId = this.$route.query && this.$route.query.productOutstockId;
const detailFlag = this.$route.query && this.$route.query.detailFlag;
const warehouseName = this.$route.query && this.$route.query.warehouseName;
this.form.productOutstockId = productOutstockId;
this.form.taskCode = taskCode;
this.form.warehouseName = warehouseName;
this.detailFlag = detailFlag == "1";
this.getProductOutstock();
},
methods: {
/** 查询成品出库记录列表 */
getProductOutstock() {
this.loading = true;
getProductOutstockAudit(this.form.productOutstockId).then(response => {
this.form = response.data;
this.loading = false;
});
},
//
cancel() {
const obj = {path: "/wms/productmanagement/productoutstock", query: {t: Date.now(), pageNum: this.$route.query.pageNum}};
this.$tab.closeOpenPage(obj);
},
//
reset() {
this.form = {
rawReturnId: null,
taskCode: null,
warehouseId: null,
locationCode: null,
planCode: null,
planDetailCode: null,
productId: null,
materialId: null,
materialBarcode: null,
batchCode: null,
planAmount: null,
returnAmount: null,
operationType: null,
taskType: null,
endStationCode: null,
applyReason: null,
auditReason: null,
auditStatus: null,
executeStatus: null,
applyBy: null,
applyDate: null,
auditBy: null,
auditDate: null,
updateBy: null,
updateDate: null,
beginTime: null,
endTime: null,
erpStatus: null,
erpAmount: null
};
this.wmsProductOutstockDetailList = [];
this.resetForm("form");
},
//
auditPass() {
this.form.auditStatus = "1";
this.submitForm();
},
//
auditFail() {
this.form.auditStatus = "2";
if (!this.form.auditReason || this.form.auditReason == "" || this.form.auditReason == undefined) {
this.$modal.msgWarning("请输入审核原因!");
return;
}
this.submitForm();
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
auditProductOutstock(this.form).then(response => {
this.$modal.msgSuccess("保存成功");
this.cancel();
});
}
});
},
}
};
</script>
Loading…
Cancel
Save