20 changed files with 0 additions and 2913 deletions
@ -1,73 +0,0 @@ |
|||
package org.nl.wms.st.bill.rest; |
|||
|
|||
import com.alibaba.fastjson.JSONArray; |
|||
import org.nl.wms.st.bill.service.RegionIoService; |
|||
import org.nl.wms.st.bill.service.dto.RegionIoDto; |
|||
import org.springframework.data.domain.Pageable; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.nl.modules.logging.annotation.Log; |
|||
import org.springframework.http.HttpStatus; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import io.swagger.annotations.*; |
|||
import java.util.Map; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
|
|||
/** |
|||
* @author lyd |
|||
* @date 2022-10-20 |
|||
**/ |
|||
@RestController |
|||
@RequiredArgsConstructor |
|||
@Api(tags = "区域出入库管理") |
|||
@RequestMapping("/api/regionio") |
|||
@Slf4j |
|||
public class RegionIoController { |
|||
|
|||
private final RegionIoService regionioService; |
|||
|
|||
@GetMapping |
|||
@Log("查询1") |
|||
@ApiOperation("查询1") |
|||
//@SaCheckPermission("@el.check('regionio:list')")
|
|||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){ |
|||
return new ResponseEntity<>(regionioService.queryAll(whereJson,page),HttpStatus.OK); |
|||
} |
|||
|
|||
@PostMapping |
|||
@Log("新增1") |
|||
@ApiOperation("新增1") |
|||
//@SaCheckPermission("@el.check('regionio:add')")
|
|||
public ResponseEntity<Object> create(@Validated @RequestBody RegionIoDto dto){ |
|||
regionioService.create(dto); |
|||
return new ResponseEntity<>(HttpStatus.CREATED); |
|||
} |
|||
|
|||
@PutMapping |
|||
@Log("修改1") |
|||
@ApiOperation("修改1") |
|||
//@SaCheckPermission("@el.check('regionio:edit')")
|
|||
public ResponseEntity<Object> update(@Validated @RequestBody RegionIoDto dto){ |
|||
regionioService.update(dto); |
|||
return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
|||
} |
|||
|
|||
@Log("删除1") |
|||
@ApiOperation("删除1") |
|||
//@SaCheckPermission("@el.check('regionio:del')")
|
|||
@DeleteMapping |
|||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) { |
|||
regionioService.deleteAll(ids); |
|||
return new ResponseEntity<>(HttpStatus.OK); |
|||
} |
|||
|
|||
@PostMapping("/makeTask") |
|||
@Log("生成任务") |
|||
@ApiOperation("生成任务") |
|||
//@SaCheckPermission("@el.check('regionio:add')")
|
|||
public ResponseEntity<Object> makeTask(@RequestBody JSONArray dto){ |
|||
regionioService.makeTask(dto); |
|||
return new ResponseEntity<>(HttpStatus.CREATED); |
|||
} |
|||
} |
@ -1,72 +0,0 @@ |
|||
package org.nl.wms.st.bill.service; |
|||
|
|||
import com.alibaba.fastjson.JSONArray; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import org.nl.wms.st.bill.service.dto.RegionIoDto; |
|||
import org.springframework.data.domain.Pageable; |
|||
import java.util.Map; |
|||
import java.util.List; |
|||
import java.io.IOException; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
|
|||
/** |
|||
* @description 服务接口 |
|||
* @author lyd |
|||
* @date 2022-10-20 |
|||
**/ |
|||
public interface RegionIoService { |
|||
|
|||
/** |
|||
* 查询数据分页 |
|||
* @param whereJson 条件 |
|||
* @param page 分页参数 |
|||
* @return Map<String,Object> |
|||
*/ |
|||
Map<String,Object> queryAll(Map whereJson, Pageable page); |
|||
|
|||
/** |
|||
* 查询所有数据不分页 |
|||
* @param whereJson 条件参数 |
|||
* @return List<RegionIoDto> |
|||
*/ |
|||
List<RegionIoDto> queryAll(Map whereJson); |
|||
|
|||
/** |
|||
* 根据ID查询 |
|||
* @param qty_unit_id ID |
|||
* @return Regionio |
|||
*/ |
|||
RegionIoDto findById(Long qty_unit_id); |
|||
|
|||
/** |
|||
* 根据编码查询 |
|||
* @param code code |
|||
* @return Regionio |
|||
*/ |
|||
RegionIoDto findByCode(String code); |
|||
|
|||
|
|||
/** |
|||
* 创建 |
|||
* @param dto / |
|||
*/ |
|||
void create(RegionIoDto dto); |
|||
|
|||
/** |
|||
* 编辑 |
|||
* @param dto / |
|||
*/ |
|||
void update(RegionIoDto dto); |
|||
|
|||
/** |
|||
* 多选删除 |
|||
* @param ids / |
|||
*/ |
|||
void deleteAll(Long[] ids); |
|||
|
|||
/** |
|||
* 生成任务 |
|||
* @param dto |
|||
*/ |
|||
void makeTask(JSONArray dto); |
|||
} |
@ -1,101 +0,0 @@ |
|||
package org.nl.wms.st.bill.service.dto; |
|||
|
|||
import lombok.Data; |
|||
import java.math.BigDecimal; |
|||
import java.io.Serializable; |
|||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
|||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
|||
|
|||
/** |
|||
* @description / |
|||
* @author lyd |
|||
* @date 2022-10-20 |
|||
**/ |
|||
@Data |
|||
public class RegionIoDto implements Serializable { |
|||
|
|||
/** 出入单标识 */ |
|||
/** 防止精度丢失 */ |
|||
@JsonSerialize(using= ToStringSerializer.class) |
|||
private Long iostorinv_id; |
|||
|
|||
/** 单据编号 */ |
|||
private String bill_code; |
|||
|
|||
/** 出入类型 */ |
|||
private String io_type; |
|||
|
|||
/** 物料标识 */ |
|||
private Long material_id; |
|||
|
|||
/** 批次 */ |
|||
private String pcsn; |
|||
|
|||
/** 载具编码 */ |
|||
private String vehicle_code; |
|||
|
|||
/** 数量 */ |
|||
private BigDecimal qty; |
|||
|
|||
/** 数量单位标识 */ |
|||
/** 防止精度丢失 */ |
|||
@JsonSerialize(using= ToStringSerializer.class) |
|||
private Long qty_unit_id; |
|||
|
|||
/** 单据状态 */ |
|||
private String bill_status; |
|||
|
|||
/** 起始点位编码 */ |
|||
private String start_point_code; |
|||
|
|||
/** 终点点位编码 */ |
|||
private String end_point_code; |
|||
|
|||
/** 起始区域 */ |
|||
private String start_region_id; |
|||
|
|||
/** 终点区域 */ |
|||
private String end_region_id; |
|||
|
|||
/** 客户标识 */ |
|||
private Long cust_id; |
|||
|
|||
/** 生成方式 */ |
|||
private String create_mode; |
|||
|
|||
/** 任务标识 */ |
|||
private Long task_id; |
|||
|
|||
/** 备注 */ |
|||
private String remark; |
|||
|
|||
/** 创建人 */ |
|||
private Long create_id; |
|||
|
|||
/** 创建人姓名 */ |
|||
private String create_name; |
|||
|
|||
/** 创建时间 */ |
|||
private String create_time; |
|||
|
|||
/** 修改人 */ |
|||
private Long update_optid; |
|||
|
|||
/** 修改人姓名 */ |
|||
private String update_optname; |
|||
|
|||
/** 修改时间 */ |
|||
private String update_time; |
|||
|
|||
/** 确认人 */ |
|||
private Long confirm_optid; |
|||
|
|||
/** 确认人姓名 */ |
|||
private String confirm_optname; |
|||
|
|||
/** 确认时间 */ |
|||
private String confirm_time; |
|||
|
|||
/** 是否删除 */ |
|||
private String is_delete; |
|||
} |
@ -1,165 +0,0 @@ |
|||
package org.nl.wms.st.bill.service.impl; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.nl.modules.common.exception.BadRequestException; |
|||
import org.nl.modules.wql.WQL; |
|||
import org.nl.modules.wql.util.SpringContextHolder; |
|||
import org.nl.wms.sch.tasks.cpOut.CpOutTask; |
|||
import org.nl.wms.st.bill.service.RegionIoService; |
|||
import org.nl.wms.st.bill.service.dto.RegionIoDto; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import org.springframework.data.domain.Pageable; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
import cn.hutool.core.date.DateUtil; |
|||
import cn.hutool.core.util.IdUtil; |
|||
import com.alibaba.fastjson.JSONArray; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import org.nl.modules.common.utils.SecurityUtils; |
|||
import org.nl.modules.wql.core.bean.WQLObject; |
|||
import org.nl.modules.wql.util.WqlUtil; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import cn.hutool.core.util.ObjectUtil; |
|||
|
|||
/** |
|||
* @description 服务实现 |
|||
* @author lyd |
|||
* @date 2022-10-20 |
|||
**/ |
|||
@Service |
|||
@RequiredArgsConstructor |
|||
@Slf4j |
|||
public class RegionIoServiceImpl implements RegionIoService { |
|||
|
|||
@Override |
|||
public Map<String,Object> queryAll(Map whereJson, Pageable page){ |
|||
JSONObject map = new JSONObject(); |
|||
map.put("flag", "1"); |
|||
map.put("io_type", whereJson.get("io_type")); |
|||
map.put("io_region", "(" + whereJson.get("io_region") + ")"); |
|||
if (!ObjectUtil.isNull(whereJson.get("bill_code"))) { |
|||
map.put("bill_code", "%" + whereJson.get("bill_code") + "%"); |
|||
} |
|||
map.put("bill_status", whereJson.get("bill_status")); |
|||
map.put("begin_time", whereJson.get("begin_time")); |
|||
map.put("end_time", whereJson.get("end_time")); |
|||
JSONObject json = WQL.getWO("ST_IVT_REGIONIO").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "create_time desc"); |
|||
return json; |
|||
} |
|||
|
|||
@Override |
|||
public List<RegionIoDto> queryAll(Map whereJson){ |
|||
WQLObject wo = WQLObject.getWQLObject("st_ivt_regionio"); |
|||
JSONArray arr = wo.query().getResultJSONArray(0); |
|||
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(RegionIoDto.class); |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public RegionIoDto findById(Long qty_unit_id) { |
|||
WQLObject wo = WQLObject.getWQLObject("st_ivt_regionio"); |
|||
JSONObject json = wo.query("qty_unit_id = '" + qty_unit_id + "'").uniqueResult(0); |
|||
if (ObjectUtil.isNotEmpty(json)){ |
|||
return json.toJavaObject( RegionIoDto.class); |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public RegionIoDto findByCode(String code) { |
|||
WQLObject wo = WQLObject.getWQLObject("st_ivt_regionio"); |
|||
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0); |
|||
if (ObjectUtil.isNotEmpty(json)){ |
|||
return json.toJavaObject( RegionIoDto.class); |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void create(RegionIoDto dto) { |
|||
Long currentUserId = SecurityUtils.getCurrentUserId(); |
|||
String nickName = SecurityUtils.getCurrentNickName(); |
|||
String now = DateUtil.now(); |
|||
|
|||
dto.setQty_unit_id(IdUtil.getSnowflake(1, 1).nextId()); |
|||
dto.setCreate_id(currentUserId); |
|||
dto.setCreate_name(nickName); |
|||
dto.setUpdate_optid(currentUserId); |
|||
dto.setUpdate_optname(nickName); |
|||
dto.setUpdate_time(now); |
|||
dto.setCreate_time(now); |
|||
|
|||
WQLObject wo = WQLObject.getWQLObject("st_ivt_regionio"); |
|||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); |
|||
wo.insert(json); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(RegionIoDto dto) { |
|||
RegionIoDto entity = this.findById(dto.getQty_unit_id()); |
|||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); |
|||
|
|||
Long currentUserId = SecurityUtils.getCurrentUserId(); |
|||
String nickName = SecurityUtils.getCurrentNickName(); |
|||
|
|||
String now = DateUtil.now(); |
|||
dto.setUpdate_time(now); |
|||
dto.setUpdate_optid(currentUserId); |
|||
dto.setUpdate_optname(nickName); |
|||
|
|||
WQLObject wo = WQLObject.getWQLObject("st_ivt_regionio"); |
|||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); |
|||
wo.update(json); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void deleteAll(Long[] ids) { |
|||
Long currentUserId = SecurityUtils.getCurrentUserId(); |
|||
String nickName = SecurityUtils.getCurrentNickName(); |
|||
String now = DateUtil.now(); |
|||
|
|||
WQLObject wo = WQLObject.getWQLObject("st_ivt_regionio"); |
|||
for (Long qty_unit_id: ids) { |
|||
JSONObject param = new JSONObject(); |
|||
param.put("qty_unit_id", String.valueOf(qty_unit_id)); |
|||
param.put("is_delete", "1"); |
|||
param.put("update_optid", currentUserId); |
|||
param.put("update_optname", nickName); |
|||
param.put("update_time", now); |
|||
wo.update(param); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 生成任务 |
|||
* |
|||
* @param dto |
|||
*/ |
|||
@Override |
|||
public void makeTask(JSONArray dto) { |
|||
WQLObject regionIoTab = WQLObject.getWQLObject("st_ivt_regionIO"); // 出入库表
|
|||
for (int i = 0; i < dto.size(); i++) { |
|||
JSONObject regionIoObj = dto.getJSONObject(i); |
|||
JSONObject iostorInvObj = regionIoTab.query("iostorinv_id = '" + regionIoObj.getString("iostorinv_id") + "'").uniqueResult(0); |
|||
if (ObjectUtil.equal(iostorInvObj.getString("bill_status"), "3")) |
|||
throw new BadRequestException("没有单据或者已出库"); |
|||
JSONObject param = new JSONObject(); |
|||
param.put("point_code1", regionIoObj.getString("start_point_code")); |
|||
param.put("vehicle_code", regionIoObj.getString("vehicle_code")); |
|||
param.put("material_id", regionIoObj.getString("material_id")); |
|||
param.put("iostorinv_id", regionIoObj.getString("iostorinv_id")); |
|||
CpOutTask taskBean = SpringContextHolder.getBean(CpOutTask.class); |
|||
String task_id = taskBean.createTask(param); |
|||
} |
|||
|
|||
} |
|||
|
|||
} |
|||
|
@ -1,75 +0,0 @@ |
|||
[交易说明] |
|||
交易名: 库存查询 |
|||
所属模块: |
|||
功能简述: |
|||
版权所有: |
|||
表引用: |
|||
版本经历: |
|||
|
|||
[数据库] |
|||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库 |
|||
|
|||
[IO定义] |
|||
################################################# |
|||
## 表字段对应输入参数 |
|||
################################################# |
|||
输入.flag TYPEAS s_string |
|||
输入.io_region TYPEAS f_string |
|||
输入.region_code TYPEAS f_string |
|||
输入.begin_time TYPEAS s_string |
|||
输入.end_time TYPEAS s_string |
|||
输入.bill_code TYPEAS s_string |
|||
输入.bill_status TYPEAS s_string |
|||
输入.io_type TYPEAS s_string |
|||
|
|||
|
|||
[临时表] |
|||
--这边列出来的临时表就会在运行期动态创建 |
|||
|
|||
[临时变量] |
|||
--所有中间过程变量均可在此处定义 |
|||
|
|||
[业务过程] |
|||
|
|||
########################################## |
|||
# 1、输入输出检查 # |
|||
########################################## |
|||
|
|||
|
|||
########################################## |
|||
# 2、主过程前处理 # |
|||
########################################## |
|||
|
|||
|
|||
########################################## |
|||
# 3、业务主过程 # |
|||
########################################## |
|||
IF 输入.flag = "1" |
|||
PAGEQUERY |
|||
SELECT |
|||
regionio.* |
|||
FROM |
|||
`st_ivt_regionio` regionio |
|||
WHERE |
|||
regionio.io_type = 输入.io_type |
|||
AND |
|||
region_id IN |
|||
( |
|||
SELECT region.region_id FROM sch_base_region region WHERE region.region_code IN 输入.io_region |
|||
) |
|||
OPTION 输入.bill_code <> "" |
|||
regionio.bill_code = 输入.bill_code |
|||
ENDOPTION |
|||
OPTION 输入.bill_status <> "" |
|||
regionio.bill_status = 输入.bill_status |
|||
ENDOPTION |
|||
OPTION 输入.begin_time <> "" |
|||
regionio.create_time >= 输入.begin_time |
|||
ENDOPTION |
|||
OPTION 输入.end_time <> "" |
|||
regionio.create_time <= 输入.end_time |
|||
ENDOPTION |
|||
ENDSELECT |
|||
ENDPAGEQUERY |
|||
ENDIF |
|||
|
@ -1,83 +0,0 @@ |
|||
package org.nl.wms.st.structivt.rest; |
|||
|
|||
import com.alibaba.fastjson.JSONArray; |
|||
import org.nl.wms.st.structivt.service.StructivtService; |
|||
import org.nl.wms.st.structivt.service.dto.StructivtDto; |
|||
import org.springframework.data.domain.Pageable; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.nl.modules.logging.annotation.Log; |
|||
import org.springframework.http.HttpStatus; |
|||
import org.springframework.http.ResponseEntity; |
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import io.swagger.annotations.*; |
|||
import java.util.Map; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
|
|||
/** |
|||
* @author: lyd |
|||
* @description: |
|||
* @Date: 2022/10/24 |
|||
*/ |
|||
@RestController |
|||
@RequiredArgsConstructor |
|||
@Api(tags = "仓位库存管理") |
|||
@RequestMapping("/api/structivt") |
|||
@Slf4j |
|||
public class StructivtController { |
|||
|
|||
private final StructivtService structivtService; |
|||
|
|||
@GetMapping |
|||
@Log("查询养生区和成品库存") |
|||
@ApiOperation("查询养生区和成品库存") |
|||
//@SaCheckPermission("@el.check('structivt:list')")
|
|||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){ |
|||
return new ResponseEntity<>(structivtService.queryAll(whereJson,page),HttpStatus.OK); |
|||
} |
|||
|
|||
@PostMapping |
|||
@Log("新增1") |
|||
@ApiOperation("新增1") |
|||
//@SaCheckPermission("@el.check('structivt:add')")
|
|||
public ResponseEntity<Object> create(@Validated @RequestBody StructivtDto dto){ |
|||
structivtService.create(dto); |
|||
return new ResponseEntity<>(HttpStatus.CREATED); |
|||
} |
|||
|
|||
@PutMapping |
|||
@Log("修改1") |
|||
@ApiOperation("修改1") |
|||
//@SaCheckPermission("@el.check('structivt:edit')")
|
|||
public ResponseEntity<Object> update(@Validated @RequestBody StructivtDto dto){ |
|||
structivtService.update(dto); |
|||
return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
|||
} |
|||
|
|||
@Log("删除1") |
|||
@ApiOperation("删除1") |
|||
//@SaCheckPermission("@el.check('structivt:del')")
|
|||
@DeleteMapping |
|||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) { |
|||
structivtService.deleteAll(ids); |
|||
return new ResponseEntity<>(HttpStatus.OK); |
|||
} |
|||
|
|||
@PostMapping("/outInventory") |
|||
@Log("出库") |
|||
@ApiOperation("出库") |
|||
public ResponseEntity<Object> outInventory(@RequestBody JSONArray jsonArray){ |
|||
structivtService.outInventory(jsonArray); |
|||
return new ResponseEntity<>(HttpStatus.CREATED); |
|||
} |
|||
|
|||
@PostMapping("/batchEdit") |
|||
@Log("批量修改") |
|||
@ApiOperation("批量修改") |
|||
public ResponseEntity<Object> batchEdit(@RequestBody JSONArray datas){ |
|||
structivtService.batchEdit(datas); |
|||
return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
|||
} |
|||
} |
|||
|
@ -1,78 +0,0 @@ |
|||
package org.nl.wms.st.structivt.service; |
|||
|
|||
import com.alibaba.fastjson.JSONArray; |
|||
import org.nl.wms.st.structivt.service.dto.StructivtDto; |
|||
import org.springframework.data.domain.Pageable; |
|||
import java.util.Map; |
|||
import java.util.List; |
|||
import java.io.IOException; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
|
|||
/** |
|||
* @author: lyd |
|||
* @description: |
|||
* @Date: 2022/10/24 |
|||
*/ |
|||
public interface StructivtService { |
|||
|
|||
/** |
|||
* 查询数据分页 |
|||
* @param whereJson 条件 |
|||
* @param page 分页参数 |
|||
* @return Map<String,Object> |
|||
*/ |
|||
Map<String,Object> queryAll(Map whereJson, Pageable page); |
|||
|
|||
/** |
|||
* 查询所有数据不分页 |
|||
* @param whereJson 条件参数 |
|||
* @return List<StructivtDto> |
|||
*/ |
|||
List<StructivtDto> queryAll(Map whereJson); |
|||
|
|||
/** |
|||
* 根据ID查询 |
|||
* @param stockrecord_id ID |
|||
* @return Structivt |
|||
*/ |
|||
StructivtDto findById(Long stockrecord_id); |
|||
|
|||
/** |
|||
* 根据编码查询 |
|||
* @param code code |
|||
* @return Structivt |
|||
*/ |
|||
StructivtDto findByCode(String code); |
|||
|
|||
|
|||
/** |
|||
* 创建 |
|||
* @param dto / |
|||
*/ |
|||
void create(StructivtDto dto); |
|||
|
|||
/** |
|||
* 编辑 |
|||
* @param dto / |
|||
*/ |
|||
void update(StructivtDto dto); |
|||
|
|||
/** |
|||
* 多选删除 |
|||
* @param ids / |
|||
*/ |
|||
void deleteAll(Long[] ids); |
|||
|
|||
/** |
|||
* 出库 |
|||
* @param jsonArray |
|||
*/ |
|||
void outInventory(JSONArray jsonArray); |
|||
|
|||
/** |
|||
* 批量修改 |
|||
* @param datas |
|||
*/ |
|||
void batchEdit(JSONArray datas); |
|||
} |
|||
|
@ -1,91 +0,0 @@ |
|||
package org.nl.wms.st.structivt.service.dto; |
|||
|
|||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
|||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @author: lyd |
|||
* @description: |
|||
* @Date: 2022/10/24 |
|||
*/ |
|||
@Data |
|||
public class StructivtDto implements Serializable { |
|||
|
|||
/** 库存记录标识 */ |
|||
/** 防止精度丢失 */ |
|||
@JsonSerialize(using= ToStringSerializer.class) |
|||
private Long stockrecord_id; |
|||
|
|||
/** 仓位标识 */ |
|||
private Long point_id; |
|||
|
|||
/** 仓位编码 */ |
|||
private String point_code; |
|||
|
|||
/** 仓位名称 */ |
|||
private String point_name; |
|||
|
|||
/** 所属区域 */ |
|||
private Long region_id; |
|||
|
|||
/** 区域编码 */ |
|||
private String region_code; |
|||
|
|||
/** 区域名称 */ |
|||
private String region_name; |
|||
|
|||
/** 点位状态 */ |
|||
private String point_status; |
|||
|
|||
/** 锁定类型 */ |
|||
private String lock_type; |
|||
|
|||
/** 载具类型 */ |
|||
private String vehicle_type; |
|||
|
|||
/** 载具编码 */ |
|||
private String vehicle_code; |
|||
|
|||
/** 载具数量 */ |
|||
private BigDecimal vehicle_qty; |
|||
|
|||
/** 批次 */ |
|||
private String pcsn; |
|||
|
|||
/** 物料标识 */ |
|||
private Long material_id; |
|||
|
|||
/** 库存数 */ |
|||
private BigDecimal ivt_qty; |
|||
|
|||
/** 计量单位标识 */ |
|||
private Long qty_unit_id; |
|||
|
|||
/** 入库时间 */ |
|||
private String instorage_time; |
|||
|
|||
/** 静置时间(分钟) */ |
|||
private BigDecimal standing_time; |
|||
|
|||
/** 创建人 */ |
|||
private Long create_id; |
|||
|
|||
/** 创建人 */ |
|||
private String create_name; |
|||
|
|||
/** 创建时间 */ |
|||
private String create_time; |
|||
|
|||
/** 修改人 */ |
|||
private Long update_optid; |
|||
|
|||
/** 修改人姓名 */ |
|||
private String update_optname; |
|||
|
|||
/** 修改时间 */ |
|||
private String update_time; |
|||
} |
@ -1,351 +0,0 @@ |
|||
package org.nl.wms.st.structivt.service.impl; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.nl.modules.common.exception.BadRequestException; |
|||
import org.nl.modules.system.util.CodeUtil; |
|||
import org.nl.modules.wql.WQL; |
|||
import org.nl.wms.sch.service.PointService; |
|||
import org.nl.wms.sch.service.RegionService; |
|||
import org.nl.wms.sch.service.dto.PointDto; |
|||
import org.nl.wms.st.structivt.service.StructivtService; |
|||
import org.nl.wms.st.structivt.service.dto.StructivtDto; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import org.springframework.data.domain.Pageable; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
import cn.hutool.core.date.DateUtil; |
|||
import cn.hutool.core.util.IdUtil; |
|||
import com.alibaba.fastjson.JSONArray; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import org.nl.modules.common.utils.SecurityUtils; |
|||
import org.nl.modules.wql.core.bean.ResultBean; |
|||
import org.nl.modules.wql.core.bean.WQLObject; |
|||
import org.nl.modules.wql.util.WqlUtil; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import cn.hutool.core.util.ObjectUtil; |
|||
|
|||
/** |
|||
* @author: lyd |
|||
* @description: |
|||
* @Date: 2022/10/24 |
|||
*/ |
|||
@Service |
|||
@RequiredArgsConstructor |
|||
@Slf4j |
|||
public class StructivtServiceImpl implements StructivtService { |
|||
|
|||
private final RegionService regionService; |
|||
private final PointService pointService; |
|||
|
|||
@Override |
|||
public Map<String,Object> queryAll(Map whereJson, Pageable page){ |
|||
JSONObject map = new JSONObject(); |
|||
map.put("flag", "1"); |
|||
map.put("region_code", "(" + whereJson.get("region_code") + ")"); |
|||
if (!ObjectUtil.isNull(whereJson.get("point_code"))) { |
|||
map.put("point_code", "%" + whereJson.get("point_code") + "%"); |
|||
} |
|||
if (!ObjectUtil.isNull(whereJson.get("material_code"))) { |
|||
map.put("material_code", "%" + whereJson.get("material_code") + "%"); |
|||
} |
|||
map.put("layer_num", whereJson.get("layer_num")); |
|||
map.put("col_num", whereJson.get("col_num")); |
|||
map.put("row_num", whereJson.get("row_num")); |
|||
map.put("is_used", whereJson.get("is_used")); |
|||
map.put("lock_type", whereJson.get("lock_type")); |
|||
map.put("point_status", whereJson.get("point_status")); |
|||
map.put("vehicle_type", whereJson.get("vehicle_type")); |
|||
map.put("begin_time", whereJson.get("begin_time")); |
|||
map.put("end_time", whereJson.get("end_time")); |
|||
JSONObject json = WQL.getWO("ST_IVT_STRUCTIVT").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "point_code asc"); |
|||
JSONArray content = json.getJSONArray("content"); |
|||
JSONArray res = new JSONArray(); |
|||
for (int i = 0; i < content.size(); i++) { |
|||
JSONObject cppEntry = content.getJSONObject(i); |
|||
String point_status_explain = regionService.findById(cppEntry.getLong("region_id")).getPoint_status_explain(); |
|||
String[] split = point_status_explain.split(","); |
|||
JSONObject statusMap = new JSONObject(); |
|||
for (int j = 0; j < split.length; j++) { |
|||
String[] status = split[j].split("-"); |
|||
statusMap.put(status[0], status[1]); |
|||
} |
|||
cppEntry.put("point_status_name", statusMap.getString(cppEntry.getString("point_status"))); |
|||
// 获取物料信息
|
|||
String materialId = cppEntry.getString("material_id"); |
|||
if (ObjectUtil.isNotEmpty(materialId)) { |
|||
WQLObject md_me_materialBase = WQLObject.getWQLObject("MD_ME_MaterialBase"); |
|||
JSONObject jsonObject = md_me_materialBase.query("material_id = '" + materialId + "'").uniqueResult(0); |
|||
if (ObjectUtil.isNotEmpty(jsonObject)) { |
|||
cppEntry.put("material_code", jsonObject.getString("material_code")); |
|||
cppEntry.put("material_name", jsonObject.getString("material_name")); |
|||
} |
|||
} |
|||
res.add(cppEntry); |
|||
} |
|||
json.put("content", res); |
|||
return json; |
|||
} |
|||
|
|||
@Override |
|||
public List<StructivtDto> queryAll(Map whereJson){ |
|||
WQLObject wo = WQLObject.getWQLObject("st_ivt_structivt"); |
|||
JSONArray arr = wo.query().getResultJSONArray(0); |
|||
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(StructivtDto.class); |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public StructivtDto findById(Long stockrecord_id) { |
|||
WQLObject wo = WQLObject.getWQLObject("st_ivt_structivt"); |
|||
JSONObject json = wo.query("stockrecord_id = '" + stockrecord_id + "'").uniqueResult(0); |
|||
if (ObjectUtil.isNotEmpty(json)){ |
|||
return json.toJavaObject( StructivtDto.class); |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public StructivtDto findByCode(String code) { |
|||
WQLObject wo = WQLObject.getWQLObject("st_ivt_structivt"); |
|||
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0); |
|||
if (ObjectUtil.isNotEmpty(json)){ |
|||
return json.toJavaObject( StructivtDto.class); |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void create(StructivtDto dto) { |
|||
Long currentUserId = SecurityUtils.getCurrentUserId(); |
|||
String nickName = SecurityUtils.getCurrentNickName(); |
|||
String now = DateUtil.now(); |
|||
|
|||
dto.setStockrecord_id(IdUtil.getSnowflake(1, 1).nextId()); |
|||
dto.setCreate_id(currentUserId); |
|||
dto.setCreate_name(nickName); |
|||
dto.setUpdate_optid(currentUserId); |
|||
dto.setUpdate_optname(nickName); |
|||
dto.setUpdate_time(now); |
|||
dto.setCreate_time(now); |
|||
|
|||
WQLObject wo = WQLObject.getWQLObject("st_ivt_structivt"); |
|||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); |
|||
wo.insert(json); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(StructivtDto dto) { |
|||
// 找主表获取之前的数据
|
|||
StructivtDto structivtDto = this.findById(dto.getStockrecord_id()); |
|||
if (structivtDto == null) throw new BadRequestException("被删除或无权限,操作失败!"); |
|||
|
|||
Long currentUserId = SecurityUtils.getCurrentUserId(); |
|||
String nickName = SecurityUtils.getCurrentNickName(); |
|||
String now = DateUtil.now(); |
|||
|
|||
JSONObject intoBeforeObject = new JSONObject(); |
|||
// 存储主表之前数据
|
|||
intoBeforeObject.put("stockrecord_id", IdUtil.getSnowflake(1, 1).nextId()); |
|||
intoBeforeObject.put("point_id", structivtDto.getPoint_id()); |
|||
intoBeforeObject.put("point_code", structivtDto.getPoint_code()); |
|||
intoBeforeObject.put("point_name", structivtDto.getPoint_name()); |
|||
intoBeforeObject.put("region_id", structivtDto.getRegion_id()); |
|||
intoBeforeObject.put("region_code", structivtDto.getRegion_code()); |
|||
intoBeforeObject.put("region_name", structivtDto.getRegion_name()); |
|||
intoBeforeObject.put("pcsn", structivtDto.getPcsn()); |
|||
intoBeforeObject.put("material_id", structivtDto.getMaterial_id()); |
|||
intoBeforeObject.put("ivt_qty", structivtDto.getIvt_qty()); |
|||
intoBeforeObject.put("qty_unit_id", structivtDto.getQty_unit_id()); |
|||
intoBeforeObject.put("standing_time", structivtDto.getStanding_time()); |
|||
intoBeforeObject.put("instorage_time", structivtDto.getInstorage_time()); |
|||
PointDto pointDto = pointService.findById(structivtDto.getPoint_id()); |
|||
if (ObjectUtil.isNotEmpty(pointDto)) { |
|||
intoBeforeObject.put("point_status", pointDto.getPoint_status()); |
|||
intoBeforeObject.put("lock_type", pointDto.getLock_type()); |
|||
intoBeforeObject.put("vehicle_type", pointDto.getVehicle_type()); |
|||
intoBeforeObject.put("vehicle_code", pointDto.getVehicle_code()); |
|||
intoBeforeObject.put("vehicle_qty", pointDto.getVehicle_qty()); |
|||
} |
|||
intoBeforeObject.put("create_id", currentUserId); |
|||
intoBeforeObject.put("create_name", nickName); |
|||
intoBeforeObject.put("create_time", now); |
|||
// 插入修改前的数据表
|
|||
WQLObject beforeWo = WQLObject.getWQLObject("ST_IVT_StructBeforeIvt"); |
|||
beforeWo.insert(intoBeforeObject); |
|||
// 修改点位的载具类型和点位状态和锁定
|
|||
PointDto pointDto2 = pointService.findById(dto.getPoint_id()); |
|||
if (ObjectUtil.isNotEmpty(pointDto2)) { |
|||
pointDto2.setVehicle_type(dto.getVehicle_type()); |
|||
pointDto2.setPoint_status(dto.getPoint_status()); |
|||
pointDto2.setLock_type(dto.getLock_type()); |
|||
// 更新
|
|||
WQLObject pointWo = WQLObject.getWQLObject("SCH_BASE_Point"); |
|||
JSONObject pointJson = JSONObject.parseObject(JSON.toJSONString(pointDto2)); |
|||
pointWo.update(pointJson); |
|||
} |
|||
// 将修改之后的数据存入修改之后的表中
|
|||
JSONObject intoAfterObject = new JSONObject(); |
|||
// 存储修改数据到修改后的表
|
|||
intoAfterObject.put("stockrecord_id", IdUtil.getSnowflake(1, 1).nextId()); |
|||
intoAfterObject.put("point_id", dto.getPoint_id()); |
|||
intoAfterObject.put("point_code", dto.getPoint_code()); |
|||
intoAfterObject.put("point_name", dto.getPoint_name()); |
|||
intoAfterObject.put("region_id", dto.getRegion_id()); |
|||
intoAfterObject.put("region_code", dto.getRegion_code()); |
|||
intoAfterObject.put("region_name", dto.getRegion_name()); |
|||
intoAfterObject.put("pcsn", dto.getPcsn()); |
|||
intoAfterObject.put("material_id", dto.getMaterial_id()); |
|||
intoAfterObject.put("ivt_qty", dto.getIvt_qty()); |
|||
intoAfterObject.put("qty_unit_id", dto.getQty_unit_id()); |
|||
intoAfterObject.put("standing_time", dto.getStanding_time()); |
|||
intoAfterObject.put("instorage_time", dto.getInstorage_time()); |
|||
|
|||
if (ObjectUtil.isNotEmpty(pointDto2)) { |
|||
intoAfterObject.put("point_status", pointDto2.getPoint_status()); |
|||
intoAfterObject.put("lock_type", pointDto2.getLock_type()); |
|||
} |
|||
intoAfterObject.put("create_id", currentUserId); |
|||
intoAfterObject.put("create_name", nickName); |
|||
intoAfterObject.put("create_time", now); |
|||
WQLObject afterWo = WQLObject.getWQLObject("ST_IVT_StructAfterIvt"); |
|||
afterWo.insert(intoAfterObject); |
|||
|
|||
// 更新主表
|
|||
WQLObject wo = WQLObject.getWQLObject("st_ivt_structivt"); |
|||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); |
|||
wo.update(json); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void deleteAll(Long[] ids) { |
|||
Long currentUserId = SecurityUtils.getCurrentUserId(); |
|||
String nickName = SecurityUtils.getCurrentNickName(); |
|||
String now = DateUtil.now(); |
|||
|
|||
WQLObject wo = WQLObject.getWQLObject("st_ivt_structivt"); |
|||
for (Long stockrecord_id: ids) { |
|||
JSONObject param = new JSONObject(); |
|||
param.put("stockrecord_id", String.valueOf(stockrecord_id)); |
|||
param.put("is_delete", "1"); |
|||
param.put("update_optid", currentUserId); |
|||
param.put("update_optname", nickName); |
|||
param.put("update_time", now); |
|||
wo.update(param); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 出库 |
|||
* |
|||
* @param jsonArray |
|||
*/ |
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void outInventory(JSONArray jsonArray) { |
|||
WQLObject regionIoTab = WQLObject.getWQLObject("ST_IVT_REGIONIO"); // 出入库表
|
|||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位
|
|||
String in_store_code = CodeUtil.getNewCode("IN_STORE_CODE"); |
|||
for (int i = 0; i < jsonArray.size(); i++) { // 每个对象就是点位
|
|||
JSONObject pointObj = jsonArray.getJSONObject(i); |
|||
// 如果是空位或者锁定就跳过
|
|||
if (pointObj.getString("lock_type").equals("2") || !pointObj.getString("point_status").equals("3")) throw new BadRequestException("点位无物料或者已出库"); |
|||
// 插入regionIO - 未锁定,有料位
|
|||
JSONObject regionIoObj = new JSONObject(); |
|||
regionIoObj.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId()); |
|||
regionIoObj.put("bill_code", in_store_code); // 批量新增相同
|
|||
regionIoObj.put("buss_date", DateUtil.today()); |
|||
regionIoObj.put("io_type", "2"); |
|||
regionIoObj.put("material_id", pointObj.getString("material_id")); // 点位表的物料id是空的,仓位表有物料id
|
|||
regionIoObj.put("pcsn", pointObj.getString("pcsn")); |
|||
regionIoObj.put("vehicle_code", pointObj.getString("vehicle_code")); |
|||
regionIoObj.put("qty", pointObj.getString("ivt_qty")); |
|||
regionIoObj.put("qty_unit_id", pointObj.getString("qty_unit_id")); |
|||
regionIoObj.put("bill_status", "1"); |
|||
regionIoObj.put("start_point_code", pointObj.getString("point_code")); // 起点
|
|||
regionIoObj.put("region_id", pointObj.getString("region_id")); |
|||
regionIoObj.put("region_code", pointObj.getString("region_code")); |
|||
regionIoObj.put("region_name", pointObj.getString("region_name")); |
|||
regionIoObj.put("create_mode", "2"); |
|||
regionIoObj.put("create_id", SecurityUtils.getCurrentUserId()); |
|||
regionIoObj.put("create_name", SecurityUtils.getCurrentNickName()); |
|||
regionIoObj.put("create_time", DateUtil.now()); |
|||
regionIoTab.insert(regionIoObj); |
|||
// 上锁
|
|||
JSONObject point = pointTab.query("point_id = '" + pointObj.getString("point_id") + "'").uniqueResult(0); |
|||
point.put("lock_type", "2"); |
|||
pointTab.update(point); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 批量修改 |
|||
* |
|||
* @param datas |
|||
*/ |
|||
@Override |
|||
public void batchEdit(JSONArray datas) { |
|||
Long currentUserId = SecurityUtils.getCurrentUserId(); |
|||
String nickName = SecurityUtils.getCurrentNickName(); |
|||
String now = DateUtil.now(); |
|||
System.out.println(datas); |
|||
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point"); |
|||
WQLObject structIvtTab = WQLObject.getWQLObject("ST_IVT_StructIvt"); |
|||
WQLObject materialBaseTab = WQLObject.getWQLObject("MD_ME_MaterialBase"); |
|||
for ( int i = 0; i < datas.size(); i++ ) { |
|||
JSONObject object = datas.getJSONObject(i); |
|||
// 根据物料material_code查找物料信息
|
|||
String material_id = null; |
|||
String material_code = object.getString("material_code"); |
|||
if (ObjectUtil.isNotEmpty(material_code)) { |
|||
JSONObject materialObj = materialBaseTab.query("material_code = '" + material_code + "'").uniqueResult(0); |
|||
if (ObjectUtil.isNotEmpty(materialObj)) { |
|||
material_id = materialObj.getString("material_id"); |
|||
} else { |
|||
throw new BadRequestException("物料编码出错"); |
|||
} |
|||
} |
|||
JSONObject points = pointTab.query("point_id = '" + object.getString("point_id") + "'").uniqueResult(0); |
|||
if (ObjectUtil.isNotEmpty(points)) { |
|||
points.put("point_status", object.getString("point_status")); |
|||
points.put("lock_type", object.getString("lock_type")); |
|||
points.put("vehicle_type", object.getString("vehicle_type")); |
|||
points.put("is_used", object.getString("is_used")); |
|||
points.put("update_optid", currentUserId); |
|||
points.put("update_optname", nickName); |
|||
points.put("update_time", now); |
|||
points.put("material_id", material_id); |
|||
pointTab.update(points); |
|||
} |
|||
// 修改/新增 仓位库存表【ST_IVT_StructIvt】
|
|||
String stockrecordId = object.getString("stockrecord_id"); |
|||
if (ObjectUtil.isNotEmpty(stockrecordId)) { |
|||
// 修改
|
|||
JSONObject strObject = structIvtTab.query("stockrecord_id = '" + stockrecordId + "'").uniqueResult(0); |
|||
strObject.put("ivt_qty", object.getString("ivt_qty")); |
|||
strObject.put("material_id", points.getString("material_id")); |
|||
structIvtTab.update(strObject); |
|||
} else { |
|||
// 新增
|
|||
JSONObject str = new JSONObject(); |
|||
str.put("stockrecord_id", IdUtil.getSnowflake(1, 1).nextId()); |
|||
str.put("point_id", points.getString("point_id")); |
|||
str.put("point_code", points.getString("point_code")); |
|||
str.put("point_name", points.getString("point_name")); |
|||
str.put("region_id", points.getString("region_id")); |
|||
str.put("region_code", points.getString("region_code")); |
|||
str.put("region_name", points.getString("region_name")); |
|||
str.put("material_id", points.getString("material_id")); |
|||
str.put("ivt_qty", object.getString("ivt_qty")); |
|||
structIvtTab.insert(str); |
|||
} |
|||
} |
|||
} |
|||
|
|||
} |
@ -1,98 +0,0 @@ |
|||
[交易说明] |
|||
交易名: 仓位库存 |
|||
所属模块: |
|||
功能简述: |
|||
版权所有: |
|||
表引用: |
|||
版本经历: |
|||
|
|||
[数据库] |
|||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库 |
|||
|
|||
[IO定义] |
|||
################################################# |
|||
## 表字段对应输入参数 |
|||
################################################# |
|||
输入.flag TYPEAS s_string |
|||
输入.io_region TYPEAS f_string |
|||
输入.region_code TYPEAS f_string |
|||
输入.point_code TYPEAS s_string |
|||
输入.begin_time TYPEAS s_string |
|||
输入.end_time TYPEAS s_string |
|||
输入.bill_code TYPEAS s_string |
|||
输入.bill_status TYPEAS s_string |
|||
输入.io_type TYPEAS s_string |
|||
输入.lock_type TYPEAS s_string |
|||
输入.material_code TYPEAS s_string |
|||
输入.point_status TYPEAS s_string |
|||
输入.vehicle_type TYPEAS s_string |
|||
输入.is_used TYPEAS s_string |
|||
|
|||
|
|||
[临时表] |
|||
--这边列出来的临时表就会在运行期动态创建 |
|||
|
|||
[临时变量] |
|||
--所有中间过程变量均可在此处定义 |
|||
|
|||
[业务过程] |
|||
|
|||
########################################## |
|||
# 1、输入输出检查 # |
|||
########################################## |
|||
|
|||
|
|||
########################################## |
|||
# 2、主过程前处理 # |
|||
########################################## |
|||
|
|||
|
|||
########################################## |
|||
# 3、业务主过程 # |
|||
########################################## |
|||
IF 输入.flag = "1" |
|||
PAGEQUERY |
|||
SELECT |
|||
point.* |
|||
FROM |
|||
sch_base_point point |
|||
WHERE |
|||
point.region_code IN 输入.region_code |
|||
OPTION 输入.point_code <> "" |
|||
point.point_code LIKE 输入.point_code |
|||
ENDOPTION |
|||
OPTION 输入.point_status <> "" |
|||
point.point_status = 输入.point_status |
|||
ENDOPTION |
|||
OPTION 输入.vehicle_type <> "" |
|||
point.vehicle_type = 输入.vehicle_type |
|||
ENDOPTION |
|||
OPTION 输入.material_code <> "" |
|||
point.material_id IN ( |
|||
SELECT material_code FROM md_me_materialbase WHERE material_code LIKE 输入.material_code |
|||
) |
|||
ENDOPTION |
|||
OPTION 输入.layer_num <> "" |
|||
point.layer_num = 输入.layer_num |
|||
ENDOPTION |
|||
OPTION 输入.col_num <> "" |
|||
point.col_num = 输入.col_num |
|||
ENDOPTION |
|||
OPTION 输入.row_num <> "" |
|||
point.row_num = 输入.row_num |
|||
ENDOPTION |
|||
OPTION 输入.lock_type <> "" |
|||
point.lock_type = 输入.lock_type |
|||
ENDOPTION |
|||
OPTION 输入.is_used <> "" |
|||
point.is_used = 输入.is_used |
|||
ENDOPTION |
|||
OPTION 输入.begin_time <> "" |
|||
point.instorage_time >= 输入.begin_time |
|||
ENDOPTION |
|||
OPTION 输入.end_time <> "" |
|||
point.instorage_time <= 输入.end_time |
|||
ENDOPTION |
|||
ENDSELECT |
|||
ENDPAGEQUERY |
|||
ENDIF |
@ -1,188 +0,0 @@ |
|||
<template> |
|||
<div> |
|||
<!--工具栏--> |
|||
<div class="head-container"> |
|||
<div v-if="crud.props.searchToggle"> |
|||
<el-form |
|||
:inline="true" |
|||
class="demo-form-inline" |
|||
label-position="right" |
|||
label-width="90px" |
|||
label-suffix=":" |
|||
> |
|||
<el-form-item label="单据编号"> |
|||
<el-input |
|||
v-model="query.bill_code" |
|||
clearable |
|||
size="mini" |
|||
style="width: 185px;" |
|||
placeholder="单据编号" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="单据状态"> |
|||
<el-select |
|||
v-model="query.bill_status" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
class="filter-item" |
|||
style="width: 185px;" |
|||
@change="crud.toQuery" |
|||
> |
|||
<el-option |
|||
v-for="item in dict.st_bill_status" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</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> |
|||
<rrOperation :crud="crud" /> |
|||
</el-form> |
|||
</div> |
|||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
|||
<crudOperation :permission="permission" /> |
|||
<!--表单组件--> |
|||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px"> |
|||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px"> |
|||
<el-form-item label="单据编号" prop="bill_code"> |
|||
<el-input v-model="form.bill_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="出入类型" prop="io_type"> |
|||
<el-input v-model="form.io_type" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="批次"> |
|||
<el-input v-model="form.pcsn" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="载具编码"> |
|||
<el-input v-model="form.vehicle_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="数量"> |
|||
<el-input v-model="form.qty" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="单据状态" prop="bill_status"> |
|||
<el-input v-model="form.bill_status" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="起始点位编码"> |
|||
<el-input v-model="form.start_point_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="终点点位编码"> |
|||
<el-input v-model="form.end_point_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="起始区域"> |
|||
<el-input v-model="form.start_region_id" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="终点区域"> |
|||
<el-input v-model="form.end_region_id" style="width: 370px;" /> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="text" @click="crud.cancelCU">取消</el-button> |
|||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
<!--表格渲染--> |
|||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
|||
<el-table-column type="selection" width="55" /> |
|||
<el-table-column prop="bill_code" label="单据编号" min-width="150" /> |
|||
<el-table-column prop="io_type" label="出入类型"> |
|||
<template slot-scope="scope"> |
|||
{{ dict.label.io_type[scope.row.io_type] }} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="pcsn" label="批次" /> |
|||
<el-table-column prop="vehicle_code" label="载具编码" show-overflow-tooltip /> |
|||
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum3" /> |
|||
<el-table-column prop="bill_status" label="单据状态"> |
|||
<template slot-scope="scope"> |
|||
{{ dict.label.st_bill_status[scope.row.bill_status] }} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="start_point_code" label="起点" min-width="120" /> |
|||
<el-table-column prop="end_point_code" label="终点" min-width="120" /> |
|||
<!-- <el-table-column prop="start_region_id" label="起始区域" />--> |
|||
<!-- <el-table-column prop="end_region_id" label="终点区域" />--> |
|||
<el-table-column prop="remark" label="备注" /> |
|||
<el-table-column prop="update_optname" label="修改人" min-width="100" /> |
|||
<el-table-column prop="update_time" label="修改时间" min-width="140" /> |
|||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right"> |
|||
<template slot-scope="scope"> |
|||
<udOperation |
|||
:data="scope.row" |
|||
:permission="permission" |
|||
/> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<!--分页组件--> |
|||
<pagination /> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import crudBill from '@/views/wms/st/regionio' |
|||
import CRUD, { crud, form, 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' |
|||
|
|||
const defaultForm = { iostorinv_id: null, bill_code: null, io_type: null, material_id: null, pcsn: null, vehicle_code: null, qty: null, qty_unit_id: null, bill_status: null, start_point_code: null, end_point_code: null, start_region_id: null, end_region_id: null, cust_id: null, create_mode: null, task_id: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, confirm_optid: null, confirm_optname: null, confirm_time: null, is_delete: null } |
|||
export default { |
|||
name: 'CppInRegion', |
|||
components: { pagination, crudOperation, rrOperation, udOperation }, |
|||
dicts: ['io_type', 'st_bill_status'], |
|||
mixins: [presenter(), header(), form(defaultForm), crud()], |
|||
cruds() { |
|||
return CRUD({ |
|||
title: '养生区入库管理', |
|||
url: 'api/regionio', |
|||
idField: 'qty_unit_id', |
|||
sort: 'qty_unit_id,desc', |
|||
query: { |
|||
io_type: '1', |
|||
io_region: "'CPQYA01'" |
|||
}, |
|||
crudMethod: { ...crudBill } |
|||
}) |
|||
}, |
|||
data() { |
|||
return { |
|||
permission: { |
|||
}, |
|||
rules: { |
|||
bill_code: [ |
|||
{ required: true, message: '单据编号不能为空', trigger: 'blur' } |
|||
], |
|||
io_type: [ |
|||
{ required: true, message: '出入类型不能为空', trigger: 'blur' } |
|||
], |
|||
bill_status: [ |
|||
{ required: true, message: '单据状态不能为空', trigger: 'blur' } |
|||
] |
|||
}} |
|||
}, |
|||
methods: { |
|||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
|||
[CRUD.HOOK.beforeRefresh]() { |
|||
return true |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
@ -1,401 +0,0 @@ |
|||
<template> |
|||
<div> |
|||
<!--工具栏--> |
|||
<div class="head-container"> |
|||
<div v-if="crud.props.searchToggle"> |
|||
<el-form |
|||
:inline="true" |
|||
class="demo-form-inline" |
|||
label-position="right" |
|||
label-width="90px" |
|||
label-suffix=":" |
|||
> |
|||
<el-form-item label="点位编码"> |
|||
<el-input |
|||
v-model="query.point_code" |
|||
clearable |
|||
size="mini" |
|||
style="width: 185px;" |
|||
placeholder="点位编码" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="物料编码"> |
|||
<el-input |
|||
v-model="query.material_code" |
|||
clearable |
|||
size="mini" |
|||
style="width: 185px;" |
|||
placeholder="物料编码" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="点位状态"> |
|||
<el-select |
|||
v-model="query.point_status" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
class="filter-item" |
|||
style="width: 185px;" |
|||
@change="hand" |
|||
> |
|||
<el-option |
|||
v-for="item in pointStatusList" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="载具类型"> |
|||
<el-select |
|||
v-model="query.vehicle_type" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
class="filter-item" |
|||
style="width: 185px;" |
|||
@change="hand" |
|||
> |
|||
<el-option |
|||
v-for="item in dict.vehicle_type" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="排"> |
|||
<el-input |
|||
v-model="query.row_num" |
|||
clearable |
|||
size="mini" |
|||
style="width: 185px;" |
|||
placeholder="排" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="列"> |
|||
<el-input |
|||
v-model="query.col_num" |
|||
clearable |
|||
size="mini" |
|||
style="width: 185px;" |
|||
placeholder="列" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="层"> |
|||
<el-input |
|||
v-model="query.layer_num" |
|||
clearable |
|||
size="mini" |
|||
style="width: 185px;" |
|||
placeholder="层" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="锁定类型"> |
|||
<el-select |
|||
v-model="query.lock_type" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
class="filter-item" |
|||
style="width: 185px;" |
|||
@change="hand" |
|||
> |
|||
<el-option |
|||
v-for="item in dict.d_lock_type" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</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-switch |
|||
v-model="query.is_used" |
|||
active-value="0" |
|||
inactive-value="1" |
|||
active-color="#C0CCDA" |
|||
inactive-color="#409EFF" |
|||
@change="hand" |
|||
/> |
|||
</el-form-item> |
|||
<rrOperation :crud="crud" /> |
|||
</el-form> |
|||
</div> |
|||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
|||
<crudOperation :permission="permission" > |
|||
<el-button |
|||
slot="right" |
|||
class="filter-item" |
|||
size="mini" |
|||
type="primary" |
|||
icon="el-icon-sort" |
|||
:disabled="crud.selections.length === 0" |
|||
@click="outInventory(crud.selections)" |
|||
> |
|||
出库 |
|||
</el-button> |
|||
<el-button |
|||
v-if="showTab" |
|||
slot="right" |
|||
class="filter-item" |
|||
type="primary" |
|||
icon="el-icon-s-promotion" |
|||
size="mini" |
|||
@click="changeShowTab"> |
|||
编辑 |
|||
</el-button> |
|||
<el-button |
|||
v-if="!showTab" |
|||
slot="right" |
|||
class="filter-item" |
|||
type="primary" |
|||
icon="el-icon-s-promotion" |
|||
size="mini" |
|||
:disabled="crud.selections.length === 0" |
|||
@click="doEdit(crud.data)"> |
|||
保存 |
|||
</el-button> |
|||
</crudOperation> |
|||
<!--表单组件--> |
|||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="550px"> |
|||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="120px"> |
|||
<el-form-item label="点位编码" prop="standing_time"> |
|||
<el-input v-model="form.point_code" style="width: 370px;" :disabled="true"/> |
|||
</el-form-item> |
|||
<el-form-item label="托盘类型"> |
|||
<el-select |
|||
v-model="form.vehicle_type" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
class="filter-item" |
|||
style="width: 370px;" |
|||
> |
|||
<el-option |
|||
v-for="item in dict.vehicle_type" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="锁定类型"> |
|||
<el-select |
|||
v-model="form.lock_type" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
class="filter-item" |
|||
style="width: 185px;" |
|||
> |
|||
<el-option |
|||
v-for="item in dict.d_lock_type" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="text" @click="crud.cancelCU">取消</el-button> |
|||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
<!--表格渲染--> |
|||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
|||
<el-table-column type="selection" width="55" /> |
|||
<el-table-column prop="point_code" label="点位编码" min-width="100" show-overflow-tooltip/> |
|||
<el-table-column prop="region_name" label="区域名称" min-width="120" show-overflow-tooltip/> |
|||
<el-table-column prop="pcsn" label="批次" /> |
|||
<el-table-column prop="ivt_qty" label="库存数" :formatter="crud.formatNum3" width="100"> |
|||
<template slot-scope="scope"> |
|||
<el-input type="text" v-model="scope.row.ivt_qty" v-show="!showTab" /> |
|||
<span v-show="showTab">{{scope.row.ivt_qty}}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="material_code" label="物料编码" > |
|||
<template slot-scope="scope"> |
|||
<el-input type="text" v-model="scope.row.material_code" v-show="!showTab" /> |
|||
<span v-show="showTab">{{scope.row.material_code}}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="material_name" label="物料名称" min-width="120"/> |
|||
<el-table-column prop="instorage_time" label="入库时间" min-width="150" show-overflow-tooltip/> |
|||
<el-table-column prop="point_status_name" label="点位状态" width="120"> |
|||
<template slot-scope="scope"> |
|||
<el-select |
|||
v-show="!showTab" |
|||
v-model="scope.row.point_status" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
> |
|||
<el-option |
|||
v-for="item in pointStatusList" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
<span v-show="showTab">{{scope.row.point_status_name}}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="vehicle_type" label="托盘类型" min-width="100"> |
|||
<template slot-scope="scope"> |
|||
{{ dict.label.vehicle_type[scope.row.vehicle_type] }} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="remark" label="备注" /> |
|||
<el-table-column prop="is_used" label="是否启用" > |
|||
<template slot-scope="scope"> |
|||
<el-switch |
|||
v-show="!showTab" |
|||
v-model="scope.row.is_used" |
|||
active-value="0" |
|||
inactive-value="1" |
|||
active-color="#C0CCDA" |
|||
inactive-color="#409EFF" |
|||
/> |
|||
<span v-show="showTab">{{ scope.row.is_used=='1' ? '是' : '否' }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="lock_type" label="锁定类型" width="120"> |
|||
<template slot-scope="scope"> |
|||
<el-select |
|||
v-model="scope.row.lock_type" |
|||
v-show="!showTab" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
> |
|||
<el-option |
|||
v-for="item in dict.d_lock_type" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
<span v-show="showTab">{{ dict.label.d_lock_type[scope.row.lock_type] }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="update_optname" label="修改人" /> |
|||
<el-table-column prop="update_time" label="修改时间" min-width="150" show-overflow-tooltip /> |
|||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right"> |
|||
<template slot-scope="scope"> |
|||
<udOperation |
|||
:data="scope.row" |
|||
:permission="permission" |
|||
:is-visiable-del="false" |
|||
/> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<!--分页组件--> |
|||
<pagination /> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import crudStructivt from '../structivt' |
|||
import CRUD, { crud, form, 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 crudRegion from '@/api/wms/sch/region' |
|||
|
|||
const defaultForm = { point_id: null, point_code: null, pcsn: null, material_id: null, ivt_qty: null, qty_unit_id: null, instorage_time: null, ext_code: null, point_status: null, vehicle_type: null, row_num: null, col_num: null, layer_num: null, remark: null, is_used: null, is_lock: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null } |
|||
export default { |
|||
name: 'CppInventory', |
|||
dicts: ['sch_point_status', 'vehicle_type', 'is_used', 'd_lock_type'], |
|||
components: { pagination, crudOperation, rrOperation, udOperation }, |
|||
mixins: [presenter(), header(), form(defaultForm), crud()], |
|||
cruds() { |
|||
return CRUD({ |
|||
title: '成品库区', |
|||
url: 'api/structivt', |
|||
idField: 'point_id', |
|||
sort: 'point_id,desc', |
|||
optShow: { |
|||
add: false, |
|||
edit: true, |
|||
del: false, |
|||
download: false, |
|||
reset: true |
|||
}, |
|||
query: { |
|||
region_code: "'CPQYA01'" |
|||
} |
|||
}) |
|||
}, |
|||
data() { |
|||
return { |
|||
showTab: true, |
|||
pointStatusList: [], |
|||
permission: { |
|||
}, |
|||
rules: { |
|||
is_used: [ |
|||
{ required: true, message: '是否启用不能为空', trigger: 'blur' } |
|||
], |
|||
is_lock: [ |
|||
{ required: true, message: '是否锁定不能为空', trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
this.getPointStatusList('1557538851726168064') |
|||
}, |
|||
methods: { |
|||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
|||
[CRUD.HOOK.beforeRefresh]() { |
|||
return true |
|||
}, |
|||
hand(value) { |
|||
this.crud.toQuery() |
|||
}, |
|||
outInventory(values) { |
|||
console.log(values) |
|||
crudStructivt.outInventory(values).then(res => { |
|||
this.crud.notify('出库成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
|||
this.crud.toQuery() |
|||
}) |
|||
}, |
|||
getPointStatusList(id) { |
|||
crudRegion.getPointStatusSelectById(id).then(res => { |
|||
this.pointStatusList = res |
|||
}) |
|||
}, |
|||
changeShowTab() { |
|||
this.showTab = !this.showTab |
|||
}, |
|||
doEdit(datas) { |
|||
if (datas.length > 0) { |
|||
crudStructivt.batchEdit(datas).then(res => { |
|||
this.crud.notify('保存成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
|||
this.crud.toQuery() |
|||
}) |
|||
} |
|||
this.showTab = true |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
@ -1,206 +0,0 @@ |
|||
<template> |
|||
<div> |
|||
<!--工具栏--> |
|||
<div class="head-container"> |
|||
<div v-if="crud.props.searchToggle"> |
|||
<el-form |
|||
:inline="true" |
|||
class="demo-form-inline" |
|||
label-position="right" |
|||
label-width="90px" |
|||
label-suffix=":" |
|||
> |
|||
<el-form-item label="单据编号"> |
|||
<el-input |
|||
v-model="query.bill_code" |
|||
clearable |
|||
size="mini" |
|||
style="width: 185px;" |
|||
placeholder="单据编号" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="单据状态"> |
|||
<el-select |
|||
v-model="query.bill_status" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
class="filter-item" |
|||
style="width: 185px;" |
|||
@change="crud.toQuery" |
|||
> |
|||
<el-option |
|||
v-for="item in dict.st_bill_status" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</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> |
|||
<rrOperation :crud="crud" /> |
|||
</el-form> |
|||
</div> |
|||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
|||
<crudOperation :permission="permission" > |
|||
<el-button |
|||
slot="right" |
|||
class="filter-item" |
|||
size="mini" |
|||
type="primary" |
|||
icon="el-icon-position" |
|||
:disabled="crud.selections.length === 0" |
|||
@click="makeTask(crud.selections)" |
|||
> |
|||
生成任务 |
|||
</el-button> |
|||
</crudOperation> |
|||
<!--表单组件--> |
|||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px"> |
|||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px"> |
|||
<el-form-item label="单据编号" prop="bill_code"> |
|||
<el-input v-model="form.bill_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="出入类型" prop="io_type"> |
|||
<el-input v-model="form.io_type" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="批次"> |
|||
<el-input v-model="form.pcsn" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="载具编码"> |
|||
<el-input v-model="form.vehicle_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="数量"> |
|||
<el-input v-model="form.qty" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="单据状态" prop="bill_status"> |
|||
<el-input v-model="form.bill_status" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="起始点位编码"> |
|||
<el-input v-model="form.start_point_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="终点点位编码"> |
|||
<el-input v-model="form.end_point_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="起始区域"> |
|||
<el-input v-model="form.start_region_id" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="终点区域"> |
|||
<el-input v-model="form.end_region_id" style="width: 370px;" /> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="text" @click="crud.cancelCU">取消</el-button> |
|||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
<!--表格渲染--> |
|||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
|||
<el-table-column type="selection" width="55" /> |
|||
<el-table-column prop="bill_code" label="单据编号" min-width="150" /> |
|||
<el-table-column prop="io_type" label="出入类型"> |
|||
<template slot-scope="scope"> |
|||
{{ dict.label.io_type[scope.row.io_type] }} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="pcsn" label="批次" /> |
|||
<el-table-column prop="vehicle_code" label="载具编码" show-overflow-tooltip /> |
|||
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum3" /> |
|||
<el-table-column prop="bill_status" label="单据状态"> |
|||
<template slot-scope="scope"> |
|||
{{ dict.label.st_bill_status[scope.row.bill_status] }} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="start_point_code" label="起点" min-width="120" /> |
|||
<el-table-column prop="end_point_code" label="终点" min-width="120" /> |
|||
<!-- <el-table-column prop="start_region_id" label="起始区域" />--> |
|||
<!-- <el-table-column prop="end_region_id" label="终点区域" />--> |
|||
<el-table-column prop="remark" label="备注" /> |
|||
<el-table-column prop="update_optname" label="修改人" min-width="100" /> |
|||
<el-table-column prop="update_time" label="修改时间" min-width="140" /> |
|||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right"> |
|||
<template slot-scope="scope"> |
|||
<udOperation |
|||
:data="scope.row" |
|||
:permission="permission" |
|||
/> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<!--分页组件--> |
|||
<pagination /> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import crudBill from '@/views/wms/st/regionio' |
|||
import CRUD, { crud, form, 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' |
|||
|
|||
const defaultForm = { iostorinv_id: null, bill_code: null, io_type: null, material_id: null, pcsn: null, vehicle_code: null, qty: null, qty_unit_id: null, bill_status: null, start_point_code: null, end_point_code: null, start_region_id: null, end_region_id: null, cust_id: null, create_mode: null, task_id: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, confirm_optid: null, confirm_optname: null, confirm_time: null, is_delete: null } |
|||
export default { |
|||
name: 'CppOutRegion', |
|||
components: { pagination, crudOperation, rrOperation, udOperation }, |
|||
dicts: ['io_type', 'st_bill_status'], |
|||
mixins: [presenter(), header(), form(defaultForm), crud()], |
|||
cruds() { |
|||
return CRUD({ |
|||
title: '成品区出库管理', |
|||
url: 'api/regionio', |
|||
idField: 'qty_unit_id', |
|||
sort: 'qty_unit_id,desc', |
|||
query: { |
|||
io_type: '2', |
|||
io_region: "'CPQYA01'" |
|||
}, |
|||
crudMethod: { ...crudBill } |
|||
}) |
|||
}, |
|||
data() { |
|||
return { |
|||
permission: { |
|||
}, |
|||
rules: { |
|||
bill_code: [ |
|||
{ required: true, message: '单据编号不能为空', trigger: 'blur' } |
|||
], |
|||
io_type: [ |
|||
{ required: true, message: '出入类型不能为空', trigger: 'blur' } |
|||
], |
|||
bill_status: [ |
|||
{ required: true, message: '单据状态不能为空', trigger: 'blur' } |
|||
] |
|||
}} |
|||
}, |
|||
methods: { |
|||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
|||
[CRUD.HOOK.beforeRefresh]() { |
|||
return true |
|||
}, |
|||
makeTask(values) { |
|||
crudBill.makeTask(values).then(res => { |
|||
this.crud.notify('生成任务成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
|||
this.crud.toQuery() |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
@ -1,31 +0,0 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<el-tabs type="border-card"> |
|||
<el-tab-pane> |
|||
<span slot="label"><i class="el-icon-date"></i> 库存查询</span> |
|||
<cpp-inventory/> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="入库管理"> |
|||
<cpp-in-region/> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="出库管理"> |
|||
<cpp-out-region/> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import CppInventory from '@/views/wms/st/cppoint/cppInventory' |
|||
import CppInRegion from '@/views/wms/st/cppoint/cppInRegion' |
|||
import CppOutRegion from '@/views/wms/st/cppoint/cppOutRegion' |
|||
export default { |
|||
name: 'Cppoint', |
|||
components: { CppOutRegion, CppInRegion, CppInventory } |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
@ -1,35 +0,0 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
export function add(data) { |
|||
return request({ |
|||
url: 'api/regionio', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export function del(ids) { |
|||
return request({ |
|||
url: 'api/regionio/', |
|||
method: 'delete', |
|||
data: ids |
|||
}) |
|||
} |
|||
|
|||
export function edit(data) { |
|||
return request({ |
|||
url: 'api/regionio', |
|||
method: 'put', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export function makeTask(data) { |
|||
return request({ |
|||
url: 'api/regionio/makeTask', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
export default { add, edit, del, makeTask } |
@ -1,43 +0,0 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
export function add(data) { |
|||
return request({ |
|||
url: 'api/structivt', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export function del(ids) { |
|||
return request({ |
|||
url: 'api/structivt/', |
|||
method: 'delete', |
|||
data: ids |
|||
}) |
|||
} |
|||
|
|||
export function edit(data) { |
|||
return request({ |
|||
url: 'api/structivt', |
|||
method: 'put', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
export function outInventory(data) { |
|||
return request({ |
|||
url: 'api/structivt/outInventory', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
export function batchEdit(data) { |
|||
return request({ |
|||
url: 'api/structivt/batchEdit', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
export default { add, edit, del, outInventory, batchEdit } |
@ -1,32 +0,0 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<el-tabs type="border-card"> |
|||
<el-tab-pane> |
|||
<span slot="label"><i class="el-icon-date"></i> 库存查询</span> |
|||
<Inventory/> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="修改记录"> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="入库管理"> |
|||
<ysq-in-region/> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="出库管理"> |
|||
<ysq-out-region/> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Inventory from '@/views/wms/st/ysa/inventory' |
|||
import YsqInRegion from '@/views/wms/st/ysa/ysqInRegion' |
|||
import YsqOutRegion from '@/views/wms/st/ysa/ysqOutRegion' |
|||
export default { |
|||
name: 'Ysapoint', |
|||
components: { YsqOutRegion, YsqInRegion, Inventory } |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
@ -1,412 +0,0 @@ |
|||
<template> |
|||
<div> |
|||
<!--工具栏--> |
|||
<div class="head-container"> |
|||
<div v-if="crud.props.searchToggle"> |
|||
<el-form |
|||
:inline="true" |
|||
class="demo-form-inline" |
|||
label-position="right" |
|||
label-width="90px" |
|||
label-suffix=":" |
|||
> |
|||
<el-form-item label="点位编码"> |
|||
<el-input |
|||
v-model="query.point_code" |
|||
clearable |
|||
size="mini" |
|||
style="width: 185px;" |
|||
placeholder="点位编码" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="物料编码"> |
|||
<el-input |
|||
v-model="query.material_code" |
|||
clearable |
|||
size="mini" |
|||
style="width: 185px;" |
|||
placeholder="物料编码" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="点位状态"> |
|||
<el-select |
|||
v-model="query.point_status" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
class="filter-item" |
|||
style="width: 185px;" |
|||
@change="querys" |
|||
> |
|||
<el-option |
|||
v-for="item in pointStatusList" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="载具类型"> |
|||
<el-select |
|||
v-model="query.vehicle_type" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
class="filter-item" |
|||
style="width: 185px;" |
|||
@change="querys" |
|||
> |
|||
<el-option |
|||
v-for="item in dict.vehicle_type" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="块"> |
|||
<el-input |
|||
v-model="query.block_num" |
|||
clearable |
|||
size="mini" |
|||
style="width: 185px;" |
|||
placeholder="块" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="排"> |
|||
<el-input |
|||
v-model="query.row_num" |
|||
clearable |
|||
size="mini" |
|||
style="width: 185px;" |
|||
placeholder="排" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="列"> |
|||
<el-input |
|||
v-model="query.col_num" |
|||
clearable |
|||
size="mini" |
|||
style="width: 185px;" |
|||
placeholder="列" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="锁定类型"> |
|||
<el-select |
|||
v-model="query.lock_type" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
class="filter-item" |
|||
style="width: 185px;" |
|||
@change="querys" |
|||
> |
|||
<el-option |
|||
v-for="item in dict.d_lock_type" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</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-switch |
|||
v-model="query.is_used" |
|||
active-value="0" |
|||
inactive-value="1" |
|||
active-color="#C0CCDA" |
|||
inactive-color="#409EFF" |
|||
@change="querys" |
|||
/> |
|||
</el-form-item> |
|||
<rrOperation :crud="crud" /> |
|||
</el-form> |
|||
</div> |
|||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
|||
<crudOperation :permission="permission"> |
|||
<el-button |
|||
v-if="showTab" |
|||
slot="right" |
|||
class="filter-item" |
|||
type="primary" |
|||
icon="el-icon-s-promotion" |
|||
size="mini" |
|||
@click="changeShowTab"> |
|||
编辑 |
|||
</el-button> |
|||
<el-button |
|||
v-if="!showTab" |
|||
slot="right" |
|||
class="filter-item" |
|||
type="primary" |
|||
icon="el-icon-s-promotion" |
|||
size="mini" |
|||
:disabled="crud.selections.length === 0" |
|||
@click="doEdit(crud.data)"> |
|||
保存 |
|||
</el-button> |
|||
</crudOperation> |
|||
<!--表单组件--> |
|||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="550px"> |
|||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="120px"> |
|||
<el-form-item label="点位编码" prop="standing_time"> |
|||
<el-input v-model="form.point_code" style="width: 370px;" :disabled="true" /> |
|||
</el-form-item> |
|||
<el-form-item label="点位状态"> |
|||
<el-select |
|||
v-model="form.point_status" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
class="filter-item" |
|||
style="width: 370px;" |
|||
> |
|||
<el-option |
|||
v-for="item in pointStatusList" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="托盘类型"> |
|||
<el-select |
|||
v-model="form.vehicle_type" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
class="filter-item" |
|||
style="width: 370px;" |
|||
> |
|||
<el-option |
|||
v-for="item in dict.vehicle_type" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="静置时间(min)" prop="standing_time"> |
|||
<el-input v-model="form.standing_time" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="锁定类型"> |
|||
<el-select |
|||
v-model="form.lock_type" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
class="filter-item" |
|||
style="width: 185px;" |
|||
> |
|||
<el-option |
|||
v-for="item in dict.d_lock_type" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="text" @click="crud.cancelCU">取消</el-button> |
|||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
<!--表格渲染--> |
|||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
|||
<el-table-column type="selection" width="55" /> |
|||
<el-table-column prop="point_code" label="点位编码" min-width="100" show-overflow-tooltip /> |
|||
<el-table-column prop="region_name" label="区域名称" min-width="120" show-overflow-tooltip /> |
|||
<el-table-column prop="pcsn" label="批次" /> |
|||
<el-table-column prop="ivt_qty" label="库存数" :formatter="crud.formatNum3" width="100"> |
|||
<template slot-scope="scope"> |
|||
<el-input type="text" v-model="scope.row.ivt_qty" v-show="!showTab" /> |
|||
<span v-show="showTab">{{scope.row.ivt_qty}}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="material_code" label="物料编码" > |
|||
<template slot-scope="scope"> |
|||
<el-input type="text" v-model="scope.row.material_code" v-show="!showTab" /> |
|||
<span v-show="showTab">{{scope.row.material_code}}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="material_name" label="物料名称" /> |
|||
<el-table-column prop="instorage_time" label="入库时间" min-width="150" show-overflow-tooltip/> |
|||
<el-table-column prop="point_status" label="点位状态" width="120"> |
|||
<template slot-scope="scope"> |
|||
<el-select |
|||
v-show="!showTab" |
|||
v-model="scope.row.point_status" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
> |
|||
<el-option |
|||
v-for="item in pointStatusList" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
<span v-show="showTab">{{scope.row.point_status_name}}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="lock_type" label="锁定类型" width="120"> |
|||
<template slot-scope="scope"> |
|||
<el-select |
|||
v-model="scope.row.lock_type" |
|||
v-show="!showTab" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
> |
|||
<el-option |
|||
v-for="item in dict.d_lock_type" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
<span v-show="showTab">{{ dict.label.d_lock_type[scope.row.lock_type] }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="is_used" label="是否启用"> |
|||
<template slot-scope="scope"> |
|||
<el-switch |
|||
v-show="!showTab" |
|||
v-model="scope.row.is_used" |
|||
active-value="0" |
|||
inactive-value="1" |
|||
active-color="#C0CCDA" |
|||
inactive-color="#409EFF" |
|||
/> |
|||
<span v-show="showTab">{{ scope.row.is_used=='1' ? '是' : '否' }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="vehicle_type" label="托盘类型" min-width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-select |
|||
v-show="!showTab" |
|||
v-model="scope.row.vehicle_type" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
> |
|||
<el-option |
|||
v-for="item in dict.vehicle_type" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
<span v-show="showTab">{{ dict.label.vehicle_type[scope.row.vehicle_type] }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="vehicle_code" label="托盘号" /> |
|||
<el-table-column prop="standing_time" label="静置时间(min)" min-width="120" /> |
|||
</el-table> |
|||
<!--分页组件--> |
|||
<pagination /> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import crudStructivt from '../structivt' |
|||
import CRUD, { crud, form, 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 crudRegion from '@/api/wms/sch/region' |
|||
|
|||
const defaultForm = { point_id: null, point_code: null, pcsn: null, material_id: null, ivt_qty: null, qty_unit_id: null, instorage_time: null, ext_code: null, point_status: null, vehicle_type: null, standing_time: null, block_num: null, row_num: null, col_num: null, layer_num: null, remark: null, is_used: null, is_lock: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null } |
|||
export default { |
|||
name: 'Inventory', |
|||
components: { pagination, crudOperation, rrOperation, udOperation }, |
|||
dicts: ['vehicle_type', 'is_used', 'd_lock_type'], |
|||
mixins: [presenter(), header(), form(defaultForm), crud()], |
|||
cruds() { |
|||
return CRUD({ |
|||
title: '养生A区', |
|||
url: 'api/structivt', |
|||
idField: 'point_id', |
|||
sort: 'point_id,desc', |
|||
optShow: { |
|||
add: false, |
|||
edit: true, |
|||
del: false, |
|||
download: false, |
|||
reset: true |
|||
}, |
|||
query: { |
|||
region_code: "'YSQA01', 'YSAQKTPQ01'" |
|||
}, |
|||
crudMethod: { ...crudStructivt } |
|||
}) |
|||
}, |
|||
data() { |
|||
return { |
|||
showTab: true, |
|||
pointStatusList: [], |
|||
permission: { |
|||
}, |
|||
rules: { |
|||
is_used: [ |
|||
{ required: true, message: '是否启用不能为空', trigger: 'blur' } |
|||
], |
|||
is_lock: [ |
|||
{ required: true, message: '是否锁定不能为空', trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
this.getPointStatusList('1557539288307077120') |
|||
}, |
|||
methods: { |
|||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
|||
[CRUD.HOOK.beforeRefresh]() { |
|||
return true |
|||
}, |
|||
querys() { |
|||
this.crud.toQuery() |
|||
}, |
|||
hand(value) { |
|||
// 块排列 的参数整合 |
|||
if (this.locations.length > 0) { |
|||
this.query.locationsOptions = this.locations[0] + '/' + this.locations[1] + '/' + this.locations[2] |
|||
} |
|||
this.crud.toQuery() |
|||
}, |
|||
changeShowTab() { |
|||
this.showTab = !this.showTab |
|||
}, |
|||
getPointStatusList(id) { |
|||
crudRegion.getPointStatusSelectById(id).then(res => { |
|||
this.pointStatusList = res |
|||
}) |
|||
}, |
|||
doEdit(datas) { |
|||
if (datas.length > 0) { |
|||
crudStructivt.batchEdit(datas).then(res => { |
|||
this.crud.notify('保存成功', CRUD.NOTIFICATION_TYPE.SUCCESS) |
|||
this.crud.toQuery() |
|||
}) |
|||
} |
|||
this.showTab = true |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
@ -1,188 +0,0 @@ |
|||
<template> |
|||
<div> |
|||
<!--工具栏--> |
|||
<div class="head-container"> |
|||
<div v-if="crud.props.searchToggle"> |
|||
<el-form |
|||
:inline="true" |
|||
class="demo-form-inline" |
|||
label-position="right" |
|||
label-width="90px" |
|||
label-suffix=":" |
|||
> |
|||
<el-form-item label="单据编号"> |
|||
<el-input |
|||
v-model="query.bill_code" |
|||
clearable |
|||
size="mini" |
|||
style="width: 185px;" |
|||
placeholder="单据编号" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="单据状态"> |
|||
<el-select |
|||
v-model="query.bill_status" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
class="filter-item" |
|||
style="width: 185px;" |
|||
@change="crud.toQuery" |
|||
> |
|||
<el-option |
|||
v-for="item in dict.st_bill_status" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</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> |
|||
<rrOperation :crud="crud" /> |
|||
</el-form> |
|||
</div> |
|||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
|||
<crudOperation :permission="permission" /> |
|||
<!--表单组件--> |
|||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px"> |
|||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px"> |
|||
<el-form-item label="单据编号" prop="bill_code"> |
|||
<el-input v-model="form.bill_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="出入类型" prop="io_type"> |
|||
<el-input v-model="form.io_type" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="批次"> |
|||
<el-input v-model="form.pcsn" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="载具编码"> |
|||
<el-input v-model="form.vehicle_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="数量"> |
|||
<el-input v-model="form.qty" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="单据状态" prop="bill_status"> |
|||
<el-input v-model="form.bill_status" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="起始点位编码"> |
|||
<el-input v-model="form.start_point_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="终点点位编码"> |
|||
<el-input v-model="form.end_point_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="起始区域"> |
|||
<el-input v-model="form.start_region_id" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="终点区域"> |
|||
<el-input v-model="form.end_region_id" style="width: 370px;" /> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="text" @click="crud.cancelCU">取消</el-button> |
|||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
<!--表格渲染--> |
|||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
|||
<el-table-column type="selection" width="55" /> |
|||
<el-table-column prop="bill_code" label="单据编号" min-width="150" /> |
|||
<el-table-column prop="io_type" label="出入类型"> |
|||
<template slot-scope="scope"> |
|||
{{ dict.label.io_type[scope.row.io_type] }} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="pcsn" label="批次" /> |
|||
<el-table-column prop="vehicle_code" label="载具编码" show-overflow-tooltip /> |
|||
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum3" /> |
|||
<el-table-column prop="bill_status" label="单据状态"> |
|||
<template slot-scope="scope"> |
|||
{{ dict.label.st_bill_status[scope.row.bill_status] }} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="start_point_code" label="起点" min-width="120" /> |
|||
<el-table-column prop="end_point_code" label="终点" min-width="120" /> |
|||
<!-- <el-table-column prop="start_region_id" label="起始区域" />--> |
|||
<!-- <el-table-column prop="end_region_id" label="终点区域" />--> |
|||
<el-table-column prop="remark" label="备注" /> |
|||
<el-table-column prop="update_optname" label="修改人" min-width="100" /> |
|||
<el-table-column prop="update_time" label="修改时间" min-width="140" /> |
|||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right"> |
|||
<template slot-scope="scope"> |
|||
<udOperation |
|||
:data="scope.row" |
|||
:permission="permission" |
|||
/> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<!--分页组件--> |
|||
<pagination /> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import crudBill from '@/views/wms/st/regionio' |
|||
import CRUD, { crud, form, 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' |
|||
|
|||
const defaultForm = { iostorinv_id: null, bill_code: null, io_type: null, material_id: null, pcsn: null, vehicle_code: null, qty: null, qty_unit_id: null, bill_status: null, start_point_code: null, end_point_code: null, start_region_id: null, end_region_id: null, cust_id: null, create_mode: null, task_id: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, confirm_optid: null, confirm_optname: null, confirm_time: null, is_delete: null } |
|||
export default { |
|||
name: 'YsqInRegion', |
|||
components: { pagination, crudOperation, rrOperation, udOperation }, |
|||
dicts: ['io_type', 'st_bill_status'], |
|||
mixins: [presenter(), header(), form(defaultForm), crud()], |
|||
cruds() { |
|||
return CRUD({ |
|||
title: '养生区入库管理', |
|||
url: 'api/regionio', |
|||
idField: 'qty_unit_id', |
|||
sort: 'qty_unit_id,desc', |
|||
crudMethod: { ...crudBill }, |
|||
query: { |
|||
io_type: '1', |
|||
io_region: "'YSQA01', 'YSAQKTPQ01'" |
|||
} |
|||
}) |
|||
}, |
|||
data() { |
|||
return { |
|||
permission: { |
|||
}, |
|||
rules: { |
|||
bill_code: [ |
|||
{ required: true, message: '单据编号不能为空', trigger: 'blur' } |
|||
], |
|||
io_type: [ |
|||
{ required: true, message: '出入类型不能为空', trigger: 'blur' } |
|||
], |
|||
bill_status: [ |
|||
{ required: true, message: '单据状态不能为空', trigger: 'blur' } |
|||
] |
|||
}} |
|||
}, |
|||
methods: { |
|||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
|||
[CRUD.HOOK.beforeRefresh]() { |
|||
return true |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
@ -1,190 +0,0 @@ |
|||
<template> |
|||
<div> |
|||
<!--工具栏--> |
|||
<div class="head-container"> |
|||
<div v-if="crud.props.searchToggle"> |
|||
<el-form |
|||
:inline="true" |
|||
class="demo-form-inline" |
|||
label-position="right" |
|||
label-width="90px" |
|||
label-suffix=":" |
|||
> |
|||
<el-form-item label="单据编号"> |
|||
<el-input |
|||
v-model="query.bill_code" |
|||
clearable |
|||
size="mini" |
|||
style="width: 185px;" |
|||
placeholder="单据编号" |
|||
@keyup.enter.native="crud.toQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="单据状态"> |
|||
<el-select |
|||
v-model="query.bill_status" |
|||
clearable |
|||
filterable |
|||
size="mini" |
|||
class="filter-item" |
|||
style="width: 185px;" |
|||
@change="crud.toQuery" |
|||
> |
|||
<el-option |
|||
v-for="item in dict.st_bill_status" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</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> |
|||
<rrOperation :crud="crud" /> |
|||
</el-form> |
|||
</div> |
|||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
|||
<crudOperation :permission="permission" /> |
|||
<!--表单组件--> |
|||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px"> |
|||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px"> |
|||
<el-form-item label="单据编号" prop="bill_code"> |
|||
<el-input v-model="form.bill_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="出入类型" prop="io_type"> |
|||
<el-input v-model="form.io_type" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="批次"> |
|||
<el-input v-model="form.pcsn" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="载具编码"> |
|||
<el-input v-model="form.vehicle_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="数量"> |
|||
<el-input v-model="form.qty" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="单据状态" prop="bill_status"> |
|||
<el-input v-model="form.bill_status" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="起始点位编码"> |
|||
<el-input v-model="form.start_point_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="终点点位编码"> |
|||
<el-input v-model="form.end_point_code" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="起始区域"> |
|||
<el-input v-model="form.start_region_id" style="width: 370px;" /> |
|||
</el-form-item> |
|||
<el-form-item label="终点区域"> |
|||
<el-input v-model="form.end_region_id" style="width: 370px;" /> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="text" @click="crud.cancelCU">取消</el-button> |
|||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
<!--表格渲染--> |
|||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
|||
<el-table-column type="selection" width="55" /> |
|||
<el-table-column prop="bill_code" label="单据编号" min-width="150"/> |
|||
<el-table-column prop="io_type" label="出入类型" > |
|||
<template slot-scope="scope"> |
|||
{{ dict.label.io_type[scope.row.io_type] }} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="pcsn" label="批次" /> |
|||
<el-table-column prop="vehicle_code" label="载具编码" show-overflow-tooltip/> |
|||
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum3"/> |
|||
<el-table-column prop="bill_status" label="单据状态" > |
|||
<template slot-scope="scope"> |
|||
{{ dict.label.st_bill_status[scope.row.bill_status] }} |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="start_point_code" label="起始点位编码" min-width="120"/> |
|||
<el-table-column prop="end_point_code" label="终点点位编码" min-width="120"/> |
|||
<!-- <el-table-column prop="start_region_id" label="起始区域" />--> |
|||
<!-- <el-table-column prop="end_region_id" label="终点区域" />--> |
|||
<el-table-column prop="remark" label="备注" /> |
|||
<el-table-column prop="update_optname" label="修改人姓名" min-width="100"/> |
|||
<el-table-column prop="update_time" label="修改时间" min-width="140"/> |
|||
<el-table-column prop="confirm_optname" label="确认人姓名" min-width="100"/> |
|||
<el-table-column prop="confirm_time" label="确认时间" min-width="140"/> |
|||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right"> |
|||
<template slot-scope="scope"> |
|||
<udOperation |
|||
:data="scope.row" |
|||
:permission="permission" |
|||
/> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<!--分页组件--> |
|||
<pagination /> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import crudBill from '@/views/wms/st/regionio' |
|||
import CRUD, {crud, form, 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' |
|||
|
|||
const defaultForm = { iostorinv_id: null, bill_code: null, io_type: null, material_id: null, pcsn: null, vehicle_code: null, qty: null, qty_unit_id: null, bill_status: null, start_point_code: null, end_point_code: null, start_region_id: null, end_region_id: null, cust_id: null, create_mode: null, task_id: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, confirm_optid: null, confirm_optname: null, confirm_time: null, is_delete: null } |
|||
export default { |
|||
name: 'YsqOutRegion', |
|||
components: { pagination, crudOperation, rrOperation, udOperation }, |
|||
dicts: ['io_type', 'st_bill_status'], |
|||
mixins: [presenter(), header(), form(defaultForm), crud()], |
|||
cruds() { |
|||
return CRUD({ |
|||
title: '养生区入库管理', |
|||
url: 'api/regionio', |
|||
idField: 'qty_unit_id', |
|||
sort: 'qty_unit_id,desc', |
|||
crudMethod: { ...crudBill }, |
|||
query: { |
|||
io_type: '2', |
|||
io_region: "'YSQA01', 'YSAQKTPQ01'" |
|||
} |
|||
}) |
|||
}, |
|||
data() { |
|||
return { |
|||
permission: { |
|||
}, |
|||
rules: { |
|||
bill_code: [ |
|||
{ required: true, message: '单据编号不能为空', trigger: 'blur' } |
|||
], |
|||
io_type: [ |
|||
{ required: true, message: '出入类型不能为空', trigger: 'blur' } |
|||
], |
|||
bill_status: [ |
|||
{ required: true, message: '单据状态不能为空', trigger: 'blur' } |
|||
] |
|||
} } |
|||
}, |
|||
methods: { |
|||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
|||
[CRUD.HOOK.beforeRefresh]() { |
|||
return true |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
Loading…
Reference in new issue