add: 新增物料信息
This commit is contained in:
@@ -0,0 +1,66 @@
|
|||||||
|
package org.nl.wms.controller.basedata;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.common.TableDataInfo;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.modules.logging.annotation.Log;
|
||||||
|
import org.nl.wms.service.basedata.IMaterialService;
|
||||||
|
import org.nl.wms.service.basedata.dao.Material;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
/**
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-04
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "物料基础信息管理")
|
||||||
|
@RequestMapping("/api/material")
|
||||||
|
public class MaterialController {
|
||||||
|
|
||||||
|
private final IMaterialService materialService;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
@Log("查询物料基础信息")
|
||||||
|
@ApiOperation("查询物料基础信息")
|
||||||
|
//@SaCheckPermission("@el.check('material:list')")
|
||||||
|
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page){
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(materialService.queryAll(whereJson,page)),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Log("新增物料基础信息")
|
||||||
|
@ApiOperation("新增物料基础信息")
|
||||||
|
//@SaCheckPermission("@el.check('material:add')")
|
||||||
|
public ResponseEntity<Object> create(@Validated @RequestBody Material entity){
|
||||||
|
materialService.create(entity);
|
||||||
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Log("修改物料基础信息")
|
||||||
|
@ApiOperation("修改物料基础信息")
|
||||||
|
//@SaCheckPermission("@el.check('material:edit')")
|
||||||
|
public ResponseEntity<Object> update(@Validated @RequestBody Material entity){
|
||||||
|
materialService.update(entity);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log("删除物料基础信息")
|
||||||
|
@ApiOperation("删除物料基础信息")
|
||||||
|
//@SaCheckPermission("@el.check('material:del')")
|
||||||
|
@DeleteMapping
|
||||||
|
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||||
|
materialService.deleteAll(ids);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -63,4 +63,12 @@ public class WorkshopController {
|
|||||||
workshopService.deleteAll(ids);
|
workshopService.deleteAll(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/workShopList")
|
||||||
|
@Log("查询车间下拉框")
|
||||||
|
@ApiOperation("查询车间下拉框")
|
||||||
|
//@SaCheckPermission("@el.check('workshop:list')")
|
||||||
|
public ResponseEntity<Object> workShopList(){
|
||||||
|
return new ResponseEntity<>(workshopService.workShopList(),HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package org.nl.wms.service.basedata;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.wms.service.basedata.dao.Material;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 服务接口
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-04
|
||||||
|
**/
|
||||||
|
public interface IMaterialService extends IService<Material> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @param pageable 分页参数
|
||||||
|
* @return IPage<Material>
|
||||||
|
*/
|
||||||
|
IPage<Material> queryAll(Map whereJson, PageQuery pageable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建
|
||||||
|
* @param entity /
|
||||||
|
*/
|
||||||
|
void create(Material entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @param entity /
|
||||||
|
*/
|
||||||
|
void update(Material entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多选删除
|
||||||
|
* @param ids /
|
||||||
|
*/
|
||||||
|
void deleteAll(Set<String> ids);
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import org.nl.common.domain.query.PageQuery;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.nl.wms.service.basedata.dao.Workshop;
|
import org.nl.wms.service.basedata.dao.Workshop;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -40,4 +41,10 @@ public interface IWorkshopService extends IService<Workshop> {
|
|||||||
* @param ids /
|
* @param ids /
|
||||||
*/
|
*/
|
||||||
void deleteAll(Set<String> ids);
|
void deleteAll(Set<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取下拉框
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Workshop> workShopList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package org.nl.wms.service.basedata.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description /
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-04
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("md_base_material")
|
||||||
|
public class Material implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@TableId(value = "material_id", type = IdType.NONE)
|
||||||
|
@ApiModelProperty(value = "物料标识")
|
||||||
|
private String materialId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "物料编码")
|
||||||
|
private String materialCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "物料名称 ")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "物料规格")
|
||||||
|
private String materialSpec;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "物料分类标识")
|
||||||
|
private String classId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "静置时间(分钟)")
|
||||||
|
private BigDecimal standingTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "车间编码")
|
||||||
|
private String workshopCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否启用")
|
||||||
|
private Boolean isUsed;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除")
|
||||||
|
private Boolean isDelete;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String createId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String createName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改人")
|
||||||
|
private String updateId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改人")
|
||||||
|
private String updateName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private String updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "外部标识")
|
||||||
|
private String extId;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.nl.wms.service.basedata.dao.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.nl.wms.service.basedata.dao.Material;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-04
|
||||||
|
**/
|
||||||
|
public interface MaterialMapper extends BaseMapper<Material> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.nl.wms.service.basedata.dao.mapper.MaterialMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package org.nl.wms.service.basedata.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description /
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-04
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class MaterialDto implements Serializable {
|
||||||
|
|
||||||
|
/** 物料标识 */
|
||||||
|
private String materialId;
|
||||||
|
|
||||||
|
/** 物料编码 */
|
||||||
|
private String materialCode;
|
||||||
|
|
||||||
|
/** 物料名称 */
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
/** 物料规格 */
|
||||||
|
private String materialSpec;
|
||||||
|
|
||||||
|
/** 物料分类标识 */
|
||||||
|
private String classId;
|
||||||
|
|
||||||
|
/** 静置时间(分钟) */
|
||||||
|
private BigDecimal standingTime;
|
||||||
|
|
||||||
|
/** 车间编码 */
|
||||||
|
private String workshopCode;
|
||||||
|
|
||||||
|
/** 备注 */
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/** 是否启用 */
|
||||||
|
private Boolean isUsed;
|
||||||
|
|
||||||
|
/** 是否删除 */
|
||||||
|
private Boolean isDelete;
|
||||||
|
|
||||||
|
/** 创建人 */
|
||||||
|
private String createId;
|
||||||
|
|
||||||
|
/** 创建人 */
|
||||||
|
private String createName;
|
||||||
|
|
||||||
|
/** 创建时间 */
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
/** 修改人 */
|
||||||
|
private String updateId;
|
||||||
|
|
||||||
|
/** 修改人 */
|
||||||
|
private String updateName;
|
||||||
|
|
||||||
|
/** 修改时间 */
|
||||||
|
private String updateTime;
|
||||||
|
|
||||||
|
/** 外部标识 */
|
||||||
|
private String extId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.nl.wms.service.basedata.dto;
|
||||||
|
|
||||||
|
import org.nl.common.domain.query.BaseQuery;
|
||||||
|
import org.nl.wms.service.basedata.dao.Material;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-04
|
||||||
|
**/
|
||||||
|
public class MaterialQuery extends BaseQuery<Material> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package org.nl.wms.service.basedata.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.modules.common.utils.SecurityUtils;
|
||||||
|
import org.nl.wms.service.basedata.IMaterialService;
|
||||||
|
import org.nl.wms.service.basedata.dao.mapper.MaterialMapper;
|
||||||
|
import org.nl.wms.service.basedata.dao.Material;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 服务实现
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-04
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> implements IMaterialService {
|
||||||
|
|
||||||
|
private final MaterialMapper materialMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<Material> queryAll(Map param, PageQuery page){
|
||||||
|
String blurry = null;
|
||||||
|
if (ObjectUtil.isNotEmpty(param.get("blurry"))) blurry = param.get("blurry").toString();
|
||||||
|
LambdaQueryWrapper<Material> lam = new LambdaQueryWrapper<>();
|
||||||
|
lam.like(ObjectUtil.isNotEmpty(blurry), Material::getMaterialCode, blurry)
|
||||||
|
.or(ObjectUtil.isNotEmpty(blurry))
|
||||||
|
.like(ObjectUtil.isNotEmpty(blurry), Material::getMaterialName, blurry)
|
||||||
|
.orderByDesc(Material::getCreateTime);
|
||||||
|
IPage<Material> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||||
|
materialMapper.selectPage(pages, lam);
|
||||||
|
return pages;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void create(Material entity) {
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
|
String now = DateUtil.now();
|
||||||
|
|
||||||
|
entity.setMaterialId(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||||
|
entity.setCreateId(currentUserId);
|
||||||
|
entity.setCreateName(nickName);
|
||||||
|
entity.setCreateTime(now);
|
||||||
|
entity.setUpdateId(currentUserId);
|
||||||
|
entity.setUpdateName(nickName);
|
||||||
|
entity.setUpdateTime(now);
|
||||||
|
materialMapper.insert(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void update(Material entity) {
|
||||||
|
Material dto = materialMapper.selectById(entity.getMaterialId());
|
||||||
|
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||||
|
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
|
String now = DateUtil.now();
|
||||||
|
entity.setUpdateId(currentUserId);
|
||||||
|
entity.setUpdateName(nickName);
|
||||||
|
entity.setUpdateTime(now);
|
||||||
|
|
||||||
|
materialMapper.updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void deleteAll(Set<String> ids) {
|
||||||
|
// 真删除
|
||||||
|
materialMapper.deleteBatchIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -17,6 +17,7 @@ import org.nl.wms.service.basedata.dao.mapper.WorkshopMapper;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -80,4 +81,9 @@ public class WorkshopServiceImpl extends ServiceImpl< WorkshopMapper, Workshop>
|
|||||||
workshopMapper.deleteBatchIds(ids);
|
workshopMapper.deleteBatchIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Workshop> workShopList() {
|
||||||
|
return this.list();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class ${className}Controller {
|
|||||||
@Log("查询${apiAlias}")
|
@Log("查询${apiAlias}")
|
||||||
@ApiOperation("查询${apiAlias}")
|
@ApiOperation("查询${apiAlias}")
|
||||||
//@SaCheckPermission("@el.check('${changeClassName}:list')")
|
//@SaCheckPermission("@el.check('${changeClassName}:list')")
|
||||||
public ResponseEntity<Object> query(Map whereJson, PageQuery page){
|
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page){
|
||||||
return new ResponseEntity<>(TableDataInfo.build(${changeClassName}Service.queryAll(whereJson,page)),HttpStatus.OK);
|
return new ResponseEntity<>(TableDataInfo.build(${changeClassName}Service.queryAll(whereJson,page)),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
201
nladmin-ui/src/views/wms/basedata/material/index.vue
Normal file
201
nladmin-ui/src/views/wms/basedata/material/index.vue
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!--工具栏-->
|
||||||
|
<div class="head-container">
|
||||||
|
<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.blurry"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="编码/名称"
|
||||||
|
@keyup.enter.native="crud.toQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation />
|
||||||
|
</el-form>
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, 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="物料编码">
|
||||||
|
<el-input v-model="form.materialCode" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料名称 ">
|
||||||
|
<el-input v-model="form.materialName" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料规格">
|
||||||
|
<el-input v-model="form.materialSpec" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="物料分类标识">-->
|
||||||
|
<!-- <el-input v-model="form.classId" style="width: 370px;" />-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<el-form-item label="静置时间(分钟)">
|
||||||
|
<el-input v-model="form.standingTime" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="车间编码">
|
||||||
|
<el-select v-model="form.workshopCode" placeholder="请选择" style="width: 370px;" clearable >
|
||||||
|
<el-option
|
||||||
|
v-for="item in workShopList"
|
||||||
|
:key="item.workshopCode"
|
||||||
|
:label="item.workshopName"
|
||||||
|
:value="item.workshopCode">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="form.remark" 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="materialCode"
|
||||||
|
label="物料编码"
|
||||||
|
:min-width="flexWidth('materialCode',crud.data,'物料编码')"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="materialName"
|
||||||
|
label="物料名称 "
|
||||||
|
:min-width="flexWidth('materialName',crud.data,'物料名称 ')"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="materialSpec"
|
||||||
|
label="物料规格"
|
||||||
|
:min-width="flexWidth('materialSpec',crud.data,'物料规格')"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="standingTime"
|
||||||
|
label="静置时间(分钟)"
|
||||||
|
:width="flexWidth('standingTime',crud.data,'静置时间分钟分钟')"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="workshopCode"
|
||||||
|
label="车间编码"
|
||||||
|
:width="flexWidth('workshopCode',crud.data,'车间编码')"
|
||||||
|
/>
|
||||||
|
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||||
|
<el-table-column prop="isUsed" label="是否启用" :min-width="flexWidth('isUsed',crud.data,'是否启用')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{scope.row.isUsed?'是':'否'}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="isDelete" label="是否删除" :min-width="flexWidth('isDelete',crud.data,'是否删除')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{scope.row.isDelete?'是':'否'}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="createName" label="创建人" :min-width="flexWidth('createName',crud.data,'创建人')" />
|
||||||
|
<el-table-column prop="createTime" label="创建时间" :min-width="flexWidth('createTime',crud.data,'创建时间')" />
|
||||||
|
<el-table-column prop="updateName" label="修改人" :min-width="flexWidth('updateName',crud.data,'修改人')" />
|
||||||
|
<el-table-column prop="updateTime" label="修改时间" :min-width="flexWidth('updateTime',crud.data,'修改时间')" />
|
||||||
|
<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 crudMaterial from './material'
|
||||||
|
import crudWorkShop from '../workshop/workshop'
|
||||||
|
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 = {
|
||||||
|
materialId: null,
|
||||||
|
materialCode: null,
|
||||||
|
materialName: null,
|
||||||
|
materialSpec: null,
|
||||||
|
classId: null,
|
||||||
|
standingTime: null,
|
||||||
|
workshopCode: null,
|
||||||
|
remark: null,
|
||||||
|
isUsed: true,
|
||||||
|
isDelete: false,
|
||||||
|
createId: null,
|
||||||
|
createName: null,
|
||||||
|
createTime: null,
|
||||||
|
updateId: null,
|
||||||
|
updateName: null,
|
||||||
|
updateTime: null,
|
||||||
|
extId: null
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
name: 'Material',
|
||||||
|
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||||
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '物料基础信息',
|
||||||
|
url: 'api/material',
|
||||||
|
idField: 'materialId',
|
||||||
|
sort: 'materialId,desc',
|
||||||
|
crudMethod: { ...crudMaterial }
|
||||||
|
})
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
permission: {},
|
||||||
|
rules: {},
|
||||||
|
workShopList: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.workShopListIni() // 初始化车间数据
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
workShopListIni() {
|
||||||
|
crudWorkShop.workShopList().then(res => {
|
||||||
|
console.log(res)
|
||||||
|
this.workShopList = res
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -2,7 +2,7 @@ import request from '@/utils/request'
|
|||||||
|
|
||||||
export function add(data) {
|
export function add(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/workshop',
|
url: 'api/material',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -10,7 +10,7 @@ export function add(data) {
|
|||||||
|
|
||||||
export function del(ids) {
|
export function del(ids) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/workshop/',
|
url: 'api/material/',
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
@@ -18,7 +18,7 @@ export function del(ids) {
|
|||||||
|
|
||||||
export function edit(data) {
|
export function edit(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/workshop',
|
url: 'api/material',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -81,10 +81,10 @@
|
|||||||
<script>
|
<script>
|
||||||
import crudWorkshop from './workshop'
|
import crudWorkshop from './workshop'
|
||||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||||
import rrOperation from '@crud/RR.operation'
|
import rrOperation from '@crud/RR.operation.vue'
|
||||||
import crudOperation from '@crud/CRUD.operation'
|
import crudOperation from '@crud/CRUD.operation.vue'
|
||||||
import udOperation from '@crud/UD.operation'
|
import udOperation from '@crud/UD.operation.vue'
|
||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination.vue'
|
||||||
|
|
||||||
const defaultForm = {
|
const defaultForm = {
|
||||||
workshopCode: null,
|
workshopCode: null,
|
||||||
34
nladmin-ui/src/views/wms/basedata/workshop/workshop.js
Normal file
34
nladmin-ui/src/views/wms/basedata/workshop/workshop.js
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/workshop',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: 'api/workshop/',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/workshop',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function workShopList() {
|
||||||
|
return request({
|
||||||
|
url: 'api/workshop/workShopList',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del, workShopList }
|
||||||
Reference in New Issue
Block a user