优化入库,将自动报工拆分至入库完成处理

This commit is contained in:
zj
2026-01-28 08:45:16 +08:00
parent 55fd40718f
commit 3a8cd0141b
17 changed files with 1369 additions and 20 deletions

View File

@@ -36,4 +36,9 @@ public class ToErpApiController {
public void callbackTransferBill() {
toErpService.callbackTransferBill();
}
@Scheduled(fixedDelay = 30000)
public void callbackProduction() {
toErpService.callbackProduction();
}
}

View File

@@ -19,4 +19,6 @@ public interface IToErpService {
AjaxResult createWorkshopInboundOrder(BasProduct basProduct,String erpBill);
AjaxResult getInCode(BasProductCode basProductCode);
void callbackProduction();
}

View File

@@ -9,7 +9,9 @@ import com.ruoyi.bas.BasProduct.service.IBasProductService;
import com.ruoyi.bas.BasProductCode.domain.BasProductCode;
import com.ruoyi.bas.basJobId.service.IBasJobIdService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.in.erp.domain.ProductionCallback;
import com.ruoyi.in.erp.domain.TransferBillCallback;
import com.ruoyi.in.erp.service.IProductionCallbackService;
import com.ruoyi.in.erp.service.ITransferBillCallbackService;
import com.ruoyi.log.domain.RequestLog;
import com.ruoyi.log.service.IRequestLogService;
@@ -29,6 +31,8 @@ public class ToErpServiceImpl implements IToErpService {
@Autowired
private ITransferBillCallbackService transferBillCallbackService;
@Autowired
private IProductionCallbackService productionCallbackService;
@Autowired
private IBasJobIdService basJobIdService;
@Autowired
private IRequestLogService requestLogService;
@@ -41,19 +45,88 @@ public class ToErpServiceImpl implements IToErpService {
public void callbackTransferBill() {
TransferBillCallback param = new TransferBillCallback();
param.setStatus("0");
//List<TransferBillCallback> list = transferBillCallbackService.selectTransferBillCallbackList(param);
List<TransferBillCallback> list = transferBillCallbackService.getTopMsg(param);
for (TransferBillCallback transferBillCallback : list) {
if(list.size()>0){
TransferBillCallback callback = list.get(0);
//todo 请求其他出入库单回传接口
AjaxResult otherInOutboundOrder = createOtherInOutboundOrder(transferBillCallback);
AjaxResult otherInOutboundOrder = createOtherInOutboundOrder(callback);
if (otherInOutboundOrder.isSuccess()) {
transferBillCallback.setStatus("1");
transferBillCallback.setFinishTime(DateUtil.formatDateTime(new Date()));
transferBillCallbackService.updateTransferBillCallback(transferBillCallback);
callback.setStatus("1");
callback.setFinishTime(DateUtil.formatDateTime(new Date()));
transferBillCallbackService.updateTransferBillCallback(callback);
}else{
callback.setStatus("2");
callback.setFinishTime(DateUtil.formatDateTime(new Date()));
transferBillCallbackService.updateTransferBillCallback(callback);
}
}
}
@Override
public void callbackProduction() {
List<ProductionCallback> list = productionCallbackService.getTopMsg("0");
if(list.size()>0){
ProductionCallback productionCallback = list.get(0);
AjaxResult ajaxResult = createProductionCallback(productionCallback);
if (ajaxResult.isSuccess()) {
productionCallback.setStatus("1");
productionCallback.setReturnCode("0");
productionCallback.setReturnMsg(ajaxResult.get("msg").toString());
productionCallbackService.updateProductionCallback(productionCallback);
}else{
productionCallback.setStatus("2");
productionCallback.setReturnCode("1");
productionCallback.setReturnMsg(ajaxResult.get("msg").toString());
productionCallbackService.updateProductionCallback(productionCallback);
}
}
}
private AjaxResult createProductionCallback(ProductionCallback productionCallback) {
ErpInterfaceParam<WipTransferDoc> param = new ErpInterfaceParam<>();
ErpStdData<WipTransferDoc> erpStdData = new ErpStdData<>();
ErpParameter<WipTransferDoc> objectErpParameter = new ErpParameter<>();
ArrayList<WipTransferDocD> list = new ArrayList<WipTransferDocD>();
WipTransferDoc wipTransferDoc = new WipTransferDoc();
wipTransferDoc.setDOC_NO(basJobIdService.getJobIdBy("5C41"));
wipTransferDoc.setDOC_ID_DOC_CODE("5C41");
wipTransferDoc.setDOC_DATE(DateUtil.formatDateTime(new Date()));
wipTransferDoc.setSOURCE_ID_WORK_CENTER_WORK_CENTER_CODE("QC06");
wipTransferDoc.setFROM_ADMIN_UNIT_ID_ADMIN_UNIT_CODE("EF08G");
wipTransferDoc.setFROM_ADMIN_UNIT_ID_START_DATE(DateUtil.formatDateTime(new Date()));
wipTransferDoc.setOwner_Dept_ADMIN_UNIT_CODE("EF08G");
wipTransferDoc.setOwner_Dept_START_DATE(DateUtil.formatDateTime(new Date()));
wipTransferDoc.setOwner_Emp_EMPLOYEE_CODE("EF08G");
String docNo = requestLogService.getRequestLogDoc(TO_ERP_URL,productionCallback.getBillNo(), productionCallback.getProductId() , "获取工艺单号", "wms", "erp");
if("".equals(docNo) || docNo == null) {
return AjaxResult.error();
}
WipTransferDocD wipTransferDocD = new WipTransferDocD();
wipTransferDocD.setMO_ID_DOC_NO(docNo);
wipTransferDocD.setTO_ADMIN_UNIT_ID_START_DATE(DateUtil.formatDateTime(new Date()));
wipTransferDocD.setQTY("1");
wipTransferDocD.setITEM_ID_ITEM_CODE(productionCallback.getProductId());
wipTransferDocD.setITEM_NAME(productionCallback.getProductName());
wipTransferDocD.setITEM_SPECIFICATION(productionCallback.getSpec());
wipTransferDocD.setSOURCE_ID_WAREHOUSE_WAREHOUSE_CODE("C041-1");
wipTransferDocD.setFROM_MO_ROUTING_D_ID_SequenceNumber(1);
wipTransferDocD.setFROM_MO_ROUTING_D_ID_Parent_MO_ID_DOC_NO(docNo);
list.add(wipTransferDocD);
wipTransferDoc.setWIP_TRANSFER_DOC_D(list);
objectErpParameter.setDatas(List.of(wipTransferDoc));
erpStdData.setParameter(objectErpParameter);
param.setStd_data(erpStdData);
RequestLog requestLog = requestLogService.getRequestLogGd(TO_ERP_URL, JSONUtil.toJsonStr(param), "创建工艺单","wms","erp");
if(requestLog != null && "1".equals(requestLog.getIsSuccessful())){
return AjaxResult.success(requestLog.getResponseBody());
}else{
return AjaxResult.error(requestLog.getResponseBody());
}
}
@Override
public AjaxResult createWorkshopInboundOrder(BasProduct basProduct,String erpBill) {
ErpInterfaceParam<WipTransferDoc> param = new ErpInterfaceParam<>();
@@ -111,6 +184,8 @@ public class ToErpServiceImpl implements IToErpService {
}
public AjaxResult createOtherInOutboundOrder(TransferBillCallback transferBillCallback) {
ErpInterfaceParam<ErpInOutBoundOrder> param = new ErpInterfaceParam<>();
ErpStdData<ErpInOutBoundOrder> erpStdData = new ErpStdData<>();

View File

@@ -190,7 +190,7 @@ public class ToWmsServiceImpl implements IToWmsService {
}
//todo 创建工艺入库单
//注释该部分用于处理异常报工无法正常入库的工单任务
//注释该部分,优化为先入库后报工,堆垛机完成插入数据
// if ("2".equals(requestEnter.getFloor())){
// AjaxResult workshopInboundOrder = toErpService.createWorkshopInboundOrder(basProduct,erpBill);
// if (!workshopInboundOrder.isSuccess()){
@@ -341,7 +341,6 @@ public class ToWmsServiceImpl implements IToWmsService {
StringBuilder stringBuilder = new StringBuilder();
switch (wmsJobRequest.getWmsType()) {
case "1":
if (StrUtil.isEmpty(wmsJobRequest.getTaskNo())) {
return AjaxResult.error("任务号不能为空");
}

View File

@@ -0,0 +1,93 @@
package com.ruoyi.in.erp.controller;
import java.util.List;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.in.erp.domain.ProductionCallback;
import com.ruoyi.in.erp.service.IProductionCallbackService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* ProductionCallbackController
*
* @author ruoyi
* @date 2026-01-27
*/
@RestController
@RequestMapping("/erp/productionCallback")
public class ProductionCallbackController extends BaseController
{
@Autowired
private IProductionCallbackService productionCallbackService;
/**
* 查询ProductionCallback列表
*/
// @PreAuthorize("@ss.hasPermi('ProductionCallback:ProductionCallback:list')")
@GetMapping("/list")
public TableDataInfo list(ProductionCallback productionCallback)
{
startPage();
List<ProductionCallback> list = productionCallbackService.selectProductionCallbackList(productionCallback);
return getDataTable(list);
}
/**
* 导出ProductionCallback列表
*/
// @PreAuthorize("@ss.hasPermi('ProductionCallback:ProductionCallback:export')")
@Log(title = "ProductionCallback", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProductionCallback productionCallback)
{
List<ProductionCallback> list = productionCallbackService.selectProductionCallbackList(productionCallback);
ExcelUtil<ProductionCallback> util = new ExcelUtil<ProductionCallback>(ProductionCallback.class);
util.exportExcel(response, list, "ProductionCallback数据");
}
/**
* 获取ProductionCallback详细信息
*/
// @PreAuthorize("@ss.hasPermi('ProductionCallback:ProductionCallback:query')")
@GetMapping(value = "/{trayCode}")
public AjaxResult getInfo(@PathVariable("trayCode") String trayCode)
{
return success(productionCallbackService.selectProductionCallbackByTrayCode(trayCode));
}
/**
* 修改ProductionCallback
*/
// @PreAuthorize("@ss.hasPermi('ProductionCallback:ProductionCallback:edit')")
@Log(title = "ProductionCallback", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProductionCallback productionCallback)
{
return toAjax(productionCallbackService.updateProductionCallbackMsg(productionCallback));
}
/**
* 删除ProductionCallback
*/
// @PreAuthorize("@ss.hasPermi('ProductionCallback:ProductionCallback:remove')")
@Log(title = "ProductionCallback", businessType = BusinessType.DELETE)
@DeleteMapping("/{trayCodes}")
public AjaxResult remove(@PathVariable String[] trayCodes)
{
return toAjax(productionCallbackService.deleteProductionCallbackByTrayCodes(trayCodes));
}
}

View File

@@ -38,7 +38,7 @@ public class TransferBillCallbackController extends BaseController
/**
* 查询调拨单回传列表
*/
@PreAuthorize("@ss.hasPermi('in:transfer:list')")
// @PreAuthorize("@ss.hasPermi('in:transfer:list')")
@GetMapping("/list")
public TableDataInfo list(TransferBillCallback transferBillCallback)
{
@@ -50,7 +50,7 @@ public class TransferBillCallbackController extends BaseController
/**
* 导出调拨单回传列表
*/
@PreAuthorize("@ss.hasPermi('in:transfer:export')")
// @PreAuthorize("@ss.hasPermi('in:transfer:export')")
@Log(title = "调拨单回传", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, TransferBillCallback transferBillCallback)
@@ -63,7 +63,7 @@ public class TransferBillCallbackController extends BaseController
/**
* 获取调拨单回传详细信息
*/
@PreAuthorize("@ss.hasPermi('in:transfer:query')")
// @PreAuthorize("@ss.hasPermi('in:transfer:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
@@ -73,7 +73,7 @@ public class TransferBillCallbackController extends BaseController
/**
* 新增调拨单回传
*/
@PreAuthorize("@ss.hasPermi('in:transfer:add')")
// @PreAuthorize("@ss.hasPermi('in:transfer:add')")
@Log(title = "调拨单回传", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TransferBillCallback transferBillCallback)
@@ -84,7 +84,7 @@ public class TransferBillCallbackController extends BaseController
/**
* 修改调拨单回传
*/
@PreAuthorize("@ss.hasPermi('in:transfer:edit')")
// @PreAuthorize("@ss.hasPermi('in:transfer:edit')")
@Log(title = "调拨单回传", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TransferBillCallback transferBillCallback)
@@ -95,7 +95,7 @@ public class TransferBillCallbackController extends BaseController
/**
* 删除调拨单回传
*/
@PreAuthorize("@ss.hasPermi('in:transfer:remove')")
// @PreAuthorize("@ss.hasPermi('in:transfer:remove')")
@Log(title = "调拨单回传", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)

View File

@@ -0,0 +1,94 @@
package com.ruoyi.in.erp.domain;
public class ProductionCallback {
private String trayCode;
private String billNo;
private String productId;
private String productName;
private String spec;
private String unit;
private String status;
private String createTime;
private String returnCode;
private String returnMsg;
public String getTrayCode() {
return trayCode;
}
public void setTrayCode(String trayCode) {
this.trayCode = trayCode;
}
public String getBillNo() {
return billNo;
}
public void setBillNo(String billNo) {
this.billNo = billNo;
}
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getSpec() {
return spec;
}
public void setSpec(String spec) {
this.spec = spec;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getReturnCode() {
return returnCode;
}
public void setReturnCode(String returnCode) {
this.returnCode = returnCode;
}
public String getReturnMsg() {
return returnMsg;
}
public void setReturnMsg(String returnMsg) {
this.returnMsg = returnMsg;
}
}

View File

@@ -0,0 +1,56 @@
package com.ruoyi.in.erp.mapper;
import com.ruoyi.in.erp.domain.ProductionCallback;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 工艺入库回传Mapper接口
*
* @author ruoyi
* @date 2025-09-17
*/
public interface ProductionCallbackMapper
{
List<ProductionCallback> getTopMsg(@Param("status") String status);
void updateProductionCallback(ProductionCallback productionCallback);
void insertProductionCallback(ProductionCallback productionCallback);
/**
* 查询ProductionCallback
*
* @param trayCode ProductionCallback主键
* @return ProductionCallback
*/
public ProductionCallback selectProductionCallbackByTrayCode(String trayCode);
/**
* 查询ProductionCallback列表
*
* @param productionCallback ProductionCallback
* @return ProductionCallback集合
*/
public List<ProductionCallback> selectProductionCallbackList(ProductionCallback productionCallback);
/**
* 删除ProductionCallback
*
* @param trayCode ProductionCallback主键
* @return 结果
*/
public int deleteProductionCallbackByTrayCode(String trayCode);
/**
* 批量删除ProductionCallback
*
* @param trayCodes 需要删除的数据主键集合
* @return 结果
*/
public int deleteProductionCallbackByTrayCodes(String[] trayCodes);
int updateProductionCallbackMsg(ProductionCallback productionCallback);
}

View File

@@ -0,0 +1,54 @@
package com.ruoyi.in.erp.service;
import com.ruoyi.in.erp.domain.ProductionCallback;
import java.util.List;
/**
* 工艺入库回传Service接口
*
* @author ruoyi
* @date 2025-09-17
*/
public interface IProductionCallbackService {
List<ProductionCallback> getTopMsg(String status);
void updateProductionCallback(ProductionCallback productionCallback);
void insertProductionCallback(ProductionCallback productionCallback);
/**
* 查询ProductionCallback
*
* @param trayCode ProductionCallback主键
* @return ProductionCallback
*/
public ProductionCallback selectProductionCallbackByTrayCode(String trayCode);
/**
* 查询ProductionCallback列表
*
* @param productionCallback ProductionCallback
* @return ProductionCallback集合
*/
public List<ProductionCallback> selectProductionCallbackList(ProductionCallback productionCallback);
/**
* 批量删除ProductionCallback
*
* @param trayCodes 需要删除的ProductionCallback主键集合
* @return 结果
*/
public int deleteProductionCallbackByTrayCodes(String[] trayCodes);
/**
* 删除ProductionCallback信息
*
* @param trayCode ProductionCallback主键
* @return 结果
*/
public int deleteProductionCallbackByTrayCode(String trayCode);
int updateProductionCallbackMsg(ProductionCallback productionCallback);
}

View File

@@ -0,0 +1,92 @@
package com.ruoyi.in.erp.service.impl;
import com.ruoyi.in.erp.domain.ProductionCallback;
import com.ruoyi.in.erp.mapper.ProductionCallbackMapper;
import com.ruoyi.in.erp.service.IProductionCallbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 工艺入库回传Service业务层处理
*
* @author ruoyi
* @date 2025-09-17
*/
@Service
public class ProductionCallbackServiceImpl implements IProductionCallbackService {
@Autowired
private ProductionCallbackMapper productionCallbackMapper;
@Override
public List<ProductionCallback> getTopMsg(String status) {
return productionCallbackMapper.getTopMsg(status);
}
@Override
public void updateProductionCallback(ProductionCallback productionCallback) {
productionCallbackMapper.updateProductionCallback(productionCallback);
}
@Override
public void insertProductionCallback(ProductionCallback productionCallback) {
productionCallbackMapper.insertProductionCallback(productionCallback);
}
/**
* 查询ProductionCallback
*
* @param trayCode ProductionCallback主键
* @return ProductionCallback
*/
@Override
public ProductionCallback selectProductionCallbackByTrayCode(String trayCode)
{
return productionCallbackMapper.selectProductionCallbackByTrayCode(trayCode);
}
/**
* 查询ProductionCallback列表
*
* @param productionCallback ProductionCallback
* @return ProductionCallback
*/
@Override
public List<ProductionCallback> selectProductionCallbackList(ProductionCallback productionCallback)
{
return productionCallbackMapper.selectProductionCallbackList(productionCallback);
}
/**
* 批量删除ProductionCallback
*
* @param trayCodes 需要删除的ProductionCallback主键
* @return 结果
*/
@Override
public int deleteProductionCallbackByTrayCodes(String[] trayCodes)
{
return productionCallbackMapper.deleteProductionCallbackByTrayCodes(trayCodes);
}
/**
* 删除ProductionCallback信息
*
* @param trayCode ProductionCallback主键
* @return 结果
*/
@Override
public int deleteProductionCallbackByTrayCode(String trayCode)
{
return productionCallbackMapper.deleteProductionCallbackByTrayCode(trayCode);
}
@Override
public int updateProductionCallbackMsg(ProductionCallback productionCallback) {
return productionCallbackMapper.updateProductionCallbackMsg(productionCallback);
}
}

View File

@@ -19,7 +19,9 @@ import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.MessageUtils;
import com.ruoyi.in.erp.domain.ProductionCallback;
import com.ruoyi.in.erp.domain.TransferBillCallback;
import com.ruoyi.in.erp.service.IProductionCallbackService;
import com.ruoyi.in.erp.service.ITransferBillCallbackService;
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
@@ -84,6 +86,8 @@ public class MydoJobServiceImpl implements IMydoJobService {
@Autowired
private ITransferBillCallbackService transferBillCallbackService;
@Autowired
private IProductionCallbackService productionCallbackService;
@Autowired
private BasStockMapper basStockMapper;
@Autowired
private BasProductMapper basProductMapper;
@@ -269,7 +273,6 @@ public class MydoJobServiceImpl implements IMydoJobService {
return AjaxResult.warn("任务不存在");
}
if ("5".equals(mydoJob.getInOrOut())){
//盘点入库
//入库作业
MydoJobDetail param = new MydoJobDetail();
@@ -302,15 +305,12 @@ public class MydoJobServiceImpl implements IMydoJobService {
//正常库存
list.add(stockByInStockinDetail);
}
}
//修改货位状态
basCargoSpace.setStatus("2");
basCargoSpace.setTrayCode(mydoJob.getTrayCode());
basCargoSpace.setCargoSpaceId(mydoJob.getCargoSpaceId());
basCargoSpaceService.updateBasCargoSpace(basCargoSpace);
//插入库存信息
basStockService.insertBasStockList(list);
@@ -320,6 +320,19 @@ public class MydoJobServiceImpl implements IMydoJobService {
updateMydoJob(mydoJob);
// 插入任务历史表 删除任务
insertHistory(mydoJob.getJobId());
TransferBillCallback transferBillCallback = new TransferBillCallback();
transferBillCallback.setJobId(mydoJob.getJobId());
transferBillCallback.setErpBill(mydoJob.getLineId());
transferBillCallback.setType("1");
transferBillCallback.setStatus("0");
BasProduct product = basProductMapper.selectBasProductByProductId(mydoJobDetails.get(0).getProductId());
transferBillCallback.setSpare1(mydoJobDetails.get(0).getProductId());
if(product != null) {
transferBillCallback.setSpare2(product.getProductName());
}
transferBillCallback.setSpare3(mydoJobDetails.get(0).getSpec());
transferBillCallback.setTrayCode(mydoJob.getTrayCode());
transferBillCallbackService.insertTransferBillCallback(transferBillCallback);
return AjaxResult.success();
} else {
return AjaxResult.warn("不存在子作业");
@@ -332,8 +345,12 @@ public class MydoJobServiceImpl implements IMydoJobService {
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(mydoJob.getCargoSpaceId());
if (CollUtil.isNotEmpty(mydoJobDetails)) {
List<BasStock> list = new ArrayList<>();
BasProduct basProduct = basProductMapper.selectBasProductByProductId(mydoJobDetails.get(0).getProductId());
for (MydoJobDetail mydoJobDetail : mydoJobDetails) {
//正常库存
if(basProduct != null) {
mydoJobDetail.setProductName(basProduct.getProductName());
}
BasStock stockByInStockinDetail = getStockByInStockinDetail(mydoJobDetail, mydoJob, "1");
stockByInStockinDetail.setSpare7("0");
list.add(stockByInStockinDetail);
@@ -354,6 +371,22 @@ public class MydoJobServiceImpl implements IMydoJobService {
updateMydoJob(mydoJob);
// 插入任务历史表 删除任务
insertHistory(mydoJob.getJobId());
//报工数据插入
if("G1005".equals(mydoJob.getEntranceId())){
ProductionCallback productionCallback = new ProductionCallback();
productionCallback.setTrayCode(mydoJob.getTrayCode());
productionCallback.setBillNo(mydoJob.getLineId());
productionCallback.setProductId(mydoJobDetails.get(0).getProductId());
if(basProduct != null) {
productionCallback.setProductName(basProduct.getProductName());
}
productionCallback.setSpec(mydoJobDetails.get(0).getSpec());
productionCallback.setUnit(basProduct.getUnit());
productionCallback.setStatus("0");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
productionCallback.setCreateTime(sdf.format(new Date()));
productionCallbackService.insertProductionCallback(productionCallback);
}
//其他出入库单据回传
TransferBillCallback transferBillCallback = new TransferBillCallback();

View File

@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.in.erp.mapper.ProductionCallbackMapper">
<resultMap type="ProductionCallback" id="ProductionCallbackResult">
<result property="trayCode" column="tray_code" />
<result property="billNo" column="bill_no" />
<result property="productId" column="product_id" />
<result property="productName" column="product_name" />
<result property="spec" column="spec" />
<result property="unit" column="unit" />
<result property="status" column="status" />
<result property="createTime" column="create_time" />
<result property="returnCode" column="return_code" />
<result property="returnMsg" column="return_msg" />
</resultMap>
<sql id="selectProductionCallbackVo">
select tray_code, bill_no, product_id, product_name, spec, unit, status, create_time, return_code, return_msg from production_callback
</sql>
<select id="selectProductionCallbackList" parameterType="ProductionCallback" resultMap="ProductionCallbackResult">
<include refid="selectProductionCallbackVo"/>
<where>
<if test="billNo != null and billNo != ''"> and bill_no like concat('%', #{billNo}, '%')</if>
<if test="productId != null and productId != ''"> and product_id like concat('%', #{productId}, '%')</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="returnCode != null and returnCode != ''"> and return_code = #{returnCode}</if>
</where>
</select>
<select id="selectProductionCallbackByTrayCode" parameterType="String" resultMap="ProductionCallbackResult">
<include refid="selectProductionCallbackVo"/>
where tray_code = #{trayCode}
</select>
<update id="updateProductionCallbackMsg" parameterType="ProductionCallback">
update production_callback
<trim prefix="SET" suffixOverrides=",">
<if test="billNo != null">bill_no = #{billNo},</if>
<if test="productId != null">product_id = #{productId},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="spec != null">spec = #{spec},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="status != null">status = #{status},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="returnCode != null">return_code = #{returnCode},</if>
<if test="returnMsg != null">return_msg = #{returnMsg},</if>
</trim>
where tray_code = #{trayCode}
</update>
<delete id="deleteProductionCallbackByTrayCode" parameterType="String">
delete from production_callback where tray_code = #{trayCode}
</delete>
<delete id="deleteProductionCallbackByTrayCodes" parameterType="String">
delete from production_callback where tray_code in
<foreach item="trayCode" collection="array" open="(" separator="," close=")">
#{trayCode}
</foreach>
</delete>
<select id="getTopMsg" parameterType="String" resultMap="ProductionCallbackResult">
select top(1) tray_code,bill_no,product_id,product_name,spec,unit,status,create_time,return_code,return_msg
from production_callback
where status=#{status}
order by create_time asc
</select>
<update id="updateProductionCallback" parameterType="ProductionCallback">
update production_callback set status=#{status},return_code=#{returnCode},return_msg=#{returnMsg}
where tray_code = #{trayCode} and bill_no = #{billNo}
</update>
<insert id="insertProductionCallback" parameterType="ProductionCallback">
insert into production_callback
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="trayCode != null and trayCode != ''">tray_code,</if>
<if test="billNo != null and billNo != ''">bill_no,</if>
<if test="productId != null and productId != ''">product_id,</if>
<if test="productName != null and productName != ''">product_name,</if>
<if test="spec != null and spec != ''">spec,</if>
<if test="unit != null and unit != ''">unit,</if>
<if test="status != null and status != ''">status,</if>
<if test="createTime != null and createTime != ''">create_time,</if>
<if test="returnCode != null and returnCode != ''">return_code,</if>
<if test="returnMsg != null and returnMsg != ''">return_msg,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="trayCode != null and trayCode != ''">#{trayCode},</if>
<if test="billNo != null and billNo != ''">#{billNo},</if>
<if test="productId != null and productId != ''">#{productId},</if>
<if test="productName != null and productName != ''">#{productName},</if>
<if test="spec != null and spec != ''">#{spec},</if>
<if test="unit != null and unit != ''">#{unit},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="createTime != null and createTime != ''">#{createTime},</if>
<if test="returnCode != null and returnCode != ''">#{returnCode},</if>
<if test="returnMsg != null and returnMsg != ''">#{returnMsg},</if>
</trim>
</insert>
</mapper>

View File

@@ -27,11 +27,11 @@
<include refid="selectTransferBillCallbackVo"/>
<where>
<if test="jobId != null and jobId != ''"> and job_id = #{jobId}</if>
<if test="erpBill != null and erpBill != ''"> and erp_bill = #{erpBill}</if>
<if test="erpBill != null and erpBill != ''"> and erp_bill like concat('%',#{erpBill},'%')</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="finishTime != null and finishTime != ''"> and finish_time = #{finishTime}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 like concat('%',#{spare1},'%')</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
</where>

View File

@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询ProductionCallback列表
export function listProductionCallback(query) {
return request({
url: '/erp/productionCallback/list',
method: 'get',
params: query
})
}
// 查询ProductionCallback详细
export function getProductionCallback(trayCode) {
return request({
url: '/erp/productionCallback/' + trayCode,
method: 'get'
})
}
// 新增ProductionCallback
// export function addProductionCallback(data) {
// return request({
// url: '/erp/productionCallback',
// method: 'post',
// data: data
// })
// }
// 修改ProductionCallback
export function updateProductionCallback(data) {
return request({
url: '/erp/productionCallback',
method: 'put',
data: data
})
}
// 删除ProductionCallback
export function delProductionCallback(trayCode) {
return request({
url: '/erp/productionCallback/' + trayCode,
method: 'delete'
})
}

View File

@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询调拨单回传列表
export function listTransfer(query) {
return request({
url: '/in/transfer/list',
method: 'get',
params: query
})
}
// 查询调拨单回传详细
export function getTransfer(id) {
return request({
url: '/in/transfer/' + id,
method: 'get'
})
}
// 新增调拨单回传
export function addTransfer(data) {
return request({
url: '/in/transfer',
method: 'post',
data: data
})
}
// 修改调拨单回传
export function updateTransfer(data) {
return request({
url: '/in/transfer',
method: 'put',
data: data
})
}
// 删除调拨单回传
export function delTransfer(id) {
return request({
url: '/in/transfer/' + id,
method: 'delete'
})
}

View File

@@ -0,0 +1,314 @@
<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="billNo">
<el-input
v-model="queryParams.billNo"
placeholder="请输入订单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="品号" prop="productId">
<el-input
v-model="queryParams.productId"
placeholder="请输入品号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="回传状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择回传状态" clearable>
<el-option
v-for="dict in dict.type.callback_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</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="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['ProductionCallback:ProductionCallback:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['ProductionCallback:ProductionCallback:edit']"
>修改</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="['ProductionCallback:ProductionCallback: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="['ProductionCallback:ProductionCallback:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="ProductionCallbackList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序列号" align="center" prop="trayCode" />
<el-table-column label="订单号" align="center" prop="billNo" />
<el-table-column label="品号" align="center" prop="productId" />
<el-table-column label="品名" align="center" prop="productName" />
<el-table-column label="规格" align="center" prop="spec" />
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.callback_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="返回代码" align="center" prop="returnCode" />
<el-table-column label="返回信息" align="center" prop="returnMsg" />
<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)"
>修改</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['ProductionCallback:ProductionCallback:remove']"-->
<!-- >删除</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"
/>
<!-- 添加或修改ProductionCallback对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="序列号" prop="trayCode">
<el-input v-model="form.trayCode" placeholder="序列号" disabled/>
</el-form-item>
<el-form-item label="订单号" prop="billNo">
<el-input v-model="form.billNo" placeholder="请输入订单号" />
</el-form-item>
<el-form-item label="品号" prop="productId">
<el-input v-model="form.productId" placeholder="请输入品号" />
</el-form-item>
<el-form-item label="品名" prop="productName">
<el-input v-model="form.productName" placeholder="请输入品名" />
</el-form-item>
<el-form-item label="规格" prop="spec">
<el-input v-model="form.spec" placeholder="请输入规格" />
</el-form-item>
<el-form-item label="单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入单位" />
</el-form-item>
<el-form-item label="回传状态" prop="status">
<el-select v-model="form.status" placeholder="请选择回传状态">
<el-option
v-for="dict in dict.type.callback_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="form.createTime" placeholder="请输入创建时间" disabled/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listProductionCallback, getProductionCallback, delProductionCallback, updateProductionCallback } from "@/api/ProductionCallback/ProductionCallback"
export default {
name: "ProductionCallback",
dicts: ['callback_status'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// ProductionCallback表格数据
ProductionCallbackList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
billNo: null,
productId: null,
productName: null,
status: null,
returnCode: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
}
}
},
created() {
this.getList()
},
methods: {
/** 查询ProductionCallback列表 */
getList() {
this.loading = true
listProductionCallback(this.queryParams).then(response => {
this.ProductionCallbackList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
trayCode: null,
billNo: null,
productId: null,
productName: null,
spec: null,
unit: null,
status: null,
createTime: null,
returnCode: null,
returnMsg: 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.trayCode)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = "添加ProductionCallback"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const trayCode = row.trayCode || this.ids
getProductionCallback(trayCode).then(response => {
this.form = response.data
this.open = true
this.title = "修改ProductionCallback"
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.trayCode != null) {
updateProductionCallback(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addProductionCallback(this.form).then(response => {
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const trayCodes = row.trayCode || this.ids
this.$modal.confirm('是否确认删除ProductionCallback编号为"' + trayCodes + '"的数据项?').then(function() {
return delProductionCallback(trayCodes)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('erp/ProductionCallback/export', {
...this.queryParams
}, `ProductionCallback_${new Date().getTime()}.xlsx`)
}
}
}
</script>

View File

@@ -0,0 +1,338 @@
<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="erpBill">
<el-input
v-model="queryParams.erpBill"
placeholder="请输入订单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="品号" prop="spare1">
<el-input
v-model="queryParams.spare1"
placeholder="请输入品号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="任务类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择任务类型" clearable>
<el-option
v-for="dict in dict.type.callback_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="回传状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择回传状态" clearable>
<el-option
v-for="dict in dict.type.callback_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</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="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['in:transfer:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['in:transfer:edit']"
>修改</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="['in:transfer: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="['in:transfer:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="transferList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" />
<el-table-column label="任务号" align="center" prop="jobId" />
<el-table-column label="订单号" align="center" prop="erpBill" />
<el-table-column label="品号" align="center" prop="spare1" />
<el-table-column label="品名" align="center" prop="spare2" />
<el-table-column label="规格" align="center" prop="spare3" />
<el-table-column label="序列号" align="center" prop="trayCode" />
<el-table-column label="任务类型" align="center" prop="type">
<template slot-scope="scope">
<dict-tag :options="dict.type.callback_type" :value="scope.row.type"/>
</template>
</el-table-column>
<el-table-column label="回传状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.callback_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" />
<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="['in:transfer:edit']"
>修改</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['in:transfer:remove']"-->
<!-- >删除</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"
/>
<!-- 添加或修改调拨单回传对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="任务号" prop="jobId">
<el-input v-model="form.jobId" placeholder="请输入任务号" disabled/>
</el-form-item>
<el-form-item label="订单号" prop="erpBill">
<el-input v-model="form.erpBill" placeholder="请输入订单号" />
</el-form-item>
<el-form-item label="品号" prop="spare1">
<el-input v-model="form.spare1" placeholder="请输入品号" />
</el-form-item>
<el-form-item label="品名" prop="spare2">
<el-input v-model="form.spare2" placeholder="请输入品名" />
</el-form-item>
<el-form-item label="规格" prop="spare3">
<el-input v-model="form.spare3" placeholder="请输入规格" />
</el-form-item>
<el-form-item label="序列号" prop="trayCode">
<el-input v-model="form.trayCode" placeholder="请输入序列号" />
</el-form-item>
<el-form-item label="任务类型" prop="type">
<el-select v-model="form.type" placeholder="请选择任务类型">
<el-option
v-for="dict in dict.type.callback_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="回传状态" prop="status">
<el-select v-model="form.status" placeholder="请选择回传状态">
<el-option
v-for="dict in dict.type.callback_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="form.createTime" placeholder="请输入创建时间" disabled/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listTransfer, getTransfer, delTransfer, addTransfer, updateTransfer } from "@/api/in/transfer"
export default {
name: "Transfer",
dicts: ['callback_status','callback_type'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 调拨单回传表格数据
transferList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
erpBill: null,
type: null,
status: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
}
}
},
created() {
this.getList()
},
methods: {
/** 查询调拨单回传列表 */
getList() {
this.loading = true
listTransfer(this.queryParams).then(response => {
this.transferList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
id: null,
jobId: null,
erpBill: null,
type: null,
status: null,
createTime: null,
finishTime: null,
spare1: null,
spare2: null,
spare3: 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.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = "添加调拨单回传"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.id || this.ids
getTransfer(id).then(response => {
this.form = response.data
this.open = true
this.title = "修改调拨单回传"
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateTransfer(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addTransfer(this.form).then(response => {
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$modal.confirm('是否确认删除调拨单回传编号为"' + ids + '"的数据项?').then(function() {
return delTransfer(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('in/transfer/export', {
...this.queryParams
}, `transfer_${new Date().getTime()}.xlsx`)
}
}
}
</script>