add:PC海柔半成品盘点
This commit is contained in:
@@ -42,6 +42,7 @@ public enum AcsTaskEnum {
|
|||||||
TASK_STRUCT_CP_OUT("12","出库-成品-生产出库"),
|
TASK_STRUCT_CP_OUT("12","出库-成品-生产出库"),
|
||||||
TASK_STRUCT_HR_IN("26","入库-海柔半成品-生产入库"),
|
TASK_STRUCT_HR_IN("26","入库-海柔半成品-生产入库"),
|
||||||
TASK_STRUCT_HR_OUT("27","出库-海柔半成品-生产出库"),
|
TASK_STRUCT_HR_OUT("27","出库-海柔半成品-生产出库"),
|
||||||
|
TASK_STRUCT_HR_CHECK("28","海柔半成品-盘点"),
|
||||||
TASK_STRUCT_CP_CHECK("13","-盘点"),
|
TASK_STRUCT_CP_CHECK("13","-盘点"),
|
||||||
TASK_WASH_LACK("20","清洗机-缺料请求"),
|
TASK_WASH_LACK("20","清洗机-缺料请求"),
|
||||||
TASK_WASH_EMP("21","清洗机-空框请求"),
|
TASK_WASH_EMP("21","清洗机-空框请求"),
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ public enum CHECKEnum {
|
|||||||
BILL_TYPE(MapOf.of("计划盘点", "31", "临时盘点", "32")),
|
BILL_TYPE(MapOf.of("计划盘点", "31", "临时盘点", "32")),
|
||||||
//单据状态
|
//单据状态
|
||||||
BILL_STATUS(MapOf.of("生成", "10", "盘点中", "30", "完成", "99")),
|
BILL_STATUS(MapOf.of("生成", "10", "盘点中", "30", "完成", "99")),
|
||||||
|
//海柔盘点结果
|
||||||
|
CHECK_RESULT(MapOf.of("正常", "0", "异常", "1")),
|
||||||
//单据状态
|
//单据状态
|
||||||
DTL_STATUS(MapOf.of("生成", "01", "盘点中", "04", "已盘点", "05", "异常处理中", "06", "异常处理完成"
|
DTL_STATUS(MapOf.of("生成", "01", "盘点中", "04", "已盘点", "05", "异常处理中", "06", "异常处理完成"
|
||||||
, "07", "确认完成", "99")),
|
, "07", "确认完成", "99")),
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import org.nl.wms.storage_manage.semimanage.service.check.IStIvtCheckmstBcpServi
|
|||||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.IStIvtIostorinvBcpOutService;
|
import org.nl.wms.storage_manage.semimanage.service.iostorInv.IStIvtIostorinvBcpOutService;
|
||||||
import org.nl.wms.storage_manage.semimanage.service.iostorInv.IStIvtIostorinvBcpService;
|
import org.nl.wms.storage_manage.semimanage.service.iostorInv.IStIvtIostorinvBcpService;
|
||||||
import org.nl.wms.storage_manage.semimanage.service.shutFrame.IStIvtShutframeinvBcpService;
|
import org.nl.wms.storage_manage.semimanage.service.shutFrame.IStIvtShutframeinvBcpService;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.IStIvtCheckmstHrBcpService;
|
||||||
import org.nl.wms.storage_manage.semimanagehr.service.iostorInv.IStIvtIostorinvHrBcpInService;
|
import org.nl.wms.storage_manage.semimanagehr.service.iostorInv.IStIvtIostorinvHrBcpInService;
|
||||||
import org.nl.wms.storage_manage.semimanagehr.service.iostorInv.IStIvtIostorinvHrBcpOutService;
|
import org.nl.wms.storage_manage.semimanagehr.service.iostorInv.IStIvtIostorinvHrBcpOutService;
|
||||||
|
|
||||||
@@ -76,6 +77,10 @@ public enum TASKEnum implements FunctionStrategy<String, JSONObject> {
|
|||||||
IStIvtIostorinvHrBcpOutService bean = SpringContextHolder.getBean(IStIvtIostorinvHrBcpOutService.class);
|
IStIvtIostorinvHrBcpOutService bean = SpringContextHolder.getBean(IStIvtIostorinvHrBcpOutService.class);
|
||||||
bean.taskOperate(form);
|
bean.taskOperate(form);
|
||||||
}),
|
}),
|
||||||
|
HR_CP_CHECK_TASK(type -> AcsTaskEnum.TASK_STRUCT_HR_CHECK.getCode().equals(type), form -> {
|
||||||
|
IStIvtCheckmstHrBcpService bean = SpringContextHolder.getBean(IStIvtCheckmstHrBcpService.class);
|
||||||
|
bean.taskOperate(form);
|
||||||
|
}),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.controller.check;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.nl.common.anno.Log;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.IStIvtCheckmstHrBcpService;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.dto.CheckHrQuery;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 盘点单主表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/bcp/checkHr")
|
||||||
|
public class StIvtCheckmstHrBcpController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtCheckmstHrBcpService checkmstBcpService;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
@Log("查询盘点单")
|
||||||
|
//("查询盘点单")
|
||||||
|
public ResponseEntity<Object> query(CheckHrQuery query, PageQuery page) {
|
||||||
|
return new ResponseEntity<>(checkmstBcpService.pageQuery(query, page), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Log("创建盘点单")
|
||||||
|
//("创建盘点单")
|
||||||
|
public ResponseEntity<Object> create(@RequestBody JSONObject whereJson) {
|
||||||
|
checkmstBcpService.create(whereJson);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getCheckDtl")
|
||||||
|
@Log("查询盘点明细")
|
||||||
|
//("查询盘点明细")
|
||||||
|
public ResponseEntity<Object> getCheckDtl(@RequestBody JSONObject whereJson) {
|
||||||
|
return new ResponseEntity<>(checkmstBcpService.getCheckDtl(whereJson), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/update")
|
||||||
|
@Log("修改盘点单")
|
||||||
|
//("修改盘点单")
|
||||||
|
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson) {
|
||||||
|
checkmstBcpService.update(whereJson);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/delete")
|
||||||
|
@Log("删除盘点单")
|
||||||
|
//("删除盘点单")
|
||||||
|
public ResponseEntity<Object> delete(@RequestBody Long[] ids){
|
||||||
|
checkmstBcpService.delete(ids);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/issueTask")
|
||||||
|
@Log("下发任务")
|
||||||
|
//("下发任务")
|
||||||
|
public ResponseEntity<Object> issueTask(@RequestBody JSONObject whereJson) {
|
||||||
|
checkmstBcpService.issueTask(whereJson);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.service.check;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.dao.StIvtCheckdtlHrBcp;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.dao.StIvtCheckmstHrBcp;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 盘点单明细表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
public interface IStIvtCheckdtlHrBcpService extends IService<StIvtCheckdtlHrBcp> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主单据使用 创建明细
|
||||||
|
* @param row /
|
||||||
|
* @param mst /
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
double create(JSONArray row, StIvtCheckmstHrBcp mst);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取明细
|
||||||
|
* @param map /
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
List<Map> getCheckDtl(JSONObject map);
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.service.check;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.dao.StIvtCheckmstHrBcp;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.dto.CheckHrQuery;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 盘点单主表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
public interface IStIvtCheckmstHrBcpService extends IService<StIvtCheckmstHrBcp> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
* @param query,page /
|
||||||
|
* @return JSONObject
|
||||||
|
*/
|
||||||
|
Object pageQuery(CheckHrQuery query, PageQuery page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建盘点单
|
||||||
|
* @param jo /
|
||||||
|
*/
|
||||||
|
void create(JSONObject jo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取盘点单明细
|
||||||
|
* @param map
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
List<Map> getCheckDtl(JSONObject map);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改盘点单
|
||||||
|
* @param map /
|
||||||
|
*/
|
||||||
|
void update(JSONObject map);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
* @param ids
|
||||||
|
* {
|
||||||
|
* 主表id..
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
void delete(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下发任务
|
||||||
|
* @param jo /
|
||||||
|
*/
|
||||||
|
void issueTask(JSONObject jo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务反馈处理
|
||||||
|
* @param jo /
|
||||||
|
*/
|
||||||
|
void taskOperate(JSONObject jo);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.service.check.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 盘点单明细表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("st_ivt_checkdtl_hr_bcp")
|
||||||
|
public class StIvtCheckdtlHrBcp implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点单明细id
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private String checkdtl_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点单标识
|
||||||
|
*/
|
||||||
|
private String check_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点单号
|
||||||
|
*/
|
||||||
|
private String check_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 明细序号
|
||||||
|
*/
|
||||||
|
private BigDecimal seq_no;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点库区
|
||||||
|
*/
|
||||||
|
private String sect_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库区名称
|
||||||
|
*/
|
||||||
|
private String sect_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点货位
|
||||||
|
*/
|
||||||
|
private String struct_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 货位名称
|
||||||
|
*/
|
||||||
|
private String struct_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点站台
|
||||||
|
*/
|
||||||
|
private String checkpoint_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存储载具标识
|
||||||
|
*/
|
||||||
|
private String storagevehicle_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存储载具编码
|
||||||
|
*/
|
||||||
|
private String storagevehicle_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料标识
|
||||||
|
*/
|
||||||
|
private String material_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
private BigDecimal base_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量计量单位标识
|
||||||
|
*/
|
||||||
|
private String qty_unit_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量计量单位名称
|
||||||
|
*/
|
||||||
|
private String qty_unit_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已下发
|
||||||
|
*/
|
||||||
|
private String is_down;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点数量
|
||||||
|
*/
|
||||||
|
private BigDecimal fac_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点结果
|
||||||
|
*/
|
||||||
|
private String check_result;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点人
|
||||||
|
*/
|
||||||
|
private String check_optid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点人姓名
|
||||||
|
*/
|
||||||
|
private String check_optname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点时间
|
||||||
|
*/
|
||||||
|
private String check_time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异常是否处理
|
||||||
|
*/
|
||||||
|
private Boolean is_process;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异常处理方式
|
||||||
|
*/
|
||||||
|
private String process_type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异常处理人
|
||||||
|
*/
|
||||||
|
private String process_optid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理时间
|
||||||
|
*/
|
||||||
|
private String process_time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务标识
|
||||||
|
*/
|
||||||
|
private String task_id;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,168 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.service.check.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 盘点单主表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("st_ivt_checkmst_hr_bcp")
|
||||||
|
public class StIvtCheckmstHrBcp implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点单标识
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private String check_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点单号
|
||||||
|
*/
|
||||||
|
private String check_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务类型
|
||||||
|
*/
|
||||||
|
private String buss_type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 盘点单类型
|
||||||
|
*/
|
||||||
|
private String check_type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库标识
|
||||||
|
*/
|
||||||
|
private String stor_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库名称
|
||||||
|
*/
|
||||||
|
private String stor_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 明细数
|
||||||
|
*/
|
||||||
|
private BigDecimal dtl_num;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成方式
|
||||||
|
*/
|
||||||
|
private String create_mode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String create_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人姓名
|
||||||
|
*/
|
||||||
|
private String create_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private String create_time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核人
|
||||||
|
*/
|
||||||
|
private String audit_optid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核人姓名
|
||||||
|
*/
|
||||||
|
private String audit_optname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核时间
|
||||||
|
*/
|
||||||
|
private String audit_time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认人
|
||||||
|
*/
|
||||||
|
private String confirm_optid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认人姓名
|
||||||
|
*/
|
||||||
|
private String confirm_optname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确认时间
|
||||||
|
*/
|
||||||
|
private String confirm_time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除
|
||||||
|
*/
|
||||||
|
private Boolean is_delete;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否盘点有异
|
||||||
|
*/
|
||||||
|
private Boolean is_nok;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已上传
|
||||||
|
*/
|
||||||
|
private Boolean is_upload;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回传人
|
||||||
|
*/
|
||||||
|
private String upload_optid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回传入姓名
|
||||||
|
*/
|
||||||
|
private String upload_optname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回传时间
|
||||||
|
*/
|
||||||
|
private String upload_time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门ID
|
||||||
|
*/
|
||||||
|
private String sysdeptid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司ID
|
||||||
|
*/
|
||||||
|
private String syscompanyid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车间标识
|
||||||
|
*/
|
||||||
|
private String workshop_id;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.service.check.dao.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.nl.wms.storage_manage.semimanage.service.check.dao.StIvtCheckdtlBcp;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.dao.StIvtCheckdtlHrBcp;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 盘点单明细表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
public interface StIvtCheckdtlHrBcpMapper extends BaseMapper<StIvtCheckdtlHrBcp> {
|
||||||
|
|
||||||
|
List<Map> getCheckDtl(@Param("map") Map map);
|
||||||
|
|
||||||
|
List<StIvtCheckdtlBcp> queryCheckDtlByTask(@Param("map") Map map);
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.service.check.dao.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.dao.StIvtCheckmstHrBcp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 盘点单主表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
public interface StIvtCheckmstHrBcpMapper extends BaseMapper<StIvtCheckmstHrBcp> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
<?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="org.nl.wms.storage_manage.semimanagehr.service.check.dao.mapper.StIvtCheckdtlHrBcpMapper">
|
||||||
|
|
||||||
|
<select id="getCheckDtl" resultType="java.util.Map">
|
||||||
|
SELECT
|
||||||
|
CheckDtl.*,
|
||||||
|
struct.struct_code,
|
||||||
|
struct.sect_code,
|
||||||
|
mb.material_code,
|
||||||
|
mb.material_name,
|
||||||
|
user1.person_name AS process_optname,
|
||||||
|
ivt.unit_weight
|
||||||
|
FROM
|
||||||
|
st_ivt_checkdtl_hr_bcp CheckDtl
|
||||||
|
LEFT JOIN md_me_materialbase mb ON mb.material_id = CheckDtl.material_id
|
||||||
|
LEFT JOIN st_ivt_structattr struct ON struct.struct_id = CheckDtl.struct_id
|
||||||
|
LEFT JOIN sys_user user1 ON user1.user_id = CheckDtl.process_optid
|
||||||
|
LEFT JOIN st_ivt_structivt_bcp ivt ON ivt.struct_id = struct.struct_id
|
||||||
|
<where>
|
||||||
|
1=1
|
||||||
|
<if test="map.check_id != '' and map.check_id != null">
|
||||||
|
and CheckDtl.check_id = #{map.check_id}
|
||||||
|
</if>
|
||||||
|
<if test="map.checkdtl_id != '' and map.checkdtl_id != null">
|
||||||
|
and CheckDtl.checkdtl_id = #{map.checkdtl_id}
|
||||||
|
</if>
|
||||||
|
<if test="map.status != '' and map.status != null">
|
||||||
|
and #{map.status} >= CheckDtl.status
|
||||||
|
</if>
|
||||||
|
<if test="map.check_result != '' and map.check_result != null and map.check_result != '-1'">
|
||||||
|
and #{map.check_result} = CheckDtl.check_result
|
||||||
|
</if>
|
||||||
|
<if test="map.check_result == '-1'">
|
||||||
|
and CheckDtl.check_result IN ('1','2')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by CheckDtl.seq_no
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="queryCheckDtlByTask" resultType="org.nl.wms.storage_manage.semimanagehr.service.check.dao.StIvtCheckdtlHrBcp">
|
||||||
|
SELECT
|
||||||
|
dtl.*
|
||||||
|
FROM
|
||||||
|
sch_base_task task
|
||||||
|
LEFT JOIN st_ivt_structattr sa ON (sa.struct_code = task.point_code2 OR sa.struct_code = task.point_code1)
|
||||||
|
LEFT JOIN st_ivt_checkdtl_hr_bcp dtl ON dtl.struct_id = sa.struct_id
|
||||||
|
LEFT JOIN st_ivt_checkmst_hr_bcp mst ON mst.check_id = dtl.check_id
|
||||||
|
<where>
|
||||||
|
task.task_id = #{map.task_id}
|
||||||
|
AND
|
||||||
|
dtl.`status` not IN ('01','99')
|
||||||
|
AND
|
||||||
|
mst.is_delete = '0'
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?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="org.nl.wms.storage_manage.semimanagehr.service.check.dao.mapper.StIvtCheckmstHrBcpMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.service.check.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.nl.common.domain.query.BaseQuery;
|
||||||
|
import org.nl.common.domain.query.QParam;
|
||||||
|
import org.nl.common.enums.QueryTEnum;
|
||||||
|
import org.nl.wms.storage_manage.semimanage.service.check.dao.StIvtCheckmstBcp;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.dao.StIvtCheckmstHrBcp;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @author ZZQ
|
||||||
|
* @Date 2023/5/4 19:49
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CheckHrQuery extends BaseQuery<StIvtCheckmstHrBcp> {
|
||||||
|
|
||||||
|
|
||||||
|
private String stor_id;
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
private String check_type;
|
||||||
|
|
||||||
|
private String check_code;
|
||||||
|
|
||||||
|
private Boolean is_delete = false;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paramMapping() {
|
||||||
|
super.doP.put("check_code", QParam.builder().k(new String[]{"check_code"}).type(QueryTEnum.LK).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.service.check.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.nl.common.utils.IdUtil;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtSectattrService;
|
||||||
|
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||||
|
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtSectattr;
|
||||||
|
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||||
|
import org.nl.wms.storage_manage.CHECKEnum;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.IStIvtCheckdtlHrBcpService;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.dao.StIvtCheckdtlHrBcp;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.dao.StIvtCheckmstHrBcp;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.dao.mapper.StIvtCheckdtlHrBcpMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 盘点单明细表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class StIvtCheckdtlHrBcpServiceImpl extends ServiceImpl<StIvtCheckdtlHrBcpMapper, StIvtCheckdtlHrBcp> implements IStIvtCheckdtlHrBcpService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtSectattrService sectattrService;
|
||||||
|
@Autowired
|
||||||
|
private IStIvtStructattrService structattrService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double create(JSONArray rows, StIvtCheckmstHrBcp mst) {
|
||||||
|
double total_qty = 0;
|
||||||
|
|
||||||
|
if (rows.size() > 0 && ObjectUtil.isNotEmpty(mst)) {
|
||||||
|
// 先删除在插入
|
||||||
|
this.remove(new QueryWrapper<StIvtCheckdtlHrBcp>().eq("check_id", mst.getCheck_id()));
|
||||||
|
|
||||||
|
for (int i = 0; i < rows.size(); i++) {
|
||||||
|
String checkdtl_id = IdUtil.getStringId();
|
||||||
|
StIvtCheckdtlHrBcp row = rows.getJSONObject(i).toJavaObject(StIvtCheckdtlHrBcp.class);
|
||||||
|
row.setCheckdtl_id(checkdtl_id);
|
||||||
|
row.setCheck_id(mst.getCheck_id());
|
||||||
|
row.setCheck_code(mst.getCheck_code());
|
||||||
|
row.setSeq_no(BigDecimal.valueOf(i + 1));
|
||||||
|
row.setIs_down("0");
|
||||||
|
|
||||||
|
// 获取库区信息
|
||||||
|
QueryWrapper<StIvtSectattr> sect_wrapper = new QueryWrapper<>();
|
||||||
|
sect_wrapper.eq("sect_id", row.getSect_id());
|
||||||
|
sect_wrapper.eq("is_used", true);
|
||||||
|
StIvtSectattr sectDao = sectattrService.getOne(sect_wrapper);
|
||||||
|
if (ObjectUtil.isEmpty(sectDao)) throw new BadRequestException("库区不存在或未启用!");
|
||||||
|
row.setSect_name(sectDao.getSect_name());
|
||||||
|
// 获取仓位信息
|
||||||
|
QueryWrapper<StIvtStructattr> struct_wrapper = new QueryWrapper<>();
|
||||||
|
struct_wrapper.eq("struct_id", row.getStruct_id());
|
||||||
|
struct_wrapper.eq("is_used", true);
|
||||||
|
StIvtStructattr structDao = structattrService.getOne(struct_wrapper);
|
||||||
|
if (ObjectUtil.isEmpty(structDao)) throw new BadRequestException("仓位不存在或未启用!");
|
||||||
|
row.setStruct_name(structDao.getStruct_name());
|
||||||
|
|
||||||
|
row.setStatus(CHECKEnum.DTL_STATUS.code("生成"));
|
||||||
|
this.save(row);
|
||||||
|
|
||||||
|
//锁定货位
|
||||||
|
structattrService.update(new UpdateWrapper<StIvtStructattr>().set("lock_type", "1").set("inv_code",mst.getCheck_code()).eq("struct_id", row.getStruct_id()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return total_qty;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map> getCheckDtl(JSONObject map) {
|
||||||
|
return this.baseMapper.getCheckDtl(map);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,336 @@
|
|||||||
|
package org.nl.wms.storage_manage.semimanagehr.service.check.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.map.MapUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import io.jsonwebtoken.lang.Assert;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.nl.common.TableDataInfo;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.common.enums.AcsTaskEnum;
|
||||||
|
import org.nl.common.publish.BussEventMulticaster;
|
||||||
|
import org.nl.common.publish.event.PointEvent;
|
||||||
|
import org.nl.common.utils.IdUtil;
|
||||||
|
import org.nl.common.utils.MapOf;
|
||||||
|
import org.nl.common.utils.SecurityUtils;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.modules.system.util.CodeUtil;
|
||||||
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
|
import org.nl.wms.ext_manage.acs.service.WmsToAcsService;
|
||||||
|
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
||||||
|
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtStructattrService;
|
||||||
|
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||||
|
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||||
|
import org.nl.wms.scheduler_manage.service.extendtask.manage.TaskStatusEnum;
|
||||||
|
import org.nl.wms.scheduler_manage.service.point.ISchBasePointService;
|
||||||
|
import org.nl.wms.scheduler_manage.service.point.dao.SchBasePoint;
|
||||||
|
import org.nl.wms.scheduler_manage.service.point.dao.mapper.SchBasePointMapper;
|
||||||
|
import org.nl.wms.scheduler_manage.service.task.ISchBaseTaskService;
|
||||||
|
import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask;
|
||||||
|
import org.nl.wms.storage_manage.CHECKEnum;
|
||||||
|
import org.nl.wms.storage_manage.IOSEnum;
|
||||||
|
import org.nl.wms.storage_manage.pda.PDAEnum;
|
||||||
|
import org.nl.wms.storage_manage.semimanage.service.check.dao.StIvtCheckdtlBcp;
|
||||||
|
import org.nl.wms.storage_manage.semimanage.service.check.dao.mapper.StIvtCheckdtlBcpMapper;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.IStIvtCheckdtlHrBcpService;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.IStIvtCheckmstHrBcpService;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.dao.StIvtCheckdtlHrBcp;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.dao.StIvtCheckmstHrBcp;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.dao.mapper.StIvtCheckdtlHrBcpMapper;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.dao.mapper.StIvtCheckmstHrBcpMapper;
|
||||||
|
import org.nl.wms.storage_manage.semimanagehr.service.check.dto.CheckHrQuery;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 盘点单主表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author generator
|
||||||
|
* @since 2023-05-10
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class StIvtCheckmstHrBcpServiceImpl extends ServiceImpl<StIvtCheckmstHrBcpMapper, StIvtCheckmstHrBcp> implements IStIvtCheckmstHrBcpService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtBsrealstorattrService stIvtBsrealstorattrService; // 实物属性服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtCheckdtlHrBcpService checkdtlBcpService; // 盘点明细服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtStructattrService structattrService; // 仓位服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StIvtCheckdtlHrBcpMapper checkdtlBcpMapper; // 明细mapper
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SchBasePointMapper pointMapper; // 点位服务mapper
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchBasePointService iSchBasePointService; // 点位服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchBaseTaskService iSchBaseTaskService; // 任务服务
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object pageQuery(CheckHrQuery query, PageQuery page) {
|
||||||
|
// 查询条件
|
||||||
|
page.setSort("check_code,desc");
|
||||||
|
page.setIsAsc(true);
|
||||||
|
// 分页查询
|
||||||
|
Page<StIvtCheckmstHrBcp> pageQuery = this.page(page.build(), query.build());
|
||||||
|
TableDataInfo<StIvtCheckmstHrBcp> build = TableDataInfo.build(pageQuery);
|
||||||
|
return build;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void create(JSONObject form) {
|
||||||
|
JSONArray rows = form.getJSONArray("tableData");
|
||||||
|
if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空");
|
||||||
|
|
||||||
|
// 调用主表 插入/更新方法
|
||||||
|
StIvtCheckmstHrBcp checkmstYl = packageMstForm(new StIvtCheckmstHrBcp(), form);
|
||||||
|
this.save(checkmstYl);
|
||||||
|
|
||||||
|
//调用明细表 插入方法
|
||||||
|
checkdtlBcpService.create(rows, checkmstYl);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map> getCheckDtl(JSONObject map) {
|
||||||
|
return checkdtlBcpService.getCheckDtl(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void update(JSONObject form) {
|
||||||
|
Assert.notNull(new Object[]{form, form.get("check_id")}, "请求参数不能为空");
|
||||||
|
StIvtCheckmstHrBcp mst = form.toJavaObject(StIvtCheckmstHrBcp.class);
|
||||||
|
this.updateById(mst);
|
||||||
|
|
||||||
|
JSONArray rows = form.getJSONArray("tableData");
|
||||||
|
if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空");
|
||||||
|
// 调用明细表 插入/更新方法
|
||||||
|
checkdtlBcpService.create(rows, mst);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void issueTask(JSONObject form) {
|
||||||
|
Assert.notNull(new Object[]{form, form.get("checkdtl_id")}, "请求参数不能为空");
|
||||||
|
|
||||||
|
StIvtCheckdtlHrBcp dtl = checkdtlBcpService.getById(form.getString("checkdtl_id"));
|
||||||
|
|
||||||
|
if (dtl.getIs_down().equals(IOSEnum.IS_USED.code("是"))) {
|
||||||
|
throw new BadRequestException("当前货位任务已下发!");
|
||||||
|
}
|
||||||
|
|
||||||
|
StIvtCheckmstHrBcp mst = this.getById(dtl.getCheck_id());
|
||||||
|
|
||||||
|
StIvtStructattr struct = structattrService.getOne(
|
||||||
|
new QueryWrapper<StIvtStructattr>().lambda()
|
||||||
|
.eq(StIvtStructattr::getStruct_id, dtl.getStruct_id())
|
||||||
|
);
|
||||||
|
|
||||||
|
// 生成任务
|
||||||
|
String task_group_id = IdUtil.getStringId();
|
||||||
|
PointEvent event = PointEvent.builder()
|
||||||
|
.acs_task_type("7")
|
||||||
|
.type(AcsTaskEnum.TASK_STRUCT_HR_CHECK)
|
||||||
|
.point_code1(struct.getStruct_code())
|
||||||
|
.point_code3(struct.getStruct_code())
|
||||||
|
.vehicle_code(dtl.getStoragevehicle_code())
|
||||||
|
.task_group_id(task_group_id)
|
||||||
|
.product_area(mst.getWorkshop_id())
|
||||||
|
.callback((Consumer<String>) dtl::setTask_id)
|
||||||
|
.build();
|
||||||
|
BussEventMulticaster.Publish(event);
|
||||||
|
|
||||||
|
// 下发任务
|
||||||
|
SchBaseTask taskDao = iSchBaseTaskService.getOne(
|
||||||
|
new QueryWrapper<SchBaseTask>().lambda()
|
||||||
|
.eq(SchBaseTask::getTask_id, dtl.getTask_id())
|
||||||
|
);
|
||||||
|
|
||||||
|
sendTask(taskDao);
|
||||||
|
|
||||||
|
// 更新明细表
|
||||||
|
dtl.setIs_down(IOSEnum.IS_USED.code("是"));
|
||||||
|
dtl.setStatus(CHECKEnum.BILL_STATUS.code("盘点中"));
|
||||||
|
checkdtlBcpService.updateById(dtl);
|
||||||
|
|
||||||
|
mst.setStatus(CHECKEnum.BILL_STATUS.code("盘点中"));
|
||||||
|
this.updateById(mst);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void taskOperate(JSONObject form) {
|
||||||
|
String task_id = form.getString("task_id");
|
||||||
|
String status = form.getString("status");
|
||||||
|
|
||||||
|
if (status.equals(AcsTaskEnum.STATUS_FINISH.getCode())) {
|
||||||
|
// 完成
|
||||||
|
|
||||||
|
// 更新任务
|
||||||
|
iSchBaseTaskService.update(
|
||||||
|
new UpdateWrapper<SchBaseTask>().lambda()
|
||||||
|
.set(SchBaseTask::getTask_status,TaskStatusEnum.FINISHED.getCode())
|
||||||
|
.eq(SchBaseTask::getTask_id,task_id )
|
||||||
|
);
|
||||||
|
|
||||||
|
// 更新明细
|
||||||
|
StIvtCheckdtlHrBcp dtlDao = checkdtlBcpService.getOne(
|
||||||
|
new QueryWrapper<StIvtCheckdtlHrBcp>().lambda()
|
||||||
|
.eq(StIvtCheckdtlHrBcp::getTask_id, task_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
dtlDao.setStatus(CHECKEnum.BILL_STATUS.code("完成"));
|
||||||
|
dtlDao.setCheck_result(CHECKEnum.CHECK_RESULT.code("正常"));
|
||||||
|
checkdtlBcpService.updateById(dtlDao);
|
||||||
|
|
||||||
|
// 更新主表
|
||||||
|
updateMst(dtlDao.getCheck_id());
|
||||||
|
|
||||||
|
} else if (status.equals(AcsTaskEnum.STATUS_START.getCode())) {
|
||||||
|
// 执行中
|
||||||
|
|
||||||
|
// 更新任务
|
||||||
|
iSchBaseTaskService.update(
|
||||||
|
new UpdateWrapper<SchBaseTask>().lambda()
|
||||||
|
.set(SchBaseTask::getTask_status,TaskStatusEnum.EXECUTING.getCode())
|
||||||
|
.eq(SchBaseTask::getTask_id,task_id )
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void delete(Long[] ids) {
|
||||||
|
for (Long id : ids) {
|
||||||
|
StIvtCheckmstHrBcp dao = this.getOne(new QueryWrapper<StIvtCheckmstHrBcp>().eq("check_id", id));
|
||||||
|
dao.setIs_delete(true);
|
||||||
|
|
||||||
|
//获取所有明细下的仓位解锁
|
||||||
|
List<StIvtCheckdtlHrBcp> dtl_list = checkdtlBcpService.list(new QueryWrapper<StIvtCheckdtlHrBcp>().eq("check_id", id));
|
||||||
|
dtl_list.stream()
|
||||||
|
.map(dtl -> dtl.getStruct_id())
|
||||||
|
.distinct()
|
||||||
|
.forEach(struct_id -> structattrService.update(new UpdateWrapper<StIvtStructattr>().set("inv_code", "").set("lock_type", "0").eq("struct_id", struct_id)));
|
||||||
|
this.updateById(dao);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendTask(SchBaseTask taskDao) {
|
||||||
|
JSONArray param = new JSONArray();
|
||||||
|
param.add(JSON.parseObject(JSONUtil.toJsonStr(taskDao)));
|
||||||
|
// 1.下发任务
|
||||||
|
WmsToAcsService bean = SpringContextHolder.getBean(WmsToAcsService.class);
|
||||||
|
Map<String, Object> result = bean.issueTaskToAcs3(param);
|
||||||
|
|
||||||
|
// 反馈失败报错
|
||||||
|
if (!ObjectUtil.equal(MapUtil.getStr(result, "status"),"200")) {
|
||||||
|
throw new BadRequestException("下发失败:"+MapUtil.getStr(result, "message"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2.更新任务状态
|
||||||
|
taskDao.setTask_status(TaskStatusEnum.ISSUE.getCode());
|
||||||
|
iSchBaseTaskService.updateById(taskDao);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private StIvtCheckmstHrBcp packageMstForm(StIvtCheckmstHrBcp checkmstYl, JSONObject whereJson) {
|
||||||
|
JSONArray rows = whereJson.getJSONArray("tableData");
|
||||||
|
// 新增
|
||||||
|
checkmstYl.setCheck_id(IdUtil.getStringId());
|
||||||
|
checkmstYl.setCheck_code(CodeUtil.getNewCode("PD_CODE"));
|
||||||
|
checkmstYl.setBuss_type(whereJson.getString("check_type"));
|
||||||
|
checkmstYl.setCheck_type(checkmstYl.getBuss_type());
|
||||||
|
|
||||||
|
// 获取仓库信息
|
||||||
|
QueryWrapper<StIvtBsrealstorattr> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.eq("stor_id", whereJson.getString("stor_id"));
|
||||||
|
wrapper.eq("is_used", true);
|
||||||
|
StIvtBsrealstorattr bsrealDao = stIvtBsrealstorattrService.getOne(wrapper);
|
||||||
|
if (ObjectUtil.isEmpty(bsrealDao)) throw new BadRequestException("仓库不存在或未启用!");
|
||||||
|
|
||||||
|
checkmstYl.setStor_id(bsrealDao.getStor_id());
|
||||||
|
checkmstYl.setStor_name(bsrealDao.getStor_name());
|
||||||
|
checkmstYl.setDtl_num(BigDecimal.valueOf(rows.size()));
|
||||||
|
checkmstYl.setCreate_mode(CHECKEnum.CREATE_MODE.code("PC产生"));
|
||||||
|
checkmstYl.setStatus(CHECKEnum.BILL_STATUS.code("生成"));
|
||||||
|
checkmstYl.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||||
|
checkmstYl.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||||
|
checkmstYl.setCreate_time(DateUtil.now());
|
||||||
|
checkmstYl.setIs_delete(false);
|
||||||
|
checkmstYl.setIs_upload(true);
|
||||||
|
// TODO 暂时写死
|
||||||
|
checkmstYl.setSysdeptid("111");
|
||||||
|
checkmstYl.setSyscompanyid("111");
|
||||||
|
|
||||||
|
checkmstYl.setRemark(whereJson.getString("remark"));
|
||||||
|
checkmstYl.setWorkshop_id(whereJson.getString("workshop_id"));
|
||||||
|
|
||||||
|
return checkmstYl;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateMst(String check_id) {
|
||||||
|
|
||||||
|
StIvtCheckmstHrBcp mstDao = this.getById(check_id);
|
||||||
|
|
||||||
|
List<StIvtCheckdtlHrBcp> dtlDaoList = checkdtlBcpService.list(
|
||||||
|
new QueryWrapper<StIvtCheckdtlHrBcp>().lambda()
|
||||||
|
.eq(StIvtCheckdtlHrBcp::getCheck_id, check_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 判断是否都为完成
|
||||||
|
boolean is_status = dtlDaoList.stream()
|
||||||
|
.anyMatch(row -> row.getStatus().equals(CHECKEnum.BILL_STATUS.code("完成")));
|
||||||
|
|
||||||
|
if (is_status) {
|
||||||
|
// 完成单据
|
||||||
|
mstDao.setStatus(CHECKEnum.BILL_STATUS.code("完成"));
|
||||||
|
|
||||||
|
// 解锁全部货位
|
||||||
|
for (StIvtCheckdtlHrBcp dtlDao : dtlDaoList) {
|
||||||
|
structattrService.update(
|
||||||
|
new UpdateWrapper<StIvtStructattr>().lambda()
|
||||||
|
.set(StIvtStructattr::getLock_type, IOSEnum.LOCK_TYPE.code("未锁定"))
|
||||||
|
.eq(StIvtStructattr::getStruct_id, dtlDao.getStruct_id())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断是否都为正常
|
||||||
|
boolean is_check = dtlDaoList.stream()
|
||||||
|
.filter(row -> ObjectUtil.isNotEmpty(row.getCheck_result()))
|
||||||
|
.anyMatch(row -> row.getCheck_result().equals(CHECKEnum.CHECK_RESULT.code("正常")));
|
||||||
|
|
||||||
|
mstDao.setIs_nok(is_check);
|
||||||
|
|
||||||
|
this.updateById(mstDao);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,338 @@
|
|||||||
|
<!--suppress ALL -->
|
||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="盘点单新增"
|
||||||
|
append-to-body
|
||||||
|
fullscreen
|
||||||
|
:before-close="crud.cancelCU"
|
||||||
|
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||||
|
@open="open"
|
||||||
|
@close="close"
|
||||||
|
>
|
||||||
|
<el-row v-show="crud.status.cu > 0" :gutter="20">
|
||||||
|
<el-col :span="20" style="border: 1px solid white">
|
||||||
|
<span />
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<span>
|
||||||
|
<el-button
|
||||||
|
icon="el-icon-check"
|
||||||
|
size="mini"
|
||||||
|
:loading="crud.cu === 2"
|
||||||
|
type="primary"
|
||||||
|
@click="crud.submitCU"
|
||||||
|
>保存</el-button>
|
||||||
|
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||||
|
</span>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-form
|
||||||
|
ref="form"
|
||||||
|
style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;"
|
||||||
|
:inline="true"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
size="mini"
|
||||||
|
label-width="85px"
|
||||||
|
label-suffix=":"
|
||||||
|
>
|
||||||
|
<el-input v-show="false" v-model="form.stor_code" placeholder="仓库编码" />
|
||||||
|
<el-input v-show="false" v-model="form.stor_name" placeholder="仓库名称" />
|
||||||
|
<el-form-item label="单据号" prop="bill_code">
|
||||||
|
<label slot="label">单 据 号:</label>
|
||||||
|
<el-input v-model.trim="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="车间" prop="workshop_id">
|
||||||
|
<label slot="label">车间</label>
|
||||||
|
<el-select
|
||||||
|
v-model="form.workshop_id"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
:disabled="crud.status.view > 0"
|
||||||
|
placeholder="全部"
|
||||||
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.product_area"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="仓库" prop="stor_id">
|
||||||
|
<label slot="label">仓 库:</label>
|
||||||
|
<el-select
|
||||||
|
v-model="form.stor_id"
|
||||||
|
clearable
|
||||||
|
placeholder="仓库"
|
||||||
|
class="filter-item"
|
||||||
|
style="width: 210px"
|
||||||
|
:disabled="crud.status.view > 0"
|
||||||
|
@change="storChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in storlist"
|
||||||
|
:key="item.stor_id"
|
||||||
|
:label="item.stor_name"
|
||||||
|
:value="item.stor_id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="业务类型" prop="check_type">
|
||||||
|
<el-select
|
||||||
|
v-model="form.check_type"
|
||||||
|
clearable
|
||||||
|
placeholder="业务类型"
|
||||||
|
style="width: 210px"
|
||||||
|
class="filter-item"
|
||||||
|
:disabled="crud.status.view > 0"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.ST_INV_CK_TYPE"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="单据状态" prop="status">
|
||||||
|
<el-select
|
||||||
|
v-model="form.status"
|
||||||
|
placeholder="单据状态"
|
||||||
|
class="filter-item"
|
||||||
|
:disabled="true"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.CHECK_BILL_STATUS"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="明细数" prop="dtl_num">
|
||||||
|
<label slot="label">明 细 数:</label>
|
||||||
|
<el-input v-model.trim="form.dtl_num" size="mini" disabled style="width: 210px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<label slot="label">备 注:</label>
|
||||||
|
<el-input
|
||||||
|
v-model.trim="form.remark"
|
||||||
|
style="width: 380px;"
|
||||||
|
rows="2"
|
||||||
|
type="textarea"
|
||||||
|
:disabled="crud.status.view > 0"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div class="crud-opts2">
|
||||||
|
<span class="role-span">盘点明细</span>
|
||||||
|
<span v-if="crud.status.cu > 0" class="crud-opts-right2">
|
||||||
|
|
||||||
|
<!--左侧插槽-->
|
||||||
|
<slot name="left" />
|
||||||
|
<el-button
|
||||||
|
slot="left"
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="queryDtl()"
|
||||||
|
>
|
||||||
|
添加盘点物料
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
:data="form.tableData"
|
||||||
|
border
|
||||||
|
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||||
|
<el-table-column prop="sect_name" label="盘点库区" align="center" />
|
||||||
|
<el-table-column prop="struct_name" label="盘点货位" align="center" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="120" align="center" />
|
||||||
|
<el-table-column prop="material_name" label="物料名称" align="center" min-width="120" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="base_qty" label="重量/数量" align="center" :formatter="crud.formatNum0" />
|
||||||
|
<el-table-column prop="unit_weight" label="单重" align="center" />
|
||||||
|
<el-table-column prop="storagevehicle_code" label="载具号" align="center" />
|
||||||
|
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="160" fixed="right">
|
||||||
|
<template scope="scope">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click.native.prevent="deleteRow(scope.$index, form.tableData)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<AddDtl :dialog-show.sync="dtlShow" @tableChanged="tableChanged" />
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import CRUD, { crud, form } from '@crud/crud'
|
||||||
|
import AddDtl from '@/views/wms/storage_manage/semiproducthr/semiproductHrCheck/StructIvt'
|
||||||
|
import check from '@/views/wms/storage_manage/semiproducthr/semiproductHrCheck/check'
|
||||||
|
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
|
||||||
|
|
||||||
|
const defaultForm = {
|
||||||
|
check_code: '',
|
||||||
|
stor_id: '',
|
||||||
|
stor_code: '',
|
||||||
|
stor_name: '',
|
||||||
|
status: '10',
|
||||||
|
dtl_num: '0',
|
||||||
|
check_type: '',
|
||||||
|
workshop_id: '',
|
||||||
|
remark: '',
|
||||||
|
create_mode: '',
|
||||||
|
tableData: []
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
name: 'AddDialog',
|
||||||
|
components: { AddDtl },
|
||||||
|
mixins: [crud(), form(defaultForm)],
|
||||||
|
props: {
|
||||||
|
dialogShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dicts: ['CHECK_BILL_STATUS', 'ST_INV_CK_TYPE', 'check_dtl_status', 'product_area'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
dtlShow: false,
|
||||||
|
flagnow: false,
|
||||||
|
nowrow: {},
|
||||||
|
nowindex: '',
|
||||||
|
storlist: [],
|
||||||
|
rules: {
|
||||||
|
stor_id: [
|
||||||
|
{ required: true, message: '仓库不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
check_type: [
|
||||||
|
{ required: true, message: '业务类型不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
workshop_id: [
|
||||||
|
{ required: true, message: '车间不能为空', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dialogShow: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.dialogVisible = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
// 查询原材料库的仓库
|
||||||
|
crudStorattr.getStor({ 'stor_type': '5' }).then(res => {
|
||||||
|
this.storlist = res.content
|
||||||
|
})
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit('AddChanged')
|
||||||
|
},
|
||||||
|
[CRUD.HOOK.afterToEdit]() {
|
||||||
|
check.getCheckDtl({ 'check_id': this.form.check_id }).then(res => {
|
||||||
|
this.form.tableData = res
|
||||||
|
// 将明细变成不可编辑
|
||||||
|
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||||
|
const row = this.form.tableData[i]
|
||||||
|
row.edit = true
|
||||||
|
this.form.tableData.splice(i, 1, row)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
[CRUD.HOOK.afterToView]() {
|
||||||
|
check.getCheckDtl({ 'check_id': this.form.check_id }).then(res => {
|
||||||
|
this.form.tableData = res
|
||||||
|
// 将明细变成不可编辑
|
||||||
|
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||||
|
const row = this.form.tableData[i]
|
||||||
|
row.edit = true
|
||||||
|
this.form.tableData.splice(i, 1, row)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
storChange(row) {
|
||||||
|
this.storlist.forEach((item) => {
|
||||||
|
if (item.stor_id === row) {
|
||||||
|
this.form.stor_code = item.stor_code
|
||||||
|
this.form.stor_name = item.stor_name
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async queryDtl() {
|
||||||
|
if (this.form.check_type === '') {
|
||||||
|
this.crud.notify('请选择盘点单类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.dtlShow = true
|
||||||
|
},
|
||||||
|
tableChanged(rows) {
|
||||||
|
const tablemap = new Map()
|
||||||
|
rows.forEach((item) => {
|
||||||
|
if (this.form.tableData.length !== 0) {
|
||||||
|
this.flagnow = false
|
||||||
|
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||||
|
if ((this.form.tableData[i].struct_code === item.struct_code) && (this.form.tableData[i].material_code === item.material_code)) {
|
||||||
|
this.flagnow = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!this.flagnow) {
|
||||||
|
item.status = '01'
|
||||||
|
tablemap.set(item.struct_code + '间隔' + item.material_code, item)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
item.status = '01'
|
||||||
|
tablemap.set(item.struct_code + '间隔' + item.material_code, item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
for (const value of tablemap.values()) {
|
||||||
|
value.base_qty = value.canuse_qty
|
||||||
|
this.form.tableData.push(value)
|
||||||
|
}
|
||||||
|
this.form.dtl_num = this.form.tableData.length
|
||||||
|
},
|
||||||
|
deleteRow(index, rows) {
|
||||||
|
rows.splice(index, 1)
|
||||||
|
this.nowindex = ''
|
||||||
|
this.nowrow = {}
|
||||||
|
this.form.dtl_num = this.form.tableData.length
|
||||||
|
},
|
||||||
|
[CRUD.HOOK.beforeSubmit]() {
|
||||||
|
if (this.form.tableData.length === 0) {
|
||||||
|
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.crud-opts2 {
|
||||||
|
padding: 0 0;
|
||||||
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.crud-opts2 .crud-opts-right2 {
|
||||||
|
margin-left: auto;
|
||||||
|
padding: 4px 4px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,423 @@
|
|||||||
|
<!--suppress ALL -->
|
||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="盘点单盘点"
|
||||||
|
append-to-body
|
||||||
|
fullscreen
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
@open="open"
|
||||||
|
@close="close"
|
||||||
|
>
|
||||||
|
<el-card class="box-card" shadow="never">
|
||||||
|
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||||
|
<el-input v-show="false" v-model="form.stor_code" placeholder="仓库编码" />
|
||||||
|
<el-input v-show="false" v-model="form.stor_name" placeholder="仓库名称" />
|
||||||
|
<el-form-item label="单据号" prop="check_code">
|
||||||
|
<el-input v-model.trim="form.check_code" placeholder="单据号" clearable disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="业务类型" prop="check_type">
|
||||||
|
<el-select
|
||||||
|
v-model="form.check_type"
|
||||||
|
placeholder="业务类型"
|
||||||
|
:disabled="true"
|
||||||
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.ST_INV_CK_TYPE"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="仓库" prop="stor_id">
|
||||||
|
<el-select
|
||||||
|
v-model="form.stor_id"
|
||||||
|
placeholder="仓库"
|
||||||
|
class="filter-item"
|
||||||
|
:disabled="true"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in storlist"
|
||||||
|
:key="item.stor_id"
|
||||||
|
:label="item.stor_name"
|
||||||
|
:value="item.stor_id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="单据状态" prop="status">
|
||||||
|
<el-select
|
||||||
|
v-model="form.status"
|
||||||
|
placeholder="单据状态"
|
||||||
|
class="filter-item"
|
||||||
|
:disabled="true"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.CHECK_BILL_STATUS"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="明细数" prop="dtl_num">
|
||||||
|
<el-input v-model.trim="form.dtl_num" style="width: 200px" :disabled="true" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model.trim="form.remark" :disabled="true" style="width: 480px;" clearable :autosize="{ minRows: 2, maxRows: 4 }" type="textarea" maxlength="100" show-word-limit />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
<div class="crud-opts2">
|
||||||
|
<span class="role-span">盘点明细</span>
|
||||||
|
<span class="crud-opts-right2">
|
||||||
|
<!--左侧插槽-->
|
||||||
|
<slot name="left" />
|
||||||
|
<!-- <el-button
|
||||||
|
slot="left"
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
:disabled="add_flag"
|
||||||
|
@click="addrow"
|
||||||
|
>
|
||||||
|
新增一行
|
||||||
|
</el-button>-->
|
||||||
|
<el-button
|
||||||
|
slot="left"
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
:disabled="add_flag"
|
||||||
|
@click="issueTask"
|
||||||
|
>
|
||||||
|
下发任务
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
:data="tableData"
|
||||||
|
style="width: 100%;"
|
||||||
|
max-height="300"
|
||||||
|
border
|
||||||
|
:highlight-current-row="true"
|
||||||
|
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||||
|
<el-table-column prop="sect_name" label="盘点库区" align="center" />
|
||||||
|
<el-table-column prop="struct_name" label="盘点货位" align="center" />
|
||||||
|
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" width="120" align="center">
|
||||||
|
<template scope="scope">
|
||||||
|
<el-input v-show="isShow(scope.$index, scope.row,1)" v-model="scope.row.material_code" disabled class="input-with-select">
|
||||||
|
<el-button slot="append" icon="el-icon-search" @click="queryMater(scope.$index, scope.row)" />
|
||||||
|
</el-input>
|
||||||
|
<span v-show="isShow(scope.$index, scope.row,3)">{{ scope.row.material_code }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="material_name" label="物料名称" align="center" width="120" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="base_qty" label="重量/数量" :formatter="crud.formatNum0" align="center" />
|
||||||
|
<el-table-column prop="qty_unit_name" label="计量单位" align="center" />
|
||||||
|
<el-table-column prop="check_result" label="是否异常" align="center" :formatter="check_resultFormat" />
|
||||||
|
<el-table-column prop="status" label="状态" align="center" :formatter="bill_statusFormat" />
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</span>
|
||||||
|
<MaterDialog :dialog-show.sync="materShow" @setMaterValue="tableChanged2" />
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import CRUD, { crud } from '@crud/crud'
|
||||||
|
import check from '@/views/wms/storage_manage/semiproducthr/semiproductHrCheck/check'
|
||||||
|
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
|
||||||
|
import MaterDialog from '@/views/wms/pub/MaterDialog'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'CheckDialog',
|
||||||
|
components: { MaterDialog },
|
||||||
|
mixins: [crud()],
|
||||||
|
props: {
|
||||||
|
dialogShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
bussConfig: {
|
||||||
|
type: Object
|
||||||
|
},
|
||||||
|
openParam: {
|
||||||
|
type: Object
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dicts: ['CHECK_BILL_STATUS', 'ST_INV_CK_TYPE', 'CHECK_DTL_STATUS', 'check_result'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
materShow: false,
|
||||||
|
add_flag: true,
|
||||||
|
nowrow: null,
|
||||||
|
nowindex: '',
|
||||||
|
storlist: [],
|
||||||
|
form: {
|
||||||
|
check_id: '',
|
||||||
|
check_code: '',
|
||||||
|
stor_id: '',
|
||||||
|
stor_code: '',
|
||||||
|
stor_name: '',
|
||||||
|
status: '10',
|
||||||
|
dtl_num: '0',
|
||||||
|
check_type: '',
|
||||||
|
remark: '',
|
||||||
|
create_mode: ''
|
||||||
|
},
|
||||||
|
tableData: [],
|
||||||
|
rules: {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dialogShow: {
|
||||||
|
handler(newValue) {
|
||||||
|
this.dialogVisible = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
// 查询原材料库的仓库
|
||||||
|
crudStorattr.getStor({ 'stor_type': '5' }).then(res => {
|
||||||
|
this.storlist = res.content
|
||||||
|
})
|
||||||
|
check.getCheckDtl({ 'check_id': this.form.check_id }).then(res => {
|
||||||
|
this.tableData = res
|
||||||
|
// 将明细变成不可编辑
|
||||||
|
for (let i = 0; i < this.tableData.length; i++) {
|
||||||
|
const row = this.tableData[i]
|
||||||
|
this.$set(row, 'edit', false)
|
||||||
|
if (row.status > '04') {
|
||||||
|
row.edit = true
|
||||||
|
}
|
||||||
|
this.tableData.splice(i, 1, row)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit('AddChanged')
|
||||||
|
},
|
||||||
|
handleCurrentChange(current) {
|
||||||
|
if (current !== null) {
|
||||||
|
this.nowrow = current
|
||||||
|
const num = parseFloat(current.base_qty)
|
||||||
|
if (num > 0) {
|
||||||
|
this.add_flag = false
|
||||||
|
} else {
|
||||||
|
this.add_flag = true
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.nowrow = null
|
||||||
|
this.add_flag = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isCanDel(index, row, type) {
|
||||||
|
const num = parseFloat(row.base_qty)
|
||||||
|
if (type === 1) {
|
||||||
|
if (row.status > '04' || num > 0) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (row.status > '04') {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isShow(index, row, type) {
|
||||||
|
const num = parseFloat(row.base_qty)
|
||||||
|
if (type === 1) {
|
||||||
|
if (row.status > '04') {
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
if (num > 0) {
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
if (row.edit) {
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (type === 2) {
|
||||||
|
if (row.status > '04') {
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
if (row.edit) {
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (type === 3) {
|
||||||
|
if (row.status > '04') {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
if (num > 0) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
if (row.edit) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (type === 4) {
|
||||||
|
if (row.status > '04') {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
if (row.edit) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setForm(row) {
|
||||||
|
this.dialogVisible = true
|
||||||
|
this.form = row
|
||||||
|
},
|
||||||
|
bill_statusFormat(row, column) {
|
||||||
|
return this.dict.label.CHECK_DTL_STATUS[row.status]
|
||||||
|
},
|
||||||
|
check_resultFormat(row, column) {
|
||||||
|
return this.dict.label.check_result[row.check_result]
|
||||||
|
},
|
||||||
|
addrow() {
|
||||||
|
if (this.nowrow === null) {
|
||||||
|
this.crud.notify('请先选中一条已存在的库存明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
this.tableData.push({ check_id: this.form.check_id, check_code: this.form.check_code, checkdtl_id: '', sect_id: this.nowrow.sect_id, sect_name: this.nowrow.sect_name, struct_id: this.nowrow.struct_id, struct_name: this.nowrow.struct_name, storagevehicle_id: this.nowrow.storagevehicle_id, storagevehicle_code: this.nowrow.storagevehicle_code, status: '01', material_id: '', material_name: '', base_qty: '0', qty_unit_id: '1', qty_unit_name: 'KG', is_down: '0', fac_qty: '', check_result: '0', edit: false })
|
||||||
|
this.form.dtl_num = this.tableData.length
|
||||||
|
},
|
||||||
|
async queryMater(index, row) {
|
||||||
|
this.materShow = true
|
||||||
|
this.nowindex = index
|
||||||
|
this.nowrow = row
|
||||||
|
},
|
||||||
|
tableChanged2(row) {
|
||||||
|
for (let i = 0; i < this.tableData.length; i++) {
|
||||||
|
if ((this.tableData[i].material_id === row.material_id) && (this.tableData[i].struct_id === this.nowrow.struct_id)) {
|
||||||
|
this.crud.notify('不允许货位、载具、物料同时相同!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.nowrow.material_id = row.material_id
|
||||||
|
this.nowrow.material_code = row.material_code
|
||||||
|
this.nowrow.material_name = row.material_name
|
||||||
|
this.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
|
||||||
|
},
|
||||||
|
handleEdit(index, row) {
|
||||||
|
// 判断是否可以关闭编辑状态
|
||||||
|
if (!row.edit) {
|
||||||
|
const num = parseFloat(row.base_qty)
|
||||||
|
const fac_qty = parseFloat(row.fac_qty)
|
||||||
|
if (num <= 0 && fac_qty <= 0) {
|
||||||
|
this.crud.notify('不允许新增明细,盘点数量为0!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (!row.material_id) {
|
||||||
|
this.crud.notify('物料不可为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
row.edit = !row.edit
|
||||||
|
this.tableData.splice(index, 1, row) // 通过splice 替换数据 触发视图更新
|
||||||
|
},
|
||||||
|
deleteRow(index, rows) {
|
||||||
|
rows.splice(index, 1)
|
||||||
|
this.nowindex = ''
|
||||||
|
this.nowrow = null
|
||||||
|
this.form.detail_count = this.tableData.length
|
||||||
|
},
|
||||||
|
submitCheck() {
|
||||||
|
if (this.tableData.length === 0) {
|
||||||
|
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
for (let i = 0; i < this.tableData.length; i++) {
|
||||||
|
if (!this.tableData[i].edit) {
|
||||||
|
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
check.confirm({ 'row': this.form, 'rows': this.tableData }).then(res => {
|
||||||
|
this.dialogVisible = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
issueTask() {
|
||||||
|
if (this.nowrow === null) {
|
||||||
|
this.crud.notify('请先选中一条已存在的库存明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
check.issueTask(this.nowrow).then(res => {
|
||||||
|
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
check.getCheckDtl({ 'check_id': this.form.check_id }).then(res => {
|
||||||
|
this.tableData = res
|
||||||
|
// 将明细变成不可编辑
|
||||||
|
for (let i = 0; i < this.tableData.length; i++) {
|
||||||
|
const row = this.tableData[i]
|
||||||
|
this.$set(row, 'edit', false)
|
||||||
|
if (row.status > '04') {
|
||||||
|
row.edit = true
|
||||||
|
}
|
||||||
|
this.tableData.splice(i, 1, row)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
saveCheck() {
|
||||||
|
if (this.tableData.length === 0) {
|
||||||
|
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
for (let i = 0; i < this.tableData.length; i++) {
|
||||||
|
if (!this.tableData[i].edit) {
|
||||||
|
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
check.saveCheck({ 'row': this.form, 'rows': this.tableData }).then(res => {
|
||||||
|
this.dialogVisible = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.crud-opts2 {
|
||||||
|
padding: 0 0;
|
||||||
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.crud-opts2 .crud-opts-right2 {
|
||||||
|
margin-left: auto;
|
||||||
|
padding: 4px 4px;
|
||||||
|
}
|
||||||
|
.input-with-select {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,155 @@
|
|||||||
|
<!--suppress ALL -->
|
||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="库存选择"
|
||||||
|
append-to-body
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
destroy-on-close
|
||||||
|
width="1200px"
|
||||||
|
@close="close"
|
||||||
|
@open="open"
|
||||||
|
>
|
||||||
|
<div class="head-container">
|
||||||
|
<div v-if="crud.props.searchToggle">
|
||||||
|
<!-- 搜索 -->
|
||||||
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
class="demo-form-inline"
|
||||||
|
label-position="right"
|
||||||
|
label-width="80px"
|
||||||
|
label-suffix=":"
|
||||||
|
>
|
||||||
|
<el-form-item label="日期">
|
||||||
|
<date-range-picker v-model="query.createTime" class="date-item" value-format="yyyy-MM-dd"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="库区/货位">
|
||||||
|
<el-input
|
||||||
|
v-model="query.bill_code"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="库区/货位"
|
||||||
|
style="width: 200px;"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料">
|
||||||
|
<el-input
|
||||||
|
v-model="query.material_search"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="物料"
|
||||||
|
style="width: 230px;"
|
||||||
|
class="filter-item"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<rrOperation/>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation/>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="multipleTable"
|
||||||
|
v-loading="crud.loading"
|
||||||
|
:data="crud.data"
|
||||||
|
style="width: 100%;"
|
||||||
|
@selection-change="crud.selectionChangeHandler"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55"/>
|
||||||
|
<el-table-column show-overflow-tooltip width="150" prop="sect_code" label="库区"/>
|
||||||
|
<el-table-column show-overflow-tooltip width="150" prop="struct_name" label="货位"/>
|
||||||
|
<el-table-column show-overflow-tooltip prop="material_code" width="250" label="物料编号"/>
|
||||||
|
<el-table-column show-overflow-tooltip width="100" prop="material_name" label="物料名称"/>
|
||||||
|
<el-table-column show-overflow-tooltip width="150" prop="canuse_qty" label="数量(个)"/>
|
||||||
|
<el-table-column show-overflow-tooltip prop="unit_weight" label="单重"/>
|
||||||
|
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具"/>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submit">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import CRUD, {crud, header, presenter} from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||||
|
|
||||||
|
const start = new Date()
|
||||||
|
export default {
|
||||||
|
name: 'AddDtl',
|
||||||
|
components: {crudOperation, rrOperation, pagination, DateRangePicker},
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '海柔半成品可用库存',
|
||||||
|
url: '/api/bcp/hr/getBcpIvt',
|
||||||
|
crudMethod: {},
|
||||||
|
optShow: {
|
||||||
|
reset: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
mixins: [presenter(), header(), crud()],
|
||||||
|
props: {
|
||||||
|
dialogShow: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
rows: [],
|
||||||
|
tableData: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
dialogShow: {
|
||||||
|
handler(newValue, oldValue) {
|
||||||
|
this.dialogVisible = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
objectSpanMethod({row, column, rowIndex, columnIndex}) {
|
||||||
|
if (columnIndex === 0) {
|
||||||
|
if (rowIndex % 2 === 0) {
|
||||||
|
return {
|
||||||
|
rowspan: 2,
|
||||||
|
colspan: 1
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
rowspan: 0,
|
||||||
|
colspan: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
open() {
|
||||||
|
this.crud.toQuery()
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.rows = this.$refs.multipleTable.selection
|
||||||
|
this.$emit('tableChanged', this.rows)
|
||||||
|
// this.form = this.$options.data().form
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -0,0 +1,136 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/bcp/checkHr',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: 'api/bcp/checkHr/delete',
|
||||||
|
method: 'post',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/bcp/checkHr/update',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCheckDtl(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/bcp/checkHr/getCheckDtl',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getOutBillDtl2(params) {
|
||||||
|
return request({
|
||||||
|
url: '/api/bcp/checkHr/getOutBillDtl2',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getOutBillDis(params) {
|
||||||
|
return request({
|
||||||
|
url: '/api/bcp/checkHr/getOutBillDis',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getInvTypes() {
|
||||||
|
return request({
|
||||||
|
url: '/api/bcp/checkHr/getInvTypes',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function insertDtl(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/bcp/checkHr/insertDtl',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getStructIvt(params) {
|
||||||
|
return request({
|
||||||
|
url: '/api/bcp/checkHr/getStructIvt',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function confirm(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/bcp/checkHr/confirm',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function handdown(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/bcp/checkHr/handdown',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function saveCheck(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/bcp/checkHr/saveCheck',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function process0(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/bcp/checkHr/process0',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function process1(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/bcp/checkHr/process1',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function issueTask(data) {
|
||||||
|
return request({
|
||||||
|
url: '/api/bcp/checkHr/issueTask',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
add,
|
||||||
|
edit,
|
||||||
|
del,
|
||||||
|
getCheckDtl,
|
||||||
|
getStructIvt,
|
||||||
|
getOutBillDtl2,
|
||||||
|
confirm,
|
||||||
|
getInvTypes,
|
||||||
|
saveCheck,
|
||||||
|
process0,
|
||||||
|
issueTask,
|
||||||
|
getOutBillDis,
|
||||||
|
process1
|
||||||
|
}
|
||||||
@@ -0,0 +1,322 @@
|
|||||||
|
<!--suppress ALL -->
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!--工具栏-->
|
||||||
|
<div class="head-container">
|
||||||
|
<div v-if="crud.props.searchToggle">
|
||||||
|
<!-- 搜索 -->
|
||||||
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
class="demo-form-inline"
|
||||||
|
label-position="right"
|
||||||
|
label-width="80px"
|
||||||
|
label-suffix=":"
|
||||||
|
>
|
||||||
|
<el-form-item label="模糊查询">
|
||||||
|
<el-input
|
||||||
|
v-model="query.check_code"
|
||||||
|
size="mini"
|
||||||
|
clearable
|
||||||
|
placeholder="盘点单号"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所属仓库">
|
||||||
|
<el-select
|
||||||
|
v-model="query.stor_id"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="全部"
|
||||||
|
class="filter-item"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in storlist"
|
||||||
|
:key="item.stor_id"
|
||||||
|
:label="item.stor_name"
|
||||||
|
:value="item.stor_id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="创建时间">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="query.createTime"
|
||||||
|
type="daterange"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
:default-time="['00:00:00', '23:59:59']"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="生成方式">
|
||||||
|
<el-select
|
||||||
|
v-model="query.create_mode"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="生成方式"
|
||||||
|
class="filter-item"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.ST_CREATE_MODE"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="单据状态">
|
||||||
|
<el-select
|
||||||
|
v-model="query.status"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="单据状态"
|
||||||
|
class="filter-item"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.CHECK_BILL_STATUS"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="业务类型">
|
||||||
|
<el-select
|
||||||
|
v-model="query.check_type"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
size="mini"
|
||||||
|
placeholder="业务类型"
|
||||||
|
class="filter-item"
|
||||||
|
@change="crud.toQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.ST_INV_CK_TYPE"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation/>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission">
|
||||||
|
<el-button
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
type="success"
|
||||||
|
:disabled="check_flag"
|
||||||
|
icon="el-icon-position"
|
||||||
|
size="mini"
|
||||||
|
@click="checkOpen"
|
||||||
|
>
|
||||||
|
盘点
|
||||||
|
</el-button>
|
||||||
|
</crudOperation>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table
|
||||||
|
ref="table"
|
||||||
|
:max-height="590"
|
||||||
|
v-loading="crud.loading"
|
||||||
|
:data="crud.data"
|
||||||
|
size="mini"
|
||||||
|
style="width: 100%;"
|
||||||
|
:highlight-current-row="true"
|
||||||
|
@selection-change="crud.selectionChangeHandler"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
@select="handleSelectionChange"
|
||||||
|
@select-all="onSelectAll"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
v-permission="['admin','check:del','check:edit']"
|
||||||
|
label="操作"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<udOperation
|
||||||
|
:data="scope.row"
|
||||||
|
:permission="permission"
|
||||||
|
:disabled-edit="canUd(scope.row)"
|
||||||
|
:disabled-dle="canUd(scope.row)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :selectable="checkboxT" type="selection" width="55"/>
|
||||||
|
<el-table-column prop="check_code" min-width="130" label="订单编码">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.check_code }}</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :formatter="stateFormat" min-width="100" prop="status" label="单据状态"/>
|
||||||
|
<el-table-column prop="stor_name" label="仓库" min-width="120"/>
|
||||||
|
<el-table-column prop="check_type" :formatter="bill_typeFormat" min-width="100" label="业务类型"/>
|
||||||
|
<el-table-column prop="is_nok" :formatter="is_nokFormat" min-width="100" label="盘点状态"/>
|
||||||
|
<el-table-column :formatter="create_modeFormat" prop="create_mode" label="生成方式" min-width="100"/>
|
||||||
|
<el-table-column label="明细数" align="center" prop="dtl_num" min-width="100"/>
|
||||||
|
<el-table-column prop="create_time" min-width="135" label="创建日期"/>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination/>
|
||||||
|
</div>
|
||||||
|
<AddDialog @AddChanged="querytable"/>
|
||||||
|
<CheckDialog ref="child" @AddChanged="querytable"/>
|
||||||
|
<ProcessDialog ref="child2" @AddChanged="querytable"/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import check from '@/views/wms/storage_manage/semiproducthr/semiproductHrCheck/check'
|
||||||
|
import CRUD, {crud, header, presenter} from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import udOperation from '@crud/UD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
import AddDialog from '@/views/wms/storage_manage/semiproducthr/semiproductHrCheck/AddDialog'
|
||||||
|
import CheckDialog from '@/views/wms/storage_manage/semiproducthr/semiproductHrCheck/CheckDialog'
|
||||||
|
import crudStorattr from "@/views/wms/storage_manage/basedata/basedata";
|
||||||
|
import {download} from '@/api/data'
|
||||||
|
import {downloadFile} from '@/utils'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'HrBcpCheck',
|
||||||
|
components: {CheckDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination},
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '用户',
|
||||||
|
props: {
|
||||||
|
// 每页数据条数
|
||||||
|
size: 20
|
||||||
|
},
|
||||||
|
idField: 'check_id', url: 'api/bcp/checkHr', crudMethod: {...check},
|
||||||
|
optShow: {
|
||||||
|
add: true,
|
||||||
|
edit: false,
|
||||||
|
del: false,
|
||||||
|
reset: true,
|
||||||
|
download: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
mixins: [presenter(), header(), crud()],
|
||||||
|
// 数据字典
|
||||||
|
dicts: ['CHECK_BILL_STATUS', 'ST_CREATE_MODE', 'ST_INV_CK_TYPE'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||||
|
permission: {
|
||||||
|
add: ['admin', 'check:add'],
|
||||||
|
edit: ['admin', 'check:edit'],
|
||||||
|
del: ['admin', 'check:del']
|
||||||
|
},
|
||||||
|
check_flag: true,
|
||||||
|
downdtl_flag: true,
|
||||||
|
confirm_flag: true,
|
||||||
|
currentRow: null,
|
||||||
|
storlist: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted: function () {
|
||||||
|
const that = this
|
||||||
|
window.onresize = function temp() {
|
||||||
|
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
crudStorattr.getStor({'stor_type': '5'}).then(res => {
|
||||||
|
this.storlist = res.content
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
canUd(row) {
|
||||||
|
return row.status !== '10'
|
||||||
|
},
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
this.crud.query.buss_type = ''
|
||||||
|
this.handleCurrentChange(null)
|
||||||
|
},
|
||||||
|
handleSelectionChange(val, row) {
|
||||||
|
if (val.length > 1) {
|
||||||
|
this.$refs.table.clearSelection()
|
||||||
|
this.$refs.table.toggleRowSelection(val.pop())
|
||||||
|
this.buttonChange(row)
|
||||||
|
} else if (val.length === 1) {
|
||||||
|
this.buttonChange(row)
|
||||||
|
} else {
|
||||||
|
this.handleCurrentChange(null)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onSelectAll() {
|
||||||
|
this.$refs.table.clearSelection()
|
||||||
|
this.handleCurrentChange(null)
|
||||||
|
},
|
||||||
|
buttonChange(current) {
|
||||||
|
if (current !== null) {
|
||||||
|
this.currentRow = current
|
||||||
|
this.downdtl_flag = false
|
||||||
|
if (current.status === '10' || current.status === '30') {
|
||||||
|
this.check_flag = false
|
||||||
|
} else {
|
||||||
|
this.check_flag = true
|
||||||
|
}
|
||||||
|
if (current.status === '30' && current.is_nok) {
|
||||||
|
this.confirm_flag = false
|
||||||
|
} else {
|
||||||
|
this.confirm_flag = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
stateFormat(row) {
|
||||||
|
return this.dict.label.CHECK_BILL_STATUS[row.status]
|
||||||
|
},
|
||||||
|
bill_typeFormat(row) {
|
||||||
|
return this.dict.label.ST_INV_CK_TYPE[row.check_type]
|
||||||
|
},
|
||||||
|
create_modeFormat(row) {
|
||||||
|
return this.dict.label.ST_CREATE_MODE[row.create_mode]
|
||||||
|
},
|
||||||
|
is_nokFormat(row) {
|
||||||
|
if (row.is_nok) {
|
||||||
|
return '异常'
|
||||||
|
} else {
|
||||||
|
return '正常'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleCurrentChange(current) {
|
||||||
|
if (current === null) {
|
||||||
|
this.confirm_flag = true
|
||||||
|
this.check_flag = true
|
||||||
|
this.downdtl_flag = true
|
||||||
|
this.currentRow = null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
checkboxT(row) {
|
||||||
|
return row.bill_status !== '99'
|
||||||
|
},
|
||||||
|
checkOpen() {
|
||||||
|
if (this.currentRow !== null) {
|
||||||
|
this.$refs.child.setForm(this.currentRow)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
querytable() {
|
||||||
|
this.onSelectAll()
|
||||||
|
this.crud.toQuery()
|
||||||
|
this.handleCurrentChange(null)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
::v-deep .el-dialog__body {
|
||||||
|
padding-top: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user