Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
7622014015
@ -175,4 +175,8 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode FOUND_NOT_EXISTS = new ErrorCode(1_013_010, "数据已过期,请重新修改");
|
ErrorCode FOUND_NOT_EXISTS = new ErrorCode(1_013_010, "数据已过期,请重新修改");
|
||||||
ErrorCode YEAR_NUM_NOT_EXISTS = new ErrorCode(1_013_011, "数据已过期,请重新修改");
|
ErrorCode YEAR_NUM_NOT_EXISTS = new ErrorCode(1_013_011, "数据已过期,请重新修改");
|
||||||
ErrorCode PROCESS_DETAIL_NOT_EXISTS = new ErrorCode(1_013_012, "数据已过期,请重新修改");
|
ErrorCode PROCESS_DETAIL_NOT_EXISTS = new ErrorCode(1_013_012, "数据已过期,请重新修改");
|
||||||
|
|
||||||
|
// ========== 物料大类编码维护 TODO 补充编号 ==========
|
||||||
|
ErrorCode MAT_CODE_NOT_EXISTS = new ErrorCode(1_014_001, "物料大类编码维护不存在");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,84 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.controller.admin.matcode;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.module.heli.controller.admin.matcode.vo.MatCodePageReqVO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.controller.admin.matcode.vo.MatCodeRespVO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.controller.admin.matcode.vo.MatCodeSaveReqVO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.matcode.MatCodeDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.service.matcode.MatCodeService;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 物料大类编码维护")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/heli/matcode")
|
||||||
|
@Validated
|
||||||
|
public class MatCodeController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MatCodeService matCodeService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建物料大类编码维护")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:mat-code:create')")
|
||||||
|
public CommonResult<Long> createMatCode(@Valid @RequestBody MatCodeSaveReqVO createReqVO) {
|
||||||
|
return success(matCodeService.createMatCode(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新物料大类编码维护")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:mat-code:update')")
|
||||||
|
public CommonResult<Boolean> updateMatCode(@Valid @RequestBody MatCodeSaveReqVO updateReqVO) {
|
||||||
|
matCodeService.updateMatCode(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除物料大类编码维护")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:mat-code:delete')")
|
||||||
|
public CommonResult<Boolean> deleteMatCode(@RequestParam("id") Long id) {
|
||||||
|
matCodeService.deleteMatCode(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得物料大类编码维护")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:mat-code:query')")
|
||||||
|
public CommonResult<MatCodeRespVO> getMatCode(@RequestParam("id") Long id) {
|
||||||
|
MatCodeDO matCode = matCodeService.getMatCode(id);
|
||||||
|
return success(BeanUtils.toBean(matCode, MatCodeRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得物料大类编码维护分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:mat-code:query')")
|
||||||
|
public CommonResult<PageResult<MatCodeRespVO>> getMatCodePage(@Valid MatCodePageReqVO pageReqVO) {
|
||||||
|
PageResult<MatCodeDO> pageResult = matCodeService.getMatCodePage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, MatCodeRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.controller.admin.matcode.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 物料大类编码维护分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class MatCodePageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "物料大类编码")
|
||||||
|
private String matCatCode;
|
||||||
|
|
||||||
|
@Schema(description = "物料物料大类名称", example = "芋艿")
|
||||||
|
private String matCatName;
|
||||||
|
|
||||||
|
@Schema(description = "物料分类编码")
|
||||||
|
private String matTypeCode;
|
||||||
|
|
||||||
|
@Schema(description = "当前最大流水号")
|
||||||
|
private String curMaxSeq;
|
||||||
|
|
||||||
|
@Schema(description = "状态,1表示正常,2表示禁用", example = "2")
|
||||||
|
private Boolean status;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.controller.admin.matcode.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 物料大类编码维护 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class MatCodeRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "20351")
|
||||||
|
@ExcelProperty("自增字段,唯一")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "物料大类编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("物料大类编码")
|
||||||
|
private String matCatCode;
|
||||||
|
|
||||||
|
@Schema(description = "物料物料大类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
|
@ExcelProperty("物料物料大类名称")
|
||||||
|
private String matCatName;
|
||||||
|
|
||||||
|
@Schema(description = "物料分类编码")
|
||||||
|
@ExcelProperty("物料分类编码")
|
||||||
|
private String matTypeCode;
|
||||||
|
|
||||||
|
@Schema(description = "当前最大流水号")
|
||||||
|
@ExcelProperty("当前最大流水号")
|
||||||
|
private String curMaxSeq;
|
||||||
|
|
||||||
|
@Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
@ExcelProperty("状态,1表示正常,2表示禁用")
|
||||||
|
private Boolean status;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
private String creatorName;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.controller.admin.matcode.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 物料大类编码维护新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class MatCodeSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "20351")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "物料大类编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
// @NotEmpty(message = "物料大类编码不能为空")
|
||||||
|
private String matCatCode;
|
||||||
|
|
||||||
|
@Schema(description = "物料大类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "刚材")
|
||||||
|
// @NotEmpty(message = "大类名称不能为空")
|
||||||
|
private String matCatName;
|
||||||
|
|
||||||
|
@Schema(description = "物料分类编码")
|
||||||
|
private String matTypeCode;
|
||||||
|
|
||||||
|
@Schema(description = "当前最大流水号")
|
||||||
|
private String curMaxSeq;
|
||||||
|
|
||||||
|
@Schema(description = "状态,1表示正常,0表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
// @NotNull(message = "状态不能为空")
|
||||||
|
private Boolean status;
|
||||||
|
|
||||||
|
}
|
||||||
@ -2,6 +2,8 @@ package com.chanko.yunxi.mes.module.heli.controller.admin.supplier.vo;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -107,6 +109,6 @@ public class SupplierSaveReqVO {
|
|||||||
private String taxNo;
|
private String taxNo;
|
||||||
|
|
||||||
@Schema(description = "税率")
|
@Schema(description = "税率")
|
||||||
private Integer taxRate;
|
private String taxRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,55 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.dal.dataobject.matcode;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料大类编码维护 DO
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@TableName("base_mat_code")
|
||||||
|
@KeySequence("base_mat_code_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class MatCodeDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自增字段,唯一
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 物料大类编码
|
||||||
|
*/
|
||||||
|
private String matCatCode;
|
||||||
|
/**
|
||||||
|
* 物料物料大类名称
|
||||||
|
*/
|
||||||
|
private String matCatName;
|
||||||
|
/**
|
||||||
|
* 物料分类编码
|
||||||
|
*/
|
||||||
|
private String matTypeCode;
|
||||||
|
/**
|
||||||
|
* 当前最大流水号
|
||||||
|
*/
|
||||||
|
private String curMaxSeq;
|
||||||
|
/**
|
||||||
|
* 状态,1表示正常,2表示禁用
|
||||||
|
*/
|
||||||
|
private Boolean status;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String creatorName;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,9 +1,7 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.dal.dataobject.supplier;
|
package com.chanko.yunxi.mes.module.heli.dal.dataobject.supplier;
|
||||||
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO;
|
import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
@ -153,6 +151,7 @@ public class SupplierDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
private String taxNo;
|
private String taxNo;
|
||||||
|
|
||||||
private Integer taxRate;
|
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||||
|
private String taxRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,31 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.dal.mysql.matcode;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.controller.admin.matcode.vo.MatCodePageReqVO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.matcode.MatCodeDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料大类编码维护 Mapper
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface MatCodeMapper extends BaseMapperX<MatCodeDO> {
|
||||||
|
|
||||||
|
default PageResult<MatCodeDO> selectPage(MatCodePageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<MatCodeDO>()
|
||||||
|
.eqIfPresent(MatCodeDO::getMatCatCode, reqVO.getMatCatCode())
|
||||||
|
.likeIfPresent(MatCodeDO::getMatCatName, reqVO.getMatCatName())
|
||||||
|
.eqIfPresent(MatCodeDO::getMatTypeCode, reqVO.getMatTypeCode())
|
||||||
|
.eqIfPresent(MatCodeDO::getCurMaxSeq, reqVO.getCurMaxSeq())
|
||||||
|
.eqIfPresent(MatCodeDO::getStatus, reqVO.getStatus())
|
||||||
|
.betweenIfPresent(MatCodeDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(MatCodeDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.service.matcode;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.controller.admin.matcode.vo.MatCodePageReqVO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.controller.admin.matcode.vo.MatCodeRespVO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.controller.admin.matcode.vo.MatCodeSaveReqVO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.matcode.MatCodeDO;
|
||||||
|
|
||||||
|
import javax.validation.*;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料大类编码维护 Service 接口
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
public interface MatCodeService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建物料大类编码维护
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createMatCode(@Valid MatCodeSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新物料大类编码维护
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateMatCode(@Valid MatCodeSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除物料大类编码维护
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteMatCode(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得物料大类编码维护
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 物料大类编码维护
|
||||||
|
*/
|
||||||
|
MatCodeDO getMatCode(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得物料大类编码维护分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 物料大类编码维护分页
|
||||||
|
*/
|
||||||
|
PageResult<MatCodeDO> getMatCodePage(MatCodePageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,85 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.heli.service.matcode;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.controller.admin.matcode.vo.MatCodePageReqVO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.controller.admin.matcode.vo.MatCodeSaveReqVO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.matcode.MatCodeDO;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.matcode.MatCodeMapper;
|
||||||
|
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
|
import com.chanko.yunxi.mes.module.system.dal.mysql.user.AdminUserMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.MAT_CODE_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料大类编码维护 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class MatCodeServiceImpl implements MatCodeService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MatCodeMapper matCodeMapper;
|
||||||
|
@Resource
|
||||||
|
private AdminUserMapper userMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createMatCode(MatCodeSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
MatCodeDO matCode = BeanUtils.toBean(createReqVO, MatCodeDO.class);
|
||||||
|
matCodeMapper.insert(matCode);
|
||||||
|
// 返回
|
||||||
|
return matCode.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateMatCode(MatCodeSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateMatCodeExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
MatCodeDO updateObj = BeanUtils.toBean(updateReqVO, MatCodeDO.class);
|
||||||
|
matCodeMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteMatCode(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateMatCodeExists(id);
|
||||||
|
// 删除
|
||||||
|
matCodeMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateMatCodeExists(Long id) {
|
||||||
|
if (matCodeMapper.selectById(id) == null) {
|
||||||
|
throw exception(MAT_CODE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MatCodeDO getMatCode(Long id) {
|
||||||
|
return matCodeMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<MatCodeDO> getMatCodePage(MatCodePageReqVO pageReqVO) {
|
||||||
|
PageResult<MatCodeDO> matCodeDOPageResult = matCodeMapper.selectPage(pageReqVO);
|
||||||
|
// 查询创建人,根据creator字段,查询用户信息
|
||||||
|
matCodeDOPageResult.getList().forEach(matCodeDO -> {
|
||||||
|
if (matCodeDO.getCreator() != null) {
|
||||||
|
AdminUserDO user = userMapper.selectById(matCodeDO.getCreator());
|
||||||
|
if (user != null) {
|
||||||
|
matCodeDO.setCreatorName(user.getUsername());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return matCodeDOPageResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.chanko.yunxi.mes.module.base.dal.mysql.matcode.MatCodeMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
40
mes-ui/mes-ui-admin-vue3/src/api/heli/matcode/index.ts
Normal file
40
mes-ui/mes-ui-admin-vue3/src/api/heli/matcode/index.ts
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
export interface MatCodeVO {
|
||||||
|
id: number
|
||||||
|
matCatCode: string
|
||||||
|
matCatName: string
|
||||||
|
matTypeCode: string
|
||||||
|
curMaxSeq: string
|
||||||
|
status: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询物料大类编码维护分页
|
||||||
|
export const getMatCodePage = async (params) => {
|
||||||
|
return await request.get({ url: `/heli/matcode/page`, params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询物料大类编码维护详情
|
||||||
|
export const getMatCode = async (id: number) => {
|
||||||
|
return await request.get({ url: `/heli/matcode/get?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增物料大类编码维护
|
||||||
|
export const createMatCode = async (data: MatCodeVO) => {
|
||||||
|
return await request.post({ url: `/heli/matcode/create`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改物料大类编码维护
|
||||||
|
export const updateMatCode = async (data: MatCodeVO) => {
|
||||||
|
return await request.put({ url: `/heli/matcode/update`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除物料大类编码维护
|
||||||
|
export const deleteMatCode = async (id: number) => {
|
||||||
|
return await request.delete({ url: `/heli/matcode/delete?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出物料大类编码维护 Excel
|
||||||
|
export const exportMatCode = async (params) => {
|
||||||
|
return await request.download({ url: `/heli/matcode/export-excel`, params })
|
||||||
|
}
|
||||||
@ -8,6 +8,7 @@ export interface SupplierVO {
|
|||||||
industry: string
|
industry: string
|
||||||
level: number
|
level: number
|
||||||
category: number
|
category: number
|
||||||
|
taxRate: number
|
||||||
userId: number
|
userId: number
|
||||||
description: string
|
description: string
|
||||||
contact1Name: string
|
contact1Name: string
|
||||||
|
|||||||
@ -215,6 +215,8 @@ export enum DICT_TYPE {
|
|||||||
HELI_SUPPLIER_CATEGORY = 'heli_supplier_category', //供应商分类
|
HELI_SUPPLIER_CATEGORY = 'heli_supplier_category', //供应商分类
|
||||||
HELI_MATERIAL_TYPE = 'heli_material_type', // 物料类型
|
HELI_MATERIAL_TYPE = 'heli_material_type', // 物料类型
|
||||||
HELI_MATERIAL_UNIT = 'heli_material_unit', // 物料单位
|
HELI_MATERIAL_UNIT = 'heli_material_unit', // 物料单位
|
||||||
|
HELI_MATERIAL_CODE = 'heli_mat_code', // 物料单位
|
||||||
|
|
||||||
HELI_MATERIAL_ORIGINAL = 'heli_material_original', // 物料主要来源
|
HELI_MATERIAL_ORIGINAL = 'heli_material_original', // 物料主要来源
|
||||||
HELE_BOM_EDIT_STATUS = 'heli_bom_edit_status', // 物料主要来源
|
HELE_BOM_EDIT_STATUS = 'heli_bom_edit_status', // 物料主要来源
|
||||||
HELI_COMMON_IS_OR_NOT = 'heli_common_is_or_not', // 是否数字类型
|
HELI_COMMON_IS_OR_NOT = 'heli_common_is_or_not', // 是否数字类型
|
||||||
|
|||||||
135
mes-ui/mes-ui-admin-vue3/src/views/heli/matcode/MatCodeForm.vue
Normal file
135
mes-ui/mes-ui-admin-vue3/src/views/heli/matcode/MatCodeForm.vue
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||||
|
<el-form
|
||||||
|
width="400px"
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="180px"
|
||||||
|
v-loading="formLoading"
|
||||||
|
>
|
||||||
|
<el-form-item label="物料大类" prop="matCatCode">
|
||||||
|
<el-select v-model="formData.matCatCode" clearable placeholder="请选择物料大类" @change="handleMatCatChange">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.HELI_MATERIAL_CODE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料分类编码" prop="matTypeCode" >
|
||||||
|
<el-input v-model="formData.matTypeCode" placeholder="请输入物料分类编码" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="最大流水号" prop="curMaxSeq" >
|
||||||
|
<el-input v-model="formData.curMaxSeq" placeholder="请输入当前最大流水号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-radio-group v-model="formData.status">
|
||||||
|
<el-radio :label=true >启用</el-radio>
|
||||||
|
<el-radio :label=false>禁用</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import * as MatCodeApi from '@/api/heli/matcode'
|
||||||
|
import {DICT_TYPE, getStrDictOptions} from "@/utils/dict";
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const formData = ref({
|
||||||
|
id: undefined,
|
||||||
|
matCatCode: undefined,
|
||||||
|
matCatName: undefined,
|
||||||
|
matTypeCode: undefined,
|
||||||
|
curMaxSeq: undefined,
|
||||||
|
status: true,
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
matCatCode: [{ required: true, message: '物料大类不能为空', trigger: 'blur' }],
|
||||||
|
matTypeCode: [{ required: true, message: '物料分类编码不能为空', trigger: 'blur' }],
|
||||||
|
curMaxSeq: [{ required: true, message: '最大流水号不能为空', trigger: 'blur' }],
|
||||||
|
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type: string, id?: number) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = t('action.' + type)
|
||||||
|
formType.value = type
|
||||||
|
resetForm()
|
||||||
|
// 修改时,设置数据
|
||||||
|
if (id) {
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await MatCodeApi.getMatCode(id)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
const submitForm = async () => {
|
||||||
|
// 校验表单
|
||||||
|
await formRef.value.validate()
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
const data = formData.value as unknown as MatCodeApi.MatCodeVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await MatCodeApi.createMatCode(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await MatCodeApi.updateMatCode(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
matCatCode: undefined,
|
||||||
|
matCatName: undefined,
|
||||||
|
matTypeCode: undefined,
|
||||||
|
curMaxSeq: undefined,
|
||||||
|
status: true,
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 物料大类选择变化 */
|
||||||
|
const handleMatCatChange = (value) => {
|
||||||
|
if (!value) {
|
||||||
|
formData.value.matCatName = undefined
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const dictOptions = getStrDictOptions(DICT_TYPE.HELI_MATERIAL_CODE)
|
||||||
|
const selected = dictOptions.find(dict => dict.value === value)
|
||||||
|
if (selected) {
|
||||||
|
formData.value.matCatCode = selected.value
|
||||||
|
formData.value.matCatName = selected.label
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
204
mes-ui/mes-ui-admin-vue3/src/views/heli/matcode/index.vue
Normal file
204
mes-ui/mes-ui-admin-vue3/src/views/heli/matcode/index.vue
Normal file
@ -0,0 +1,204 @@
|
|||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="80px"
|
||||||
|
>
|
||||||
|
<el-form-item label="编码" prop="matCatCode">
|
||||||
|
<el-select v-model="queryParams.matCatCode" clearable placeholder="请选择物料大类" class="!w-250px">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.HELI_MATERIAL_CODE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.status"
|
||||||
|
placeholder="请选择状态"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="启用" :value="true" />
|
||||||
|
<el-option label="禁用" :value="false" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||||
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
@click="openForm('create')"
|
||||||
|
v-hasPermi="['heli:mat-code:create']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button>
|
||||||
|
<!-- <el-button-->
|
||||||
|
<!-- type="success"-->
|
||||||
|
<!-- plain-->
|
||||||
|
<!-- @click="handleExport"-->
|
||||||
|
<!-- :loading="exportLoading"-->
|
||||||
|
<!-- v-hasPermi="['heli:mat-code:export']"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <Icon icon="ep:download" class="mr-5px" /> 导出-->
|
||||||
|
<!-- </el-button>-->
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
|
<el-table-column label="序号" type="index" align="center" width="60px"/>
|
||||||
|
<el-table-column label="物料大类编码" align="center" prop="matCatCode" />
|
||||||
|
<el-table-column label="物料大类名称" align="center" prop="matCatName" />
|
||||||
|
<el-table-column label="物料分类编码" align="center" prop="matTypeCode" />
|
||||||
|
<el-table-column label="当前最大编码" align="center" prop="curMaxSeq" />
|
||||||
|
<el-table-column label="启用状态" align="center" prop="status" width="100px">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tag :type="scope.row.status === true ? 'success' : 'danger'">
|
||||||
|
{{ scope.row.status === true ? '启用' : '禁用' }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="200px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="创建人" align="center" prop="creatorName" />
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['heli:mat-code:update']"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['heli:mat-code:delete']"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<MatCodeForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import * as MatCodeApi from '@/api/heli/matcode'
|
||||||
|
import MatCodeForm from './MatCodeForm.vue'
|
||||||
|
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
|
||||||
|
defineOptions({ name: 'MatCode' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
matCatCode: undefined,
|
||||||
|
matCatName: undefined,
|
||||||
|
matTypeCode: undefined,
|
||||||
|
curMaxSeq: undefined,
|
||||||
|
status: undefined,
|
||||||
|
createTime: [],
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await MatCodeApi.getMatCodePage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value.resetFields()
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 添加/修改操作 */
|
||||||
|
const formRef = ref()
|
||||||
|
const openForm = (type: string, id?: number) => {
|
||||||
|
formRef.value.open(type, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await MatCodeApi.deleteMatCode(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await MatCodeApi.exportMatCode(queryParams)
|
||||||
|
download.excel(data, '物料大类编码维护.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@ -36,6 +36,16 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="物料大类" prop="matCate">
|
||||||
|
<el-select v-model="formData.matCate" clearable placeholder="请选择物料大类" class="!w-250px">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.HELI_MATERIAL_CODE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="物料简称" prop="shortName">
|
<el-form-item label="物料简称" prop="shortName">
|
||||||
<el-input v-model="formData.shortName" placeholder="请输入物料简称" class="!w-250px" />
|
<el-input v-model="formData.shortName" placeholder="请输入物料简称" class="!w-250px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -143,6 +153,7 @@ const formData = ref({
|
|||||||
mainSupplierId: undefined,
|
mainSupplierId: undefined,
|
||||||
mainFrom: undefined,
|
mainFrom: undefined,
|
||||||
unit: undefined,
|
unit: undefined,
|
||||||
|
matCate: undefined,
|
||||||
invSafe: undefined,
|
invSafe: undefined,
|
||||||
invUpperLimit: undefined,
|
invUpperLimit: undefined,
|
||||||
invLowerLimit: undefined,
|
invLowerLimit: undefined,
|
||||||
@ -250,6 +261,7 @@ const resetForm = () => {
|
|||||||
mainSupplierId: undefined,
|
mainSupplierId: undefined,
|
||||||
mainFrom: undefined,
|
mainFrom: undefined,
|
||||||
unit: undefined,
|
unit: undefined,
|
||||||
|
matCate: undefined,
|
||||||
invSafe: undefined,
|
invSafe: undefined,
|
||||||
invUpperLimit: undefined,
|
invUpperLimit: undefined,
|
||||||
invLowerLimit: undefined,
|
invLowerLimit: undefined,
|
||||||
|
|||||||
@ -92,12 +92,12 @@ v-model="formData.whId" placeholder="下拉选择" clearable class="!w-400px" @c
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="4">
|
<el-col :span="2">
|
||||||
<el-form-item label="即入即出" prop="inOutFlag">
|
<el-form-item label="即入即出" prop="inOutFlag">
|
||||||
<el-switch v-model="formData.inOutFlag" :disabled="ctrView || ctrSave" />
|
<el-switch v-model="formData.inOutFlag" :disabled="ctrView || ctrSave" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<el-col :span="6">
|
||||||
<el-form-item label="供应商" prop="supplierId">
|
<el-form-item label="供应商" prop="supplierId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="formData.supplierId"
|
v-model="formData.supplierId"
|
||||||
@ -116,7 +116,7 @@ v-model="formData.whId" placeholder="下拉选择" clearable class="!w-400px" @c
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="15">
|
<el-col :span="14">
|
||||||
<el-form-item label="备注" prop="description">
|
<el-form-item label="备注" prop="description">
|
||||||
<el-input
|
<el-input
|
||||||
type="textarea" v-model="formData.description" show-word-limit maxlength="200"
|
type="textarea" v-model="formData.description" show-word-limit maxlength="200"
|
||||||
@ -991,6 +991,9 @@ const handleStatus = async (num) => {
|
|||||||
const enableHeadNo = ref(false)
|
const enableHeadNo = ref(false)
|
||||||
const handleStockType = async (typeid) => {
|
const handleStockType = async (typeid) => {
|
||||||
formData.value.headerNo = ''
|
formData.value.headerNo = ''
|
||||||
|
formData.value.headerId = undefined
|
||||||
|
// 清空供应商信息
|
||||||
|
formData.value.supplierId = undefined
|
||||||
if (typeid == 1) {
|
if (typeid == 1) {
|
||||||
enableHeadNo.value = false
|
enableHeadNo.value = false
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -327,7 +327,7 @@ const formData = ref({
|
|||||||
industry: undefined,
|
industry: undefined,
|
||||||
level: undefined,
|
level: undefined,
|
||||||
category: undefined,
|
category: undefined,
|
||||||
taxRate: undefined,
|
taxRate: null,
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
description: undefined,
|
description: undefined,
|
||||||
contact1Name: undefined,
|
contact1Name: undefined,
|
||||||
@ -358,6 +358,24 @@ const formRules = reactive({
|
|||||||
brief: [{ required: true, message: '供应商简称不能为空', trigger: 'blur' }],
|
brief: [{ required: true, message: '供应商简称不能为空', trigger: 'blur' }],
|
||||||
name: [{ required: true, message: '供应商全称不能为空', trigger: 'blur' }],
|
name: [{ required: true, message: '供应商全称不能为空', trigger: 'blur' }],
|
||||||
// status: [{ required: true, message: '状态,1 表示正常,2 表示禁用不能为空', trigger: 'blur' }],
|
// status: [{ required: true, message: '状态,1 表示正常,2 表示禁用不能为空', trigger: 'blur' }],
|
||||||
|
taxRate: [
|
||||||
|
{
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
if (value === '' || value === null || value === undefined) {
|
||||||
|
callback()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 验证格式:最大三位整数,最多1位小数
|
||||||
|
const regex = /^(?!0\d)\d{0,2}(\.\d{0,1})?$/
|
||||||
|
if (!regex.test(value)) {
|
||||||
|
callback(new Error('输入税率格式不正确,请确认!'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
|
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||||
@ -397,6 +415,11 @@ const submitForm = async () => {
|
|||||||
try {
|
try {
|
||||||
const data = formData.value as unknown as SupplierApi.SupplierVO
|
const data = formData.value as unknown as SupplierApi.SupplierVO
|
||||||
|
|
||||||
|
// 如果税率为空字符串,转换为 null
|
||||||
|
if (data.taxRate === '') {
|
||||||
|
data.taxRate = null
|
||||||
|
}
|
||||||
|
|
||||||
if (formType.value === 'create') {
|
if (formType.value === 'create') {
|
||||||
await SupplierApi.createSupplier(data)
|
await SupplierApi.createSupplier(data)
|
||||||
message.success(t('common.createSuccess'))
|
message.success(t('common.createSuccess'))
|
||||||
@ -422,6 +445,7 @@ const resetForm = () => {
|
|||||||
industry: undefined,
|
industry: undefined,
|
||||||
level: undefined,
|
level: undefined,
|
||||||
category: undefined,
|
category: undefined,
|
||||||
|
taxRate: null,
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
description: undefined,
|
description: undefined,
|
||||||
contact1Name: undefined,
|
contact1Name: undefined,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user