成品库区
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
|
||||
package org.nl.wms.sch.cppoint.rest;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.nl.wms.sch.cppoint.service.CppointService;
|
||||
import org.nl.wms.sch.cppoint.service.dto.CppointDto;
|
||||
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-18
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "成品库区管理")
|
||||
@RequestMapping("/api/cppoint")
|
||||
@Slf4j
|
||||
public class CppointController {
|
||||
|
||||
private final CppointService cppointService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询成品库区")
|
||||
@ApiOperation("查询成品库区")
|
||||
//@SaCheckPermission("@el.check('cppoint:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(cppointService.queryAll(whereJson,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@Log("新增成品库区")
|
||||
@ApiOperation("新增成品库区")
|
||||
@SaIgnore
|
||||
//@SaCheckPermission("@el.check('cppoint:add')")
|
||||
public ResponseEntity<Object> create(){
|
||||
cppointService.create();
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改成品库区")
|
||||
@ApiOperation("修改成品库区")
|
||||
//@SaCheckPermission("@el.check('cppoint:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody CppointDto dto){
|
||||
cppointService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除成品库区")
|
||||
@ApiOperation("删除成品库区")
|
||||
//@SaCheckPermission("@el.check('cppoint:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
cppointService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("启动")
|
||||
@PostMapping("/changeUsedOn")
|
||||
@ApiOperation("启动")
|
||||
public ResponseEntity<Object> changeUsedOn(@RequestBody JSONArray jsonArray) {
|
||||
cppointService.changeUsed(jsonArray, 1);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("禁用")
|
||||
@PostMapping("/changeUsedOff")
|
||||
@ApiOperation("禁用")
|
||||
public ResponseEntity<Object> changeUsedOff(@RequestBody JSONArray jsonArray) {
|
||||
cppointService.changeUsed(jsonArray, 0);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package org.nl.wms.sch.cppoint.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.nl.wms.sch.cppoint.service.dto.CppointDto;
|
||||
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-18
|
||||
**/
|
||||
public interface CppointService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param whereJson 条件参数
|
||||
* @return List<CppointDto>
|
||||
*/
|
||||
List<CppointDto> queryAll(Map whereJson);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param point_id ID
|
||||
* @return Cppoint
|
||||
*/
|
||||
CppointDto findById(Long point_id);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
* @param code code
|
||||
* @return Cppoint
|
||||
*/
|
||||
CppointDto findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*/
|
||||
void create();
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param dto /
|
||||
*/
|
||||
void update(CppointDto dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
/**
|
||||
* 改变是否启用
|
||||
* @param jsonArray
|
||||
* @param i
|
||||
*/
|
||||
void changeUsed(JSONArray jsonArray, int i);
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package org.nl.wms.sch.cppoint.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-18
|
||||
**/
|
||||
@Data
|
||||
public class CppointDto implements Serializable {
|
||||
|
||||
/** 点位标识 */
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private Long point_id;
|
||||
|
||||
/** 点位编码 */
|
||||
private String point_code;
|
||||
|
||||
/** 批次 */
|
||||
private String pcsn;
|
||||
|
||||
/** 物料标识 */
|
||||
private Long material_id;
|
||||
|
||||
/** 库存数 */
|
||||
private BigDecimal ivt_qty;
|
||||
|
||||
/** 计量单位标识 */
|
||||
private Long qty_unit_id;
|
||||
|
||||
/** 入库时间 */
|
||||
private String instorage_time;
|
||||
|
||||
/** 外部编码 */
|
||||
private String ext_code;
|
||||
|
||||
/** 点位状态 */
|
||||
private String point_status;
|
||||
|
||||
/** 托盘类型 */
|
||||
private String vehicle_type;
|
||||
|
||||
/** 排 */
|
||||
private BigDecimal row_num;
|
||||
|
||||
/** 列 */
|
||||
private BigDecimal col_num;
|
||||
|
||||
/** 层 */
|
||||
private BigDecimal layer_num;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 是否启用 */
|
||||
private String is_used;
|
||||
|
||||
/** 是否锁定 */
|
||||
private String is_lock;
|
||||
|
||||
/** 创建人 */
|
||||
private Long create_id;
|
||||
|
||||
/** 创建人 */
|
||||
private String create_name;
|
||||
|
||||
/** 创建时间 */
|
||||
private String create_time;
|
||||
|
||||
/** 修改人 */
|
||||
private Long update_optid;
|
||||
|
||||
/** 修改人 */
|
||||
private String update_optname;
|
||||
|
||||
/** 修改时间 */
|
||||
private String update_time;
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
|
||||
package org.nl.wms.sch.cppoint.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.wms.sch.cppoint.service.CppointService;
|
||||
import org.nl.wms.sch.cppoint.service.dto.CppointDto;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @description 服务实现
|
||||
* @author lyd
|
||||
* @date 2022-10-18
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class CppointServiceImpl implements CppointService {
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(Map whereJson, Pageable page){
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
if (!ObjectUtil.isNull(whereJson.get("point_code"))) {
|
||||
map.put("point_code", "%" + whereJson.get("point_code") + "%");
|
||||
}
|
||||
map.put("layer_num", whereJson.get("layer_num"));
|
||||
map.put("row_num", whereJson.get("row_num"));
|
||||
map.put("col_num", whereJson.get("col_num"));
|
||||
map.put("is_lock", whereJson.get("is_lock"));
|
||||
map.put("is_used", whereJson.get("is_used"));
|
||||
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("SCH_BASE_CPPOINT").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "point_code asc");
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CppointDto> queryAll(Map whereJson){
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_base_cppoint");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
if (ObjectUtil.isNotEmpty(arr)) return arr.toJavaList(CppointDto.class);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CppointDto findById(Long point_id) {
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_base_cppoint");
|
||||
JSONObject json = wo.query("point_id = '" + point_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)){
|
||||
return json.toJavaObject( CppointDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CppointDto findByCode(String code) {
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_base_cppoint");
|
||||
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)){
|
||||
return json.toJavaObject( CppointDto.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create() {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_base_CpPoint");
|
||||
for (int i = 1; i <= 4; i++) {
|
||||
String row = "";
|
||||
if ( i < 10 ) row = "0" + i;
|
||||
else row = "" + i;
|
||||
for (int j = 1; j <= 78; j++) {
|
||||
String col = "";
|
||||
if ( j < 10) col = "-" + "0" + j;
|
||||
else col = "-" + j;
|
||||
for ( int k = 1; k <= 5; k++ ) {
|
||||
String layer = "-" + "0" + k;
|
||||
String now = DateUtil.now();
|
||||
JSONObject cp = new JSONObject();
|
||||
cp.put("point_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
cp.put("point_code", row + col + layer);
|
||||
cp.put("row_num", i);
|
||||
cp.put("col_num", j);
|
||||
cp.put("layer_num", k);
|
||||
cp.put("is_used", 1);
|
||||
cp.put("is_lock", 0);
|
||||
cp.put("create_id", currentUserId);
|
||||
cp.put("create_name", nickName);
|
||||
cp.put("create_time", now);
|
||||
cp.put("update_optid", currentUserId);
|
||||
cp.put("update_optname", nickName);
|
||||
cp.put("update_time", now);
|
||||
wo.insert(cp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(CppointDto dto) {
|
||||
CppointDto entity = this.findById(dto.getPoint_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("sch_base_cppoint");
|
||||
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("sch_base_cppoint");
|
||||
for (Long point_id: ids) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_id", String.valueOf(point_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
|
||||
* @param flag
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void changeUsed(JSONArray jsonArray, int flag) {
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_base_CpPoint");
|
||||
for ( int i = 0; i < jsonArray.size(); i++ ) {
|
||||
JSONObject object = jsonArray.getJSONObject(i);
|
||||
if (flag == 1) object.put("is_used", 1);
|
||||
else object.put("is_used", 0);
|
||||
wo.update(object);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
[交易说明]
|
||||
交易名: 成品区
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.point_code TYPEAS s_string
|
||||
输入.layer_num TYPEAS s_string
|
||||
输入.row_num TYPEAS s_string
|
||||
输入.col_num TYPEAS s_string
|
||||
输入.is_lock TYPEAS s_string
|
||||
输入.is_used TYPEAS s_string
|
||||
输入.point_status TYPEAS s_string
|
||||
输入.vehicle_type TYPEAS s_string
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
IF 输入.flag = "1"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
cppoint.*
|
||||
FROM
|
||||
sch_base_CpPoint cppoint
|
||||
WHERE
|
||||
1 = 1
|
||||
OPTION 输入.point_code <> ""
|
||||
point_code LIKE 输入.point_code
|
||||
ENDOPTION
|
||||
OPTION 输入.point_status <> ""
|
||||
point_status = 输入.point_status
|
||||
ENDOPTION
|
||||
OPTION 输入.vehicle_type <> ""
|
||||
vehicle_type = 输入.vehicle_type
|
||||
ENDOPTION
|
||||
OPTION 输入.layer_num <> ""
|
||||
layer_num = 输入.layer_num
|
||||
ENDOPTION
|
||||
OPTION 输入.row_num <> ""
|
||||
row_num = 输入.row_num
|
||||
ENDOPTION
|
||||
OPTION 输入.col_num <> ""
|
||||
col_num = 输入.col_num
|
||||
ENDOPTION
|
||||
OPTION 输入.is_lock <> ""
|
||||
is_lock = 输入.is_lock
|
||||
ENDOPTION
|
||||
OPTION 输入.is_used <> ""
|
||||
is_used = 输入.is_used
|
||||
ENDOPTION
|
||||
OPTION 输入.begin_time <> ""
|
||||
instorage_time >= 输入.begin_time
|
||||
ENDOPTION
|
||||
OPTION 输入.end_time <> ""
|
||||
instorage_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
42
lms/nladmin-ui/src/views/wms/sch/cppoint/cppoint.js
Normal file
42
lms/nladmin-ui/src/views/wms/sch/cppoint/cppoint.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/cppoint',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/cppoint/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/cppoint',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function changeUsedOn(data) {
|
||||
return request({
|
||||
url: 'api/cppoint/changeUsedOn',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function changeUsedOff(data) {
|
||||
return request({
|
||||
url: 'api/cppoint/changeUsedOff',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, changeUsedOn, changeUsedOff }
|
||||
312
lms/nladmin-ui/src/views/wms/sch/cppoint/index.vue
Normal file
312
lms/nladmin-ui/src/views/wms/sch/cppoint/index.vue
Normal file
@@ -0,0 +1,312 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="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.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.point_status"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
style="width: 185px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.sch_point_status"
|
||||
: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-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_lock"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#C0CCDA"
|
||||
@change="hand"
|
||||
/>
|
||||
</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
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-circle-check"
|
||||
slot="right"
|
||||
:disabled="crud.selections.length === 0"
|
||||
@click="changeEnableOn(crud.selections)"
|
||||
>
|
||||
启用
|
||||
</el-button>
|
||||
<el-button
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-circle-close"
|
||||
slot="right"
|
||||
:disabled="crud.selections.length === 0"
|
||||
@click="changeEnableOff(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="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 dict.sch_point_status"
|
||||
: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="是否启用" prop="is_used">
|
||||
<el-switch v-model="form.is_used" active-value="1" inactive-value="0"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否锁定" prop="is_lock">
|
||||
<el-switch v-model="form.is_lock" active-value="1" inactive-value="0"/>
|
||||
</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="pcsn" label="批次" />
|
||||
<el-table-column prop="ivt_qty" label="库存数" />
|
||||
<el-table-column prop="instorage_time" label="入库时间" />
|
||||
<el-table-column prop="ext_code" label="外部编码" />
|
||||
<el-table-column prop="point_status" label="点位状态" >
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.sch_point_status[scope.row.point_status] }}
|
||||
</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">
|
||||
{{ scope.row.is_used=='1' ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="is_lock" label="是否锁定" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.is_lock=='1' ? '是' : '否' }}
|
||||
</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 crudCppoint from './cppoint'
|
||||
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 = { 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: 'Cppoint',
|
||||
dicts: ['sch_point_status', 'vehicle_type', 'is_used'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '成品库区',
|
||||
url: 'api/cppoint',
|
||||
idField: 'point_id',
|
||||
sort: 'point_id,desc',
|
||||
crudMethod: { ...crudCppoint },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: true,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
is_used: [
|
||||
{ required: true, message: '是否启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_lock: [
|
||||
{ required: true, message: '是否锁定不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
changeEnableOn(data) {
|
||||
crudCppoint.changeUsedOn(data).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
changeEnableOff(data) {
|
||||
crudCppoint.changeUsedOff(data).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -124,6 +124,9 @@
|
||||
<!--表单组件-->
|
||||
<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"
|
||||
@@ -190,10 +193,6 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="standing_time" label="静置时间(min)" min-width="120"/>
|
||||
<el-table-column prop="block_num" label="块" />
|
||||
<el-table-column prop="row_num" label="排" />
|
||||
<el-table-column prop="col_num" label="列" />
|
||||
<el-table-column prop="layer_num" label="层" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="is_used" label="是否启用" >
|
||||
<template slot-scope="scope">
|
||||
@@ -258,24 +257,6 @@ export default {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
point_code: [
|
||||
{ required: true, message: '点位编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
standing_time: [
|
||||
{ required: true, message: '静置时间(min)不能为空', trigger: 'blur' }
|
||||
],
|
||||
block_num: [
|
||||
{ required: true, message: '块不能为空', trigger: 'blur' }
|
||||
],
|
||||
row_num: [
|
||||
{ required: true, message: '排不能为空', trigger: 'blur' }
|
||||
],
|
||||
col_num: [
|
||||
{ required: true, message: '列不能为空', trigger: 'blur' }
|
||||
],
|
||||
layer_num: [
|
||||
{ required: true, message: '层不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_used: [
|
||||
{ required: true, message: '是否启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
@@ -304,19 +285,16 @@ export default {
|
||||
},
|
||||
getLocationsOptions() {
|
||||
crudYsapoint.arrangementTree().then(res => {
|
||||
console.log(res)
|
||||
this.locationsOptions = res
|
||||
})
|
||||
},
|
||||
changeEnableOn(data) {
|
||||
console.log(data)
|
||||
crudYsapoint.changeUsedOn(data).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
changeEnableOff(data) {
|
||||
console.log(data)
|
||||
crudYsapoint.changeUsedOff(data).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
|
||||
Reference in New Issue
Block a user