Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -5,17 +5,12 @@ import java.util.List;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import com.ruoyi.check.stockcheck.domain.CheckStockVo;
|
||||||
import com.ruoyi.check.stockcheckfinish.service.ICheckStockinFinishService;
|
import com.ruoyi.check.stockcheckfinish.service.ICheckStockinFinishService;
|
||||||
|
import com.ruoyi.out.outStockout.domain.OutStockoutVo;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
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.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
@@ -100,7 +95,7 @@ public class CheckStockinController extends BaseController
|
|||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody CheckStockin checkStockin)
|
public AjaxResult edit(@RequestBody CheckStockin checkStockin)
|
||||||
{
|
{
|
||||||
return toAjax(checkStockinService.updateCheckStockin(checkStockin));
|
return checkStockinService.updateCheckStockin(checkStockin);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -113,4 +108,18 @@ public class CheckStockinController extends BaseController
|
|||||||
{
|
{
|
||||||
return toAjax(checkStockinService.deleteCheckStockinByStockGuids(stockGuids));
|
return toAjax(checkStockinService.deleteCheckStockinByStockGuids(stockGuids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库单据保存
|
||||||
|
*
|
||||||
|
* @param checkStockVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Log(title = "盘点主单保存", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/saveBill")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult saveBill(@RequestBody CheckStockVo checkStockVo) {
|
||||||
|
String stockOutId = checkStockinService.saveBill(checkStockVo);
|
||||||
|
return AjaxResult.success(stockOutId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.ruoyi.check.stockcheck.domain;
|
||||||
|
|
||||||
|
import com.ruoyi.check.stockcheckdetail.domain.CheckStockinDetail;
|
||||||
|
import com.ruoyi.out.outStockout.domain.OutStockout;
|
||||||
|
import com.ruoyi.out.outStockoutDetail.domain.OutStockoutDetail;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class CheckStockVo {
|
||||||
|
|
||||||
|
private CheckStockin checkStockin;
|
||||||
|
|
||||||
|
private List<CheckStockinDetail> detailList;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -58,4 +58,6 @@ public interface CheckStockinMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteCheckStockinByStockGuids(String[] stockGuids);
|
public int deleteCheckStockinByStockGuids(String[] stockGuids);
|
||||||
|
|
||||||
|
void insertCheckStockinHistory(CheckStockin checkStockin);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
package com.ruoyi.check.stockcheck.service;
|
package com.ruoyi.check.stockcheck.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.check.stockcheck.domain.CheckStockVo;
|
||||||
import com.ruoyi.check.stockcheck.domain.CheckStockin;
|
import com.ruoyi.check.stockcheck.domain.CheckStockin;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.out.outStockout.domain.OutStockoutVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 盘库单据主信息Service接口
|
* 盘库单据主信息Service接口
|
||||||
@@ -41,7 +45,7 @@ public interface ICheckStockinService
|
|||||||
* @param checkStockin 盘库单据主信息
|
* @param checkStockin 盘库单据主信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateCheckStockin(CheckStockin checkStockin);
|
public AjaxResult updateCheckStockin(CheckStockin checkStockin);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除盘库单据主信息
|
* 批量删除盘库单据主信息
|
||||||
@@ -58,4 +62,6 @@ public interface ICheckStockinService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteCheckStockinByStockGuid(String stockGuid);
|
public int deleteCheckStockinByStockGuid(String stockGuid);
|
||||||
|
|
||||||
|
String saveBill(CheckStockVo outStockoutVo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,32 @@
|
|||||||
package com.ruoyi.check.stockcheck.service.impl;
|
package com.ruoyi.check.stockcheck.service.impl;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ruoyi.bas.BasProduct.domain.BasProduct;
|
||||||
|
import com.ruoyi.bas.BasProduct.service.IBasProductService;
|
||||||
|
import com.ruoyi.bas.basJobId.service.IBasJobIdService;
|
||||||
|
import com.ruoyi.check.stockcheck.domain.CheckStockVo;
|
||||||
|
import com.ruoyi.check.stockcheckdetail.domain.CheckStockinDetail;
|
||||||
|
import com.ruoyi.check.stockcheckdetail.service.ICheckStockinDetailService;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.utils.uuid.UUID;
|
||||||
|
import com.ruoyi.in.stockin.domain.InStockin;
|
||||||
|
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
|
||||||
|
import com.ruoyi.out.outStockout.domain.OutStockout;
|
||||||
|
import com.ruoyi.out.outStockout.domain.OutStockoutVo;
|
||||||
|
import com.ruoyi.out.outStockoutDetail.domain.OutStockoutDetail;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.check.stockcheck.mapper.CheckStockinMapper;
|
import com.ruoyi.check.stockcheck.mapper.CheckStockinMapper;
|
||||||
import com.ruoyi.check.stockcheck.domain.CheckStockin;
|
import com.ruoyi.check.stockcheck.domain.CheckStockin;
|
||||||
import com.ruoyi.check.stockcheck.service.ICheckStockinService;
|
import com.ruoyi.check.stockcheck.service.ICheckStockinService;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 盘库单据主信息Service业务层处理
|
* 盘库单据主信息Service业务层处理
|
||||||
@@ -18,6 +39,12 @@ public class CheckStockinServiceImpl implements ICheckStockinService
|
|||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private CheckStockinMapper checkStockinMapper;
|
private CheckStockinMapper checkStockinMapper;
|
||||||
|
@Autowired
|
||||||
|
private IBasJobIdService basJobIdService;
|
||||||
|
@Autowired
|
||||||
|
private ICheckStockinDetailService checkStockinDetailService;
|
||||||
|
@Autowired
|
||||||
|
private IBasProductService productService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询盘库单据主信息
|
* 查询盘库单据主信息
|
||||||
@@ -62,9 +89,49 @@ public class CheckStockinServiceImpl implements ICheckStockinService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateCheckStockin(CheckStockin checkStockin)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public AjaxResult updateCheckStockin(CheckStockin checkStockin)
|
||||||
{
|
{
|
||||||
return checkStockinMapper.updateCheckStockin(checkStockin);
|
CheckStockin old = selectCheckStockinByStockGuid(checkStockin.getStockGuid());
|
||||||
|
checkStockinMapper.updateCheckStockin(checkStockin);
|
||||||
|
if ("5".equals(checkStockin.getStatus())){
|
||||||
|
//作废
|
||||||
|
if (!"1".equals(old.getStatus())){
|
||||||
|
throw new RuntimeException("单据状态非未执行状态!");
|
||||||
|
}
|
||||||
|
//插入历史单据
|
||||||
|
insertCheckStockinHistory(checkStockin);
|
||||||
|
}else if ("2".equals(checkStockin.getStatus())){
|
||||||
|
//审核
|
||||||
|
if (!"1".equals(old.getStatus())){
|
||||||
|
throw new RuntimeException("单据状态非未执行状态!");
|
||||||
|
}
|
||||||
|
}else if ("4".equals(checkStockin.getStatus())){
|
||||||
|
//确认
|
||||||
|
if (!"3".equals(old.getStatus())){
|
||||||
|
throw new RuntimeException("单据状态非正执行状态!");
|
||||||
|
}
|
||||||
|
//对比扫码数量 与实际入库数量是否一致
|
||||||
|
CheckStockinDetail checkStockinParam = new CheckStockinDetail();
|
||||||
|
checkStockinParam.setStockCheckGuid(checkStockin.getStockGuid());
|
||||||
|
List<CheckStockinDetail> list = checkStockinDetailService.selectCheckStockinDetailList(checkStockinParam);
|
||||||
|
if (CollUtil.isNotEmpty(list)){
|
||||||
|
boolean b = list.stream().allMatch(x -> x.getAssignNum().equals(x.getScanNum()));
|
||||||
|
if (!b){
|
||||||
|
throw new RuntimeException("扫码数量与实际入库数量不一致!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
insertCheckStockinHistory(checkStockin);
|
||||||
|
}
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void insertCheckStockinHistory(CheckStockin checkStockin) {
|
||||||
|
//插入历史单据
|
||||||
|
checkStockinMapper.insertCheckStockinHistory(checkStockin);
|
||||||
|
checkStockinDetailService.insertCheckStockinDetailHistory(checkStockin);
|
||||||
|
checkStockinMapper.deleteCheckStockinByStockGuid(checkStockin.getStockGuid());
|
||||||
|
checkStockinDetailService.deleteCheckStockinDetailByStockinGuid(checkStockin.getStockGuid());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -90,4 +157,33 @@ public class CheckStockinServiceImpl implements ICheckStockinService
|
|||||||
{
|
{
|
||||||
return checkStockinMapper.deleteCheckStockinByStockGuid(stockGuid);
|
return checkStockinMapper.deleteCheckStockinByStockGuid(stockGuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public String saveBill(CheckStockVo checkStockVo) {
|
||||||
|
CheckStockin checkStockin = checkStockVo.getCheckStockin();
|
||||||
|
List<CheckStockinDetail> detailList = checkStockVo.getDetailList();
|
||||||
|
String stockCheckId = basJobIdService.getJobId("CKD");
|
||||||
|
checkStockin.setStockCheckId(stockCheckId);
|
||||||
|
checkStockin.setStockGuid(IdUtil.simpleUUID());
|
||||||
|
checkStockin.setCreateDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
||||||
|
String username = SecurityContextHolder.getContext().getAuthentication().getName();
|
||||||
|
checkStockin.setCreateManId(username);
|
||||||
|
checkStockin.setStatus("1");
|
||||||
|
checkStockin.setStockSource("0");
|
||||||
|
checkStockin.setCheckType(checkStockin.getCheckType());
|
||||||
|
for (int i = 0; i < detailList.size(); i++) {
|
||||||
|
CheckStockinDetail checkStockinDetail = detailList.get(i);
|
||||||
|
checkStockinDetail.setStockCheckDetailId(stockCheckId + "-" + (i + 1));
|
||||||
|
checkStockinDetail.setStockCheckId(stockCheckId);
|
||||||
|
BasProduct basProduct = productService.selectBasProductByProductId(checkStockinDetail.getProductId());
|
||||||
|
checkStockinDetail.setProductGuid(basProduct.getProductGuid());
|
||||||
|
checkStockinDetail.setStockCheckGuid(checkStockin.getStockGuid());
|
||||||
|
checkStockinDetail.setScanNum("0");
|
||||||
|
checkStockinDetail.setAssignNum("0");
|
||||||
|
checkStockinDetailService.insertCheckStockinDetail(checkStockinDetail);
|
||||||
|
}
|
||||||
|
checkStockinMapper.insertCheckStockin(checkStockin);
|
||||||
|
return stockCheckId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.ruoyi.check.stockcheckdetail.mapper;
|
package com.ruoyi.check.stockcheckdetail.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.check.stockcheck.domain.CheckStockin;
|
||||||
import com.ruoyi.check.stockcheckdetail.domain.CheckStockinDetail;
|
import com.ruoyi.check.stockcheckdetail.domain.CheckStockinDetail;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -58,4 +60,8 @@ public interface CheckStockinDetailMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteCheckStockinDetailByStockCheckDetailIds(String[] stockCheckDetailIds);
|
public int deleteCheckStockinDetailByStockCheckDetailIds(String[] stockCheckDetailIds);
|
||||||
|
|
||||||
|
void insertCheckStockinDetailHistory(CheckStockin checkStockin);
|
||||||
|
|
||||||
|
void deleteCheckStockinDetailByStockinGuid(String stockGuid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.ruoyi.check.stockcheckdetail.service;
|
package com.ruoyi.check.stockcheckdetail.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.check.stockcheck.domain.CheckStockin;
|
||||||
import com.ruoyi.check.stockcheckdetail.domain.CheckStockinDetail;
|
import com.ruoyi.check.stockcheckdetail.domain.CheckStockinDetail;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -58,4 +60,8 @@ public interface ICheckStockinDetailService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteCheckStockinDetailByStockCheckDetailId(String stockCheckDetailId);
|
public int deleteCheckStockinDetailByStockCheckDetailId(String stockCheckDetailId);
|
||||||
|
|
||||||
|
void insertCheckStockinDetailHistory(CheckStockin checkStockin);
|
||||||
|
|
||||||
|
void deleteCheckStockinDetailByStockinGuid(String stockGuid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.ruoyi.check.stockcheckdetail.service.impl;
|
package com.ruoyi.check.stockcheckdetail.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.check.stockcheck.domain.CheckStockin;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.check.stockcheckdetail.mapper.CheckStockinDetailMapper;
|
import com.ruoyi.check.stockcheckdetail.mapper.CheckStockinDetailMapper;
|
||||||
@@ -90,4 +92,14 @@ public class CheckStockinDetailServiceImpl implements ICheckStockinDetailService
|
|||||||
{
|
{
|
||||||
return checkStockinDetailMapper.deleteCheckStockinDetailByStockCheckDetailId(stockCheckDetailId);
|
return checkStockinDetailMapper.deleteCheckStockinDetailByStockCheckDetailId(stockCheckDetailId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertCheckStockinDetailHistory(CheckStockin checkStockin) {
|
||||||
|
checkStockinDetailMapper.insertCheckStockinDetailHistory(checkStockin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteCheckStockinDetailByStockinGuid(String stockGuid) {
|
||||||
|
checkStockinDetailMapper.deleteCheckStockinDetailByStockinGuid(stockGuid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,6 +147,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="spare6 != null">#{spare6},</if>
|
<if test="spare6 != null">#{spare6},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
<insert id="insertCheckStockinDetailHistory">
|
||||||
|
insert into check_stockin_detail_finish
|
||||||
|
select * from check_stockin_detail where stock_check_guid = #{stockCheckGuid}
|
||||||
|
</insert>
|
||||||
|
|
||||||
<update id="updateCheckStockinDetail" parameterType="CheckStockinDetail">
|
<update id="updateCheckStockinDetail" parameterType="CheckStockinDetail">
|
||||||
update check_stockin_detail
|
update check_stockin_detail
|
||||||
@@ -194,4 +198,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{stockCheckDetailId}
|
#{stockCheckDetailId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
<delete id="deleteCheckStockinDetailByStockinGuid">
|
||||||
|
delete from check_stockin_detail where stock_check_guid = #{stockCheckGuid}
|
||||||
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -104,6 +104,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="spare5 != null">#{spare5},</if>
|
<if test="spare5 != null">#{spare5},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
<insert id="insertCheckStockinHistory">
|
||||||
|
insert into check_stockin_finish
|
||||||
|
select * from check_stockin where stock_guid = #{stockGuid}
|
||||||
|
</insert>
|
||||||
|
|
||||||
<update id="updateCheckStockin" parameterType="CheckStockin">
|
<update id="updateCheckStockin" parameterType="CheckStockin">
|
||||||
update check_stockin
|
update check_stockin
|
||||||
|
|||||||
@@ -24,6 +24,13 @@ export function addStockCheck(data) {
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
|
}// 新增盘库单据主信息
|
||||||
|
export function saveCheckStock(data) {
|
||||||
|
return request({
|
||||||
|
url: '/check/stockCheck/saveBill',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改盘库单据主信息
|
// 修改盘库单据主信息
|
||||||
|
|||||||
@@ -19,10 +19,10 @@
|
|||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="单据类型" prop="outType" required>
|
<el-form-item label="单据类型" prop="checkType" required>
|
||||||
<el-select v-model="formData.outType" placeholder="请选择单据类型" clearable>
|
<el-select v-model="formData.checkType" placeholder="请选择单据类型" clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.out_bill_type"
|
v-for="dict in dict.type.check_stock_type"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
@@ -44,7 +44,11 @@
|
|||||||
<el-table v-loading="loading" :data="materialList">
|
<el-table v-loading="loading" :data="materialList">
|
||||||
<el-table-column label="物资编号" align="center" prop="productId" />
|
<el-table-column label="物资编号" align="center" prop="productId" />
|
||||||
<el-table-column label="物资名称" align="center" prop="productName" />
|
<el-table-column label="物资名称" align="center" prop="productName" />
|
||||||
<el-table-column label="批号" align="center" prop="lotNo" />
|
<el-table-column label="批号" align="center" prop="lotNo">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.lotNo" size="mini" placeholder="请输入批号" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="数量" align="center" prop="quantity">
|
<el-table-column label="数量" align="center" prop="quantity">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input-number v-model="scope.row.quantity" :min="1" size="mini" @change="handleQuantityChange(scope.row)" />
|
<el-input-number v-model="scope.row.quantity" :min="1" size="mini" @change="handleQuantityChange(scope.row)" />
|
||||||
@@ -102,7 +106,11 @@
|
|||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column label="物资编码" align="center" prop="productId" />
|
<el-table-column label="物资编码" align="center" prop="productId" />
|
||||||
<el-table-column label="物资名称" align="center" prop="productName" />
|
<el-table-column label="物资名称" align="center" prop="productName" />
|
||||||
<el-table-column label="批号" align="center" prop="lotNo" />
|
<!-- <el-table-column label="批号" align="center" prop="lotNo">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.lotNo" size="mini" placeholder="请输入批号" />
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
<el-table-column label="数量" align="center" prop="quantity" />
|
<el-table-column label="数量" align="center" prop="quantity" />
|
||||||
<!-- <el-table-column label="仓库" align="center" prop="warehouseId" /> -->
|
<!-- <el-table-column label="仓库" align="center" prop="warehouseId" /> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -116,12 +124,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listProductAndStock,saveOutStock } from "@/api/out/outStockout";
|
import { listProductAndStock } from "@/api/out/outStockout";
|
||||||
import {listWarehouse} from "@/api/bas/warehouse";
|
import {listWarehouse} from "@/api/bas/warehouse";
|
||||||
|
import {saveCheckStock} from "@/api/check/stockCheck";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AddOutStock",
|
name: "AddOutStock",
|
||||||
dicts: ['out_bill_type', 'bill_status'],
|
dicts: ['check_stock_type', 'bill_status'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
@@ -143,7 +152,7 @@
|
|||||||
formData: {
|
formData: {
|
||||||
warehouseId: null,
|
warehouseId: null,
|
||||||
customerNo: null,
|
customerNo: null,
|
||||||
outType: null
|
checkType: null
|
||||||
},
|
},
|
||||||
// 仓库选项
|
// 仓库选项
|
||||||
warehouseOptions: [],
|
warehouseOptions: [],
|
||||||
@@ -215,6 +224,7 @@
|
|||||||
this.materialList = this.materialList.concat(
|
this.materialList = this.materialList.concat(
|
||||||
newMaterials.map(item => ({
|
newMaterials.map(item => ({
|
||||||
productId: item.productId,
|
productId: item.productId,
|
||||||
|
productGuId: item.productGuid,
|
||||||
productName: item.productName,
|
productName: item.productName,
|
||||||
quantity: item.quantity,
|
quantity: item.quantity,
|
||||||
quantityOrignal: item.quantity,
|
quantityOrignal: item.quantity,
|
||||||
@@ -263,11 +273,11 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const data = {
|
const data = {
|
||||||
outStockout: this.formData,
|
checkStockin: this.formData,
|
||||||
detailList: this.materialList
|
detailList: this.materialList
|
||||||
};
|
};
|
||||||
// 这里需要调用保存接口
|
// 这里需要调用保存接口
|
||||||
saveOutStock(data).then(response => {
|
saveCheckStock(data).then(response => {
|
||||||
console.log(response)
|
console.log(response)
|
||||||
this.$modal.msgSuccess("单据"+response.msg+"保存成功");
|
this.$modal.msgSuccess("单据"+response.msg+"保存成功");
|
||||||
this.$tab.refreshPage(this.$route);
|
this.$tab.refreshPage(this.$route);
|
||||||
|
|||||||
@@ -150,15 +150,26 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleInvalidated"
|
||||||
|
v-hasPermi="['check:stockCheck:edit']"
|
||||||
|
>单据作废</el-button>
|
||||||
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
plain
|
plain
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleReview"
|
||||||
v-hasPermi="['check:stockCheck:add']"
|
v-hasPermi="['check:stockCheck:edit']"
|
||||||
>新增</el-button>
|
>单据审核</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -167,37 +178,17 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleConfirmation"
|
||||||
v-hasPermi="['check:stockCheck:edit']"
|
v-hasPermi="['check:stockCheck:edit']"
|
||||||
>修改</el-button>
|
>单据确认</el-button>
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['check:stockCheck:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['check:stockCheck:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="stockCheckList" @selection-change="handleSelectionChange" @row-click="handleRowClick">
|
<el-table v-loading="loading" :data="stockCheckList" @selection-change="handleSelectionChange" @row-click="handleRowClick">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="GUID" align="center" prop="stockGuid" />
|
<!-- <el-table-column label="GUID" align="center" prop="stockGuid" /> -->
|
||||||
<el-table-column label="盘点单据ID" align="center" prop="stockCheckId" />
|
<el-table-column label="盘点单据ID" align="center" prop="stockCheckId" />
|
||||||
<el-table-column label="盘库类型" align="center" prop="checkType">
|
<el-table-column label="盘库类型" align="center" prop="checkType">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -217,34 +208,6 @@
|
|||||||
<el-table-column label="创建人" align="center" prop="createManId" />
|
<el-table-column label="创建人" align="center" prop="createManId" />
|
||||||
<el-table-column label="建立时间" align="center" prop="createDate" />
|
<el-table-column label="建立时间" align="center" prop="createDate" />
|
||||||
<el-table-column label=" 完成日期" align="center" prop="finishDate" />
|
<el-table-column label=" 完成日期" align="center" prop="finishDate" />
|
||||||
<!-- <el-table-column label="erp单号" align="center" prop="erpBill" />-->
|
|
||||||
|
|
||||||
<!-- <el-table-column label="客户编码" align="center" prop="customerNo" />
|
|
||||||
<el-table-column label="班组编码" align="center" prop="classNo" />
|
|
||||||
<el-table-column label="供应商编码" align="center" prop="supplierNo" />-->
|
|
||||||
<!-- <el-table-column label="备用字段1" align="center" prop="spare1" />
|
|
||||||
<el-table-column label="备用字段2" align="center" prop="spare2" />
|
|
||||||
<el-table-column label="备用字段3" align="center" prop="spare3" />
|
|
||||||
<el-table-column label="备用字段4" align="center" prop="spare4" />
|
|
||||||
<el-table-column label="备用字段5" align="center" prop="spare5" />
|
|
||||||
<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-edit"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['check:stockCheck:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['check:stockCheck:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>-->
|
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
@@ -258,20 +221,20 @@
|
|||||||
<el-table v-loading="detailLoading" :data="stockCheckDetailList" @selection-change="handleDetailSelectionChange">
|
<el-table v-loading="detailLoading" :data="stockCheckDetailList" @selection-change="handleDetailSelectionChange">
|
||||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||||
<el-table-column label="子单ID" align="center" prop="stockCheckDetailId" />
|
<el-table-column label="子单ID" align="center" prop="stockCheckDetailId" />
|
||||||
<el-table-column label="主单GUID" align="center" prop="stockCheckGuid" />
|
<!-- <el-table-column label="主单GUID" align="center" prop="stockCheckGuid" /> -->
|
||||||
<el-table-column label="主单ID" align="center" prop="stockCheckId" />
|
<el-table-column label="主单ID" align="center" prop="stockCheckId" />
|
||||||
<el-table-column label="批次号" align="center" prop="lotNo" />
|
<el-table-column label="批次号" align="center" prop="lotNo" />
|
||||||
<el-table-column label="物料ID" align="center" prop="productGuid" />
|
<!-- <el-table-column label="物料ID" align="center" prop="productGuid" /> -->
|
||||||
<el-table-column label="物料编码" align="center" prop="productId" />
|
<el-table-column label="物料编码" align="center" prop="productId" />
|
||||||
<el-table-column label="计划数量" align="center" prop="quantity" />
|
<el-table-column label="计划数量" align="center" prop="quantity" />
|
||||||
<el-table-column label="计划数量(箱)" align="center" prop="quantityX" />
|
<!-- <el-table-column label="计划数量(箱)" align="center" prop="quantityX" />-->
|
||||||
<el-table-column label="计划数量(件)" align="center" prop="quantityJ" />
|
<!-- <el-table-column label="计划数量(件)" align="center" prop="quantityJ" />-->
|
||||||
<el-table-column label="参考单价" align="center" prop="price" />
|
<el-table-column label="参考单价" align="center" prop="price" />
|
||||||
<el-table-column label="品牌" align="center" prop="cargoNo" />
|
<el-table-column label="品牌" align="center" prop="cargoNo" />
|
||||||
<el-table-column label="描述" align="center" prop="remark" />
|
<el-table-column label="描述" align="center" prop="remark" />
|
||||||
<el-table-column label="实际数量" align="center" prop="assignNum" />
|
<el-table-column label="实际数量" align="center" prop="assignNum" />
|
||||||
<el-table-column label="实际数量(箱)" align="center" prop="assignNumX" />
|
<!-- <el-table-column label="实际数量(箱)" align="center" prop="assignNumX" />-->
|
||||||
<el-table-column label="实际数量(件)" align="center" prop="assignNumJ" />
|
<!-- <el-table-column label="实际数量(件)" align="center" prop="assignNumJ" />-->
|
||||||
<el-table-column label="入库日期" align="center" prop="printDate" />
|
<el-table-column label="入库日期" align="center" prop="printDate" />
|
||||||
<el-table-column label="单据状态" align="center" prop="stockStatus" />
|
<el-table-column label="单据状态" align="center" prop="stockStatus" />
|
||||||
<el-table-column label="供应商编码" align="center" prop="supplierId" />
|
<el-table-column label="供应商编码" align="center" prop="supplierId" />
|
||||||
@@ -279,8 +242,8 @@
|
|||||||
<el-table-column label="单位" align="center" prop="unit" />
|
<el-table-column label="单位" align="center" prop="unit" />
|
||||||
<el-table-column label="规格" align="center" prop="spec" />
|
<el-table-column label="规格" align="center" prop="spec" />
|
||||||
<el-table-column label="扫码数量" align="center" prop="scanNum" />
|
<el-table-column label="扫码数量" align="center" prop="scanNum" />
|
||||||
<el-table-column label="扫码数量(箱)" align="center" prop="scanNumX" />
|
<!-- <el-table-column label="扫码数量(箱)" align="center" prop="scanNumX" />-->
|
||||||
<el-table-column label="扫码数量(件)" align="center" prop="scanNumJ" />
|
<!-- <el-table-column label="扫码数量(件)" align="center" prop="scanNumJ" />-->
|
||||||
<!-- <el-table-column label="备用字段1" align="center" prop="spare1" />
|
<!-- <el-table-column label="备用字段1" align="center" prop="spare1" />
|
||||||
<el-table-column label="备用字段2" align="center" prop="spare2" />
|
<el-table-column label="备用字段2" align="center" prop="spare2" />
|
||||||
<el-table-column label="备用字段3" align="center" prop="spare3" />
|
<el-table-column label="备用字段3" align="center" prop="spare3" />
|
||||||
@@ -484,22 +447,8 @@ export default {
|
|||||||
this.detailTotal = 0
|
this.detailTotal = 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset()
|
|
||||||
this.open = true
|
|
||||||
this.title = "添加盘库单据主信息"
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset()
|
|
||||||
const stockGuid = row.stockGuid || this.ids
|
|
||||||
getStockCheck(stockGuid).then(response => {
|
|
||||||
this.form = response.data
|
|
||||||
this.open = true
|
|
||||||
this.title = "修改盘库单据主信息"
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
@@ -520,22 +469,58 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 作废按钮操作 */
|
||||||
handleDelete(row) {
|
handleInvalidated(row) {
|
||||||
const stockGuids = row.stockGuid || this.ids
|
let stockCheck = this.stockCheckList.find(item => item.stockGuid === (row.stockGuid || this.ids[0]));
|
||||||
this.$modal.confirm('是否确认删除盘库单据主信息编号为"' + stockGuids + '"的数据项?').then(function() {
|
if (stockCheck.status === "1") {
|
||||||
return delStockCheck(stockGuids)
|
let data = {
|
||||||
}).then(() => {
|
"stockGuid": stockCheck.stockGuid,
|
||||||
this.getList()
|
"status": "5"
|
||||||
this.$modal.msgSuccess("删除成功")
|
}
|
||||||
}).catch(() => {})
|
updateStockCheck(data).then(response => {
|
||||||
|
this.$modal.msgSuccess("作废成功")
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$modal.msgError("只有未审核的单据可以作废")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 审核按钮操作 */
|
||||||
|
handleReview(row) {
|
||||||
|
let stockCheck = this.stockCheckList.find(item => item.stockGuid === (row?.stockGuid || this.ids[0]));
|
||||||
|
if (stockCheck.status === "2") {
|
||||||
|
this.$modal.msgError("单据已审核,请勿重复审核")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (stockCheck.status === "1") {
|
||||||
|
let data = {
|
||||||
|
"stockGuid": stockCheck.stockGuid,
|
||||||
|
"status": "2"
|
||||||
|
}
|
||||||
|
updateStockCheck(data).then(response => {
|
||||||
|
this.$modal.msgSuccess("审核成功")
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$modal.msgError("只有未审核的单据可以审核")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 确认按钮操作 */
|
||||||
|
handleConfirmation(row) {
|
||||||
|
let stockCheck = this.stockCheckList.find(item => item.stockGuid === (row?.stockGuid || this.ids[0]));
|
||||||
|
if (stockCheck.status === "3") {
|
||||||
|
let data = {
|
||||||
|
"stockGuid": stockCheck.stockGuid,
|
||||||
|
"status": "4"
|
||||||
|
}
|
||||||
|
updateStockCheck(data).then(response => {
|
||||||
|
this.$modal.msgSuccess("确认成功")
|
||||||
|
this.getList()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$modal.msgError("只有已审核的单据可以确认")
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
this.download('check/stockCheck/export', {
|
|
||||||
...this.queryParams
|
|
||||||
}, `stockCheck_${new Date().getTime()}.xlsx`)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
7213
sql/dbo.sql
7213
sql/dbo.sql
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user