在制品库配置页面
This commit is contained in:
parent
d00b89ac47
commit
71c1f92dc7
@ -1,5 +1,7 @@
|
|||||||
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.storearea;
|
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.storearea;
|
||||||
|
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.storehouse.vo.StoreHouseRespVO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.storehouse.StoreHouseDO;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -91,5 +93,12 @@ public class StoreAreaController {
|
|||||||
ExcelUtils.write(response, "库区主数据.xls", "数据", StoreAreaRespVO.class,
|
ExcelUtils.write(response, "库区主数据.xls", "数据", StoreAreaRespVO.class,
|
||||||
BeanUtils.toBean(list, StoreAreaRespVO.class));
|
BeanUtils.toBean(list, StoreAreaRespVO.class));
|
||||||
}
|
}
|
||||||
|
@GetMapping("/get-store-area-select")
|
||||||
|
@Operation(summary = "获得仓储下拉框数据")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:store-house:query')")
|
||||||
|
public CommonResult<List<StoreAreaRespVO>> getStoreAreaSelect(@RequestParam("storeHouseId") Integer storeHouseId) {
|
||||||
|
List<StoreAreaDO> list = storeAreaService.getStoreAreaSelect(storeHouseId);
|
||||||
|
return success(BeanUtils.toBean(list, StoreAreaRespVO.class));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,97 @@
|
|||||||
|
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfig;
|
||||||
|
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfig.vo.WipConfigPageReqVO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfig.vo.WipConfigRespVO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfig.vo.WipConfigSaveReqVO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.wipconfig.WipConfigDO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.service.wipconfig.WipConfigService;
|
||||||
|
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.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 在制品库配置")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/tba/wip-config")
|
||||||
|
@Validated
|
||||||
|
public class WipConfigController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WipConfigService wipConfigService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建在制品库配置")
|
||||||
|
@PreAuthorize("@ss.hasPermission('tba:wip-config:create')")
|
||||||
|
public CommonResult<Integer> createWipConfig(@Valid @RequestBody WipConfigSaveReqVO createReqVO) {
|
||||||
|
return success(wipConfigService.createWipConfig(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新在制品库配置")
|
||||||
|
@PreAuthorize("@ss.hasPermission('tba:wip-config:update')")
|
||||||
|
public CommonResult<Boolean> updateWipConfig(@Valid @RequestBody WipConfigSaveReqVO updateReqVO) {
|
||||||
|
wipConfigService.updateWipConfig(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除在制品库配置")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('tba:wip-config:delete')")
|
||||||
|
public CommonResult<Boolean> deleteWipConfig(@RequestParam("id") Integer id) {
|
||||||
|
wipConfigService.deleteWipConfig(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得在制品库配置")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('tba:wip-config:query')")
|
||||||
|
public CommonResult<WipConfigRespVO> getWipConfig(@RequestParam("id") Integer id) {
|
||||||
|
WipConfigDO wipConfig = wipConfigService.getWipConfig(id);
|
||||||
|
return success(BeanUtils.toBean(wipConfig, WipConfigRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得在制品库配置分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('tba:wip-config:query')")
|
||||||
|
public CommonResult<PageResult<WipConfigRespVO>> getWipConfigPage(@Valid WipConfigPageReqVO pageReqVO) {
|
||||||
|
PageResult<WipConfigDO> pageResult = wipConfigService.getWipConfigPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, WipConfigRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出在制品库配置 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('tba:wip-config:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportWipConfigExcel(@Valid WipConfigPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<WipConfigDO> list = wipConfigService.getWipConfigPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "在制品库配置.xls", "数据", WipConfigRespVO.class,
|
||||||
|
BeanUtils.toBean(list, WipConfigRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfig.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.ningxia.yunxi.chemmes.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 WipConfigPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "创建人", example = "13258")
|
||||||
|
private String fCreatorUserId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
@Schema(description = "库区编码")
|
||||||
|
private String storeAreCd;
|
||||||
|
|
||||||
|
@Schema(description = "库区名称", example = "王五")
|
||||||
|
private String storeAreaName;
|
||||||
|
|
||||||
|
@Schema(description = "状态(1启用 2 未启用)", example = "2")
|
||||||
|
private Integer enabledStatus;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你猜")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "仓库id", example = "24299")
|
||||||
|
private Integer storeHouseId;
|
||||||
|
|
||||||
|
@Schema(description = "库区id", example = "32628")
|
||||||
|
private String storeAreaId;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfig.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 WipConfigRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "27276")
|
||||||
|
@ExcelProperty("自增字段")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "创建人", example = "13258")
|
||||||
|
@ExcelProperty("创建人")
|
||||||
|
private String fCreatorUserId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "库区编码")
|
||||||
|
@ExcelProperty("库区编码")
|
||||||
|
private String storeAreCd;
|
||||||
|
|
||||||
|
@Schema(description = "库区名称", example = "王五")
|
||||||
|
@ExcelProperty("库区名称")
|
||||||
|
private String storeAreaName;
|
||||||
|
|
||||||
|
@Schema(description = "状态(1启用 2 未启用)", example = "2")
|
||||||
|
@ExcelProperty("状态(1启用 2 未启用)")
|
||||||
|
private Integer enabledStatus;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你猜")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "仓库id", example = "24299")
|
||||||
|
@ExcelProperty("仓库id")
|
||||||
|
private Integer storeHouseId;
|
||||||
|
|
||||||
|
@Schema(description = "库区id", example = "32628")
|
||||||
|
@ExcelProperty("库区id")
|
||||||
|
private Integer storeAreaId;
|
||||||
|
private String storeHouseName;
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfig.vo;
|
||||||
|
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.wipconfigdetail.WipConfigDetailDO;
|
||||||
|
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 WipConfigSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "27276")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "创建人", example = "13258")
|
||||||
|
private String fCreatorUserId;
|
||||||
|
|
||||||
|
@Schema(description = "库区编码")
|
||||||
|
private String storeAreCd;
|
||||||
|
|
||||||
|
@Schema(description = "库区名称", example = "王五")
|
||||||
|
private String storeAreaName;
|
||||||
|
|
||||||
|
@Schema(description = "状态(1启用 2 未启用)", example = "2")
|
||||||
|
private Integer enabledStatus;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你猜")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "仓库id", example = "24299")
|
||||||
|
private Integer storeHouseId;
|
||||||
|
|
||||||
|
@Schema(description = "库区id", example = "32628")
|
||||||
|
private String storeAreaId;
|
||||||
|
private List<WipConfigDetailDO> wipConfigDetailList;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,105 @@
|
|||||||
|
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfigdetail;
|
||||||
|
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfigdetail.vo.WipConfigDetailPageReqVO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfigdetail.vo.WipConfigDetailRespVO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfigdetail.vo.WipConfigDetailSaveReqVO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.wipconfigdetail.WipConfigDetailDO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.service.wipconfigdetail.WipConfigDetailService;
|
||||||
|
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.constraints.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 在制品库配置子")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/tba/wip-config-detail")
|
||||||
|
@Validated
|
||||||
|
public class WipConfigDetailController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WipConfigDetailService wipConfigDetailService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建在制品库配置子")
|
||||||
|
@PreAuthorize("@ss.hasPermission('tba:wip-config-detail:create')")
|
||||||
|
public CommonResult<Integer> createWipConfigDetail(@Valid @RequestBody WipConfigDetailSaveReqVO createReqVO) {
|
||||||
|
return success(wipConfigDetailService.createWipConfigDetail(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新在制品库配置子")
|
||||||
|
@PreAuthorize("@ss.hasPermission('tba:wip-config-detail:update')")
|
||||||
|
public CommonResult<Boolean> updateWipConfigDetail(@Valid @RequestBody WipConfigDetailSaveReqVO updateReqVO) {
|
||||||
|
wipConfigDetailService.updateWipConfigDetail(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除在制品库配置子")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('tba:wip-config-detail:delete')")
|
||||||
|
public CommonResult<Boolean> deleteWipConfigDetail(@RequestParam("id") Integer id) {
|
||||||
|
wipConfigDetailService.deleteWipConfigDetail(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得在制品库配置子")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('tba:wip-config-detail:query')")
|
||||||
|
public CommonResult<WipConfigDetailRespVO> getWipConfigDetail(@RequestParam("id") Integer id) {
|
||||||
|
WipConfigDetailDO wipConfigDetail = wipConfigDetailService.getWipConfigDetail(id);
|
||||||
|
return success(BeanUtils.toBean(wipConfigDetail, WipConfigDetailRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得在制品库配置子分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('tba:wip-config-detail:query')")
|
||||||
|
public CommonResult<PageResult<WipConfigDetailRespVO>> getWipConfigDetailPage(@Valid WipConfigDetailPageReqVO pageReqVO) {
|
||||||
|
PageResult<WipConfigDetailDO> pageResult = wipConfigDetailService.getWipConfigDetailPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, WipConfigDetailRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出在制品库配置子 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('tba:wip-config-detail:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportWipConfigDetailExcel(@Valid WipConfigDetailPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<WipConfigDetailDO> list = wipConfigDetailService.getWipConfigDetailPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "在制品库配置子.xls", "数据", WipConfigDetailRespVO.class,
|
||||||
|
BeanUtils.toBean(list, WipConfigDetailRespVO.class));
|
||||||
|
}
|
||||||
|
@GetMapping("/getWipConfigDetailList")
|
||||||
|
@Operation(summary = "获得在制品库配置子")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('tba:wip-config-detail:query')")
|
||||||
|
public CommonResult<List<WipConfigDetailDO>> getWipConfigDetailList(@RequestParam("wipConfigId") Integer wipConfigId) {
|
||||||
|
return success(wipConfigDetailService.getWipConfigDetailList(wipConfigId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfigdetail.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.ningxia.yunxi.chemmes.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 WipConfigDetailPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "创建人", example = "19670")
|
||||||
|
private String fCreatorUserId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
@Schema(description = "状态(1启用 2 未启用)", example = "2")
|
||||||
|
private Integer enabledStatus;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你说的对")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "主表id", example = "3763")
|
||||||
|
private Integer wipConfigId;
|
||||||
|
|
||||||
|
@Schema(description = "保管类型(1 工序 2 机台)", example = "1")
|
||||||
|
private String keepType;
|
||||||
|
|
||||||
|
@Schema(description = "保管单位")
|
||||||
|
private String keepCode;
|
||||||
|
|
||||||
|
@Schema(description = "保管标识(1 入库 2 出库 3 入/出库)")
|
||||||
|
private String keepMark;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfigdetail.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 WipConfigDetailRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "10705")
|
||||||
|
@ExcelProperty("自增字段")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "创建人", example = "19670")
|
||||||
|
@ExcelProperty("创建人")
|
||||||
|
private String fCreatorUserId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "状态(1启用 2 未启用)", example = "2")
|
||||||
|
@ExcelProperty("状态(1启用 2 未启用)")
|
||||||
|
private Integer enabledStatus;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你说的对")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "主表id", example = "3763")
|
||||||
|
@ExcelProperty("主表id")
|
||||||
|
private Integer wipConfigId;
|
||||||
|
|
||||||
|
@Schema(description = "保管类型(1 工序 2 机台)", example = "1")
|
||||||
|
@ExcelProperty("保管类型(1 工序 2 机台)")
|
||||||
|
private String keepType;
|
||||||
|
|
||||||
|
@Schema(description = "保管单位")
|
||||||
|
@ExcelProperty("保管单位")
|
||||||
|
private String keepCode;
|
||||||
|
|
||||||
|
@Schema(description = "保管标识(1 入库 2 出库 3 入/出库)")
|
||||||
|
@ExcelProperty("保管标识(1 入库 2 出库 3 入/出库)")
|
||||||
|
private String keepMark;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfigdetail.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 WipConfigDetailSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "10705")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "创建人", example = "19670")
|
||||||
|
private String fCreatorUserId;
|
||||||
|
|
||||||
|
@Schema(description = "状态(1启用 2 未启用)", example = "2")
|
||||||
|
private Integer enabledStatus;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "你说的对")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "主表id", example = "3763")
|
||||||
|
private Integer wipConfigId;
|
||||||
|
|
||||||
|
@Schema(description = "保管类型(1 工序 2 机台)", example = "1")
|
||||||
|
private String keepType;
|
||||||
|
|
||||||
|
@Schema(description = "保管单位")
|
||||||
|
private String keepCode;
|
||||||
|
|
||||||
|
@Schema(description = "保管标识(1 入库 2 出库 3 入/出库)")
|
||||||
|
private String keepMark;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,60 @@
|
|||||||
|
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.wipconfig;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
import static org.aspectj.lang.reflect.DeclareAnnotation.Kind.Field;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在制品库配置 DO
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@TableName("tba_wip_config")
|
||||||
|
@KeySequence("tba_wip_config_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class WipConfigDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自增字段
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Integer id;
|
||||||
|
/**
|
||||||
|
* 库区编码
|
||||||
|
*/
|
||||||
|
private String storeAreCd;
|
||||||
|
/**
|
||||||
|
* 库区名称
|
||||||
|
*/
|
||||||
|
private String storeAreaName;
|
||||||
|
/**
|
||||||
|
* 状态(1启用 2 未启用)
|
||||||
|
*/
|
||||||
|
private Integer enabledStatus;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 仓库id
|
||||||
|
*/
|
||||||
|
private Integer storeHouseId;
|
||||||
|
/**
|
||||||
|
* 库区id
|
||||||
|
*/
|
||||||
|
private Integer storeAreaId;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String storeHouseName;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.wipconfigdetail;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在制品库配置子 DO
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@TableName("tba_wip_config_detail")
|
||||||
|
@KeySequence("tba_wip_config_detail_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class WipConfigDetailDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自增字段
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(1启用 2 未启用)
|
||||||
|
*/
|
||||||
|
private Integer enabledStatus;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 主表id
|
||||||
|
*/
|
||||||
|
private Integer wipConfigId;
|
||||||
|
/**
|
||||||
|
* 保管类型(1 工序 2 机台)
|
||||||
|
*/
|
||||||
|
private String keepType;
|
||||||
|
/**
|
||||||
|
* 保管单位
|
||||||
|
*/
|
||||||
|
private String keepCode;
|
||||||
|
/**
|
||||||
|
* 保管标识(1 入库 2 出库 3 入/出库)
|
||||||
|
*/
|
||||||
|
private String keepMark;
|
||||||
|
|
||||||
|
}
|
||||||
@ -35,6 +35,19 @@ public interface CheckItemMapper extends BaseMapperX<CheckItemDO> {
|
|||||||
.ne(excludeId != null, CheckItemDO::getId, excludeId));
|
.ne(excludeId != null, CheckItemDO::getId, excludeId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据检验项编号统计数量(用于编号重复校验)
|
||||||
|
*
|
||||||
|
* @param itemNo 检验项编号
|
||||||
|
* @param excludeId 排除的ID(更新时使用)
|
||||||
|
* @return 符合条件的记录数
|
||||||
|
*/
|
||||||
|
default Long selectCountByItemNo(String itemNo, Integer excludeId) {
|
||||||
|
return selectCount(new LambdaQueryWrapperX<CheckItemDO>()
|
||||||
|
.eq(CheckItemDO::getItemNo, itemNo)
|
||||||
|
.ne(excludeId != null, CheckItemDO::getId, excludeId));
|
||||||
|
}
|
||||||
|
|
||||||
default PageResult<CheckItemDO> selectPage(CheckItemPageReqVO reqVO) {
|
default PageResult<CheckItemDO> selectPage(CheckItemPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<CheckItemDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<CheckItemDO>()
|
||||||
.likeIfPresent(CheckItemDO::getItemName, reqVO.getItemName())
|
.likeIfPresent(CheckItemDO::getItemName, reqVO.getItemName())
|
||||||
|
|||||||
@ -46,6 +46,7 @@ public interface ProcMapper extends BaseMapperX<ProcDO> {
|
|||||||
.select("u.nickname as creatorName")
|
.select("u.nickname as creatorName")
|
||||||
.leftJoin(AdminUserDO.class,"u",AdminUserDO::getId,ProcDO::getCreator)
|
.leftJoin(AdminUserDO.class,"u",AdminUserDO::getId,ProcDO::getCreator)
|
||||||
.eq(ProcDO::getEnabledStatus, 0)
|
.eq(ProcDO::getEnabledStatus, 0)
|
||||||
|
.disableSubLogicDel()
|
||||||
.orderByAsc(ProcDO::getProcCd);
|
.orderByAsc(ProcDO::getProcCd);
|
||||||
return selectList(query);
|
return selectList(query);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,4 +36,10 @@ public interface StoreAreaMapper extends BaseMapperX<StoreAreaDO> {
|
|||||||
return selectCount(new LambdaQueryWrapperX<StoreAreaDO>()
|
return selectCount(new LambdaQueryWrapperX<StoreAreaDO>()
|
||||||
.eq(StoreAreaDO::getStoreAreCd, storeAreCd).ne(ObjectUtil.isNotEmpty(id),StoreAreaDO::getId,id));
|
.eq(StoreAreaDO::getStoreAreCd, storeAreCd).ne(ObjectUtil.isNotEmpty(id),StoreAreaDO::getId,id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<StoreAreaDO> getStoreAreaSelect(Integer storeHouseId){
|
||||||
|
return selectList(new LambdaQueryWrapperX<StoreAreaDO>()
|
||||||
|
.eq(StoreAreaDO::getEnabledStatus, 0).eq(StoreAreaDO::getStoreHouseId, storeHouseId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,40 @@
|
|||||||
|
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.wipconfig;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfig.vo.WipConfigPageReqVO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.storehouse.StoreHouseDO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.techproc.TechProcDO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.wipconfig.WipConfigDO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在制品库配置 Mapper
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface WipConfigMapper extends BaseMapperX<WipConfigDO> {
|
||||||
|
|
||||||
|
default PageResult<WipConfigDO> selectPage(WipConfigPageReqVO reqVO) {
|
||||||
|
MPJLambdaWrapper<WipConfigDO> query = new MPJLambdaWrapper<>();
|
||||||
|
query.selectAll(WipConfigDO.class)
|
||||||
|
.select("s.store_house_name as storeHouseName")
|
||||||
|
.leftJoin(StoreHouseDO.class, "s",StoreHouseDO::getId,WipConfigDO::getStoreHouseId)
|
||||||
|
.disableSubLogicDel()
|
||||||
|
.orderByDesc(WipConfigDO::getCreateTime);
|
||||||
|
;
|
||||||
|
query.eq(ObjectUtil.isNotEmpty(reqVO.getEnabledStatus()),WipConfigDO::getEnabledStatus,reqVO.getEnabledStatus())
|
||||||
|
.eq(ObjectUtil.isNotEmpty(reqVO.getStoreHouseId()),WipConfigDO::getStoreHouseId,reqVO.getStoreHouseId())
|
||||||
|
.like(ObjectUtil.isNotEmpty(reqVO.getStoreAreaName()),WipConfigDO::getStoreAreaName,reqVO.getStoreAreaName());
|
||||||
|
return selectPage(reqVO, query);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.wipconfigdetail;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfigdetail.vo.WipConfigDetailPageReqVO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.wipconfigdetail.WipConfigDetailDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在制品库配置子 Mapper
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface WipConfigDetailMapper extends BaseMapperX<WipConfigDetailDO> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据主表ID删除子表数据
|
||||||
|
*/
|
||||||
|
default int deleteByWipConfigId(Integer wipConfigId) {
|
||||||
|
return delete(new LambdaQueryWrapperX<WipConfigDetailDO>()
|
||||||
|
.eq(WipConfigDetailDO::getWipConfigId, wipConfigId));
|
||||||
|
}
|
||||||
|
|
||||||
|
default PageResult<WipConfigDetailDO> selectPage(WipConfigDetailPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<WipConfigDetailDO>()
|
||||||
|
.betweenIfPresent(WipConfigDetailDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.eqIfPresent(WipConfigDetailDO::getEnabledStatus, reqVO.getEnabledStatus())
|
||||||
|
.eqIfPresent(WipConfigDetailDO::getRemark, reqVO.getRemark())
|
||||||
|
.eqIfPresent(WipConfigDetailDO::getWipConfigId, reqVO.getWipConfigId())
|
||||||
|
.eqIfPresent(WipConfigDetailDO::getKeepType, reqVO.getKeepType())
|
||||||
|
.eqIfPresent(WipConfigDetailDO::getKeepCode, reqVO.getKeepCode())
|
||||||
|
.eqIfPresent(WipConfigDetailDO::getKeepMark, reqVO.getKeepMark())
|
||||||
|
.orderByDesc(WipConfigDetailDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<WipConfigDetailDO> getWipConfigDetailList(Integer wipConfigId){
|
||||||
|
return selectList(new LambdaQueryWrapperX<WipConfigDetailDO>()
|
||||||
|
.eq(WipConfigDetailDO::getWipConfigId, wipConfigId));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -34,6 +34,8 @@ public class CheckItemServiceImpl implements CheckItemService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer createCheckItem(CheckItemSaveReqVO createReqVO) {
|
public Integer createCheckItem(CheckItemSaveReqVO createReqVO) {
|
||||||
|
// 校验检验项编号不重复
|
||||||
|
validateItemNoUnique(null, createReqVO.getItemNo());
|
||||||
// 校验同类下检验项名称不重复
|
// 校验同类下检验项名称不重复
|
||||||
validateItemNameUnique(null, createReqVO.getItemType(), createReqVO.getItemName());
|
validateItemNameUnique(null, createReqVO.getItemType(), createReqVO.getItemName());
|
||||||
// 插入
|
// 插入
|
||||||
@ -47,6 +49,8 @@ public class CheckItemServiceImpl implements CheckItemService {
|
|||||||
public void updateCheckItem(CheckItemSaveReqVO updateReqVO) {
|
public void updateCheckItem(CheckItemSaveReqVO updateReqVO) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateCheckItemExists(updateReqVO.getId());
|
validateCheckItemExists(updateReqVO.getId());
|
||||||
|
// 校验检验项编号不重复
|
||||||
|
validateItemNoUnique(updateReqVO.getId(), updateReqVO.getItemNo());
|
||||||
// 校验同类下检验项名称不重复
|
// 校验同类下检验项名称不重复
|
||||||
validateItemNameUnique(updateReqVO.getId(), updateReqVO.getItemType(), updateReqVO.getItemName());
|
validateItemNameUnique(updateReqVO.getId(), updateReqVO.getItemType(), updateReqVO.getItemName());
|
||||||
// 更新
|
// 更新
|
||||||
@ -84,6 +88,19 @@ public class CheckItemServiceImpl implements CheckItemService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验检验项编号不重复
|
||||||
|
*/
|
||||||
|
private void validateItemNoUnique(Integer id, String itemNo) {
|
||||||
|
if (itemNo == null || itemNo.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Long count = checkItemMapper.selectCountByItemNo(itemNo, id);
|
||||||
|
if (count > 0) {
|
||||||
|
throw exception("已存在编号为" + itemNo + "的检验项,请确认!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取适用类型名称
|
* 获取适用类型名称
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -52,4 +52,5 @@ public interface StoreAreaService {
|
|||||||
*/
|
*/
|
||||||
PageResult<StoreAreaDO> getStoreAreaPage(StoreAreaPageReqVO pageReqVO);
|
PageResult<StoreAreaDO> getStoreAreaPage(StoreAreaPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
List<StoreAreaDO> getStoreAreaSelect(Integer storeHouseId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,4 +80,9 @@ public class StoreAreaServiceImpl implements StoreAreaService {
|
|||||||
return storeAreaMapper.selectPage(pageReqVO);
|
return storeAreaMapper.selectPage(pageReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<StoreAreaDO> getStoreAreaSelect(Integer storeHouseId) {
|
||||||
|
return storeAreaMapper.getStoreAreaSelect(storeHouseId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,56 @@
|
|||||||
|
package com.ningxia.yunxi.chemmes.module.biz.service.wipconfig;
|
||||||
|
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfig.vo.WipConfigPageReqVO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfig.vo.WipConfigSaveReqVO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.wipconfig.WipConfigDO;
|
||||||
|
|
||||||
|
|
||||||
|
import javax.validation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在制品库配置 Service 接口
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
public interface WipConfigService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建在制品库配置
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Integer createWipConfig(@Valid WipConfigSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新在制品库配置
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateWipConfig(@Valid WipConfigSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除在制品库配置
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteWipConfig(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得在制品库配置
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 在制品库配置
|
||||||
|
*/
|
||||||
|
WipConfigDO getWipConfig(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得在制品库配置分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 在制品库配置分页
|
||||||
|
*/
|
||||||
|
PageResult<WipConfigDO> getWipConfigPage(WipConfigPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,96 @@
|
|||||||
|
package com.ningxia.yunxi.chemmes.module.biz.service.wipconfig;
|
||||||
|
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfig.vo.WipConfigPageReqVO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfig.vo.WipConfigSaveReqVO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.wipconfig.WipConfigDO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.wipconfigdetail.WipConfigDetailDO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.wipconfig.WipConfigMapper;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.wipconfigdetail.WipConfigDetailMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
|
||||||
|
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在制品库配置 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class WipConfigServiceImpl implements WipConfigService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WipConfigMapper wipConfigMapper;
|
||||||
|
@Resource
|
||||||
|
private WipConfigDetailMapper wipConfigDetailMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Integer createWipConfig(WipConfigSaveReqVO createReqVO) {
|
||||||
|
// 插入主表
|
||||||
|
WipConfigDO wipConfig = BeanUtils.toBean(createReqVO, WipConfigDO.class);
|
||||||
|
wipConfigMapper.insert(wipConfig);
|
||||||
|
// 插入子表
|
||||||
|
if (createReqVO.getWipConfigDetailList() != null && !createReqVO.getWipConfigDetailList().isEmpty()) {
|
||||||
|
for (WipConfigDetailDO detail : createReqVO.getWipConfigDetailList()) {
|
||||||
|
detail.setWipConfigId(wipConfig.getId());
|
||||||
|
}
|
||||||
|
wipConfigDetailMapper.insertBatch(createReqVO.getWipConfigDetailList());
|
||||||
|
}
|
||||||
|
// 返回
|
||||||
|
return wipConfig.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void updateWipConfig(WipConfigSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateWipConfigExists(updateReqVO.getId());
|
||||||
|
// 更新主表
|
||||||
|
WipConfigDO updateObj = BeanUtils.toBean(updateReqVO, WipConfigDO.class);
|
||||||
|
wipConfigMapper.updateById(updateObj);
|
||||||
|
// 先删后加子表
|
||||||
|
wipConfigDetailMapper.deleteByWipConfigId(updateReqVO.getId());
|
||||||
|
if (updateReqVO.getWipConfigDetailList() != null && !updateReqVO.getWipConfigDetailList().isEmpty()) {
|
||||||
|
for (WipConfigDetailDO detail : updateReqVO.getWipConfigDetailList()) {
|
||||||
|
detail.setWipConfigId(updateReqVO.getId());
|
||||||
|
}
|
||||||
|
wipConfigDetailMapper.insertBatch(updateReqVO.getWipConfigDetailList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void deleteWipConfig(Integer id) {
|
||||||
|
// 校验存在
|
||||||
|
validateWipConfigExists(id);
|
||||||
|
// 先删子表
|
||||||
|
wipConfigDetailMapper.deleteByWipConfigId(id);
|
||||||
|
// 删除主表
|
||||||
|
wipConfigMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateWipConfigExists(Integer id) {
|
||||||
|
if (wipConfigMapper.selectById(id) == null) {
|
||||||
|
throw exception("数据不存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WipConfigDO getWipConfig(Integer id) {
|
||||||
|
return wipConfigMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<WipConfigDO> getWipConfigPage(WipConfigPageReqVO pageReqVO) {
|
||||||
|
return wipConfigMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,58 @@
|
|||||||
|
package com.ningxia.yunxi.chemmes.module.biz.service.wipconfigdetail;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfigdetail.vo.WipConfigDetailPageReqVO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfigdetail.vo.WipConfigDetailSaveReqVO;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.wipconfigdetail.WipConfigDetailDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在制品库配置子 Service 接口
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
public interface WipConfigDetailService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建在制品库配置子
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Integer createWipConfigDetail(@Valid WipConfigDetailSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新在制品库配置子
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateWipConfigDetail(@Valid WipConfigDetailSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除在制品库配置子
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteWipConfigDetail(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得在制品库配置子
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 在制品库配置子
|
||||||
|
*/
|
||||||
|
WipConfigDetailDO getWipConfigDetail(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得在制品库配置子分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 在制品库配置子分页
|
||||||
|
*/
|
||||||
|
PageResult<WipConfigDetailDO> getWipConfigDetailPage(WipConfigDetailPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
List<WipConfigDetailDO> getWipConfigDetailList(Integer wipConfigId);
|
||||||
|
}
|
||||||
@ -0,0 +1,79 @@
|
|||||||
|
package com.ningxia.yunxi.chemmes.module.biz.service.wipconfigdetail;
|
||||||
|
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfigdetail.vo.WipConfigDetailPageReqVO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.wipconfigdetail.vo.WipConfigDetailSaveReqVO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.wipconfigdetail.WipConfigDetailDO;
|
||||||
|
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.wipconfigdetail.WipConfigDetailMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
|
||||||
|
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
|
||||||
|
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在制品库配置子 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class WipConfigDetailServiceImpl implements WipConfigDetailService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WipConfigDetailMapper wipConfigDetailMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer createWipConfigDetail(WipConfigDetailSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
WipConfigDetailDO wipConfigDetail = BeanUtils.toBean(createReqVO, WipConfigDetailDO.class);
|
||||||
|
wipConfigDetailMapper.insert(wipConfigDetail);
|
||||||
|
// 返回
|
||||||
|
return wipConfigDetail.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateWipConfigDetail(WipConfigDetailSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateWipConfigDetailExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
WipConfigDetailDO updateObj = BeanUtils.toBean(updateReqVO, WipConfigDetailDO.class);
|
||||||
|
wipConfigDetailMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteWipConfigDetail(Integer id) {
|
||||||
|
// 校验存在
|
||||||
|
validateWipConfigDetailExists(id);
|
||||||
|
// 删除
|
||||||
|
wipConfigDetailMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateWipConfigDetailExists(Integer id) {
|
||||||
|
if (wipConfigDetailMapper.selectById(id) == null) {
|
||||||
|
throw exception("数据不存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WipConfigDetailDO getWipConfigDetail(Integer id) {
|
||||||
|
return wipConfigDetailMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<WipConfigDetailDO> getWipConfigDetailPage(WipConfigDetailPageReqVO pageReqVO) {
|
||||||
|
return wipConfigDetailMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WipConfigDetailDO> getWipConfigDetailList(Integer wipConfigId) {
|
||||||
|
return wipConfigDetailMapper.getWipConfigDetailList(wipConfigId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -40,3 +40,7 @@ export const deleteStoreArea = async (id: number) => {
|
|||||||
export const exportStoreArea = async (params) => {
|
export const exportStoreArea = async (params) => {
|
||||||
return await request.download({ url: `/biz/store-area/export-excel`, params })
|
return await request.download({ url: `/biz/store-area/export-excel`, params })
|
||||||
}
|
}
|
||||||
|
//获取库区主数据下拉列表
|
||||||
|
export const getStoreAreaSelect = async (storeHouseId?: number) => {
|
||||||
|
return await request.get({ url: `/biz/store-area/get-store-area-select`, params: { storeHouseId }})
|
||||||
|
}
|
||||||
|
|||||||
42
mes-ui/mes-ui-admin-vue3/src/api/biz/wipconfig/index.ts
Normal file
42
mes-ui/mes-ui-admin-vue3/src/api/biz/wipconfig/index.ts
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
export interface WipConfigVO {
|
||||||
|
id: number
|
||||||
|
fCreatorUserId: string
|
||||||
|
storeAreCd: string
|
||||||
|
storeAreaName: string
|
||||||
|
enabledStatus: number
|
||||||
|
remark: string
|
||||||
|
storeHouseId: number
|
||||||
|
storeAreaId: string
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询在制品库配置分页
|
||||||
|
export const getWipConfigPage = async (params) => {
|
||||||
|
return await request.get({ url: `/tba/wip-config/page`, params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询在制品库配置详情
|
||||||
|
export const getWipConfig = async (id: number) => {
|
||||||
|
return await request.get({ url: `/tba/wip-config/get?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增在制品库配置
|
||||||
|
export const createWipConfig = async (data: WipConfigVO) => {
|
||||||
|
return await request.post({ url: `/tba/wip-config/create`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改在制品库配置
|
||||||
|
export const updateWipConfig = async (data: WipConfigVO) => {
|
||||||
|
return await request.put({ url: `/tba/wip-config/update`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除在制品库配置
|
||||||
|
export const deleteWipConfig = async (id: number) => {
|
||||||
|
return await request.delete({ url: `/tba/wip-config/delete?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出在制品库配置 Excel
|
||||||
|
export const exportWipConfig = async (params) => {
|
||||||
|
return await request.download({ url: `/tba/wip-config/export-excel`, params })
|
||||||
|
}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
export interface WipConfigDetailVO {
|
||||||
|
id: number
|
||||||
|
fCreatorUserId: string
|
||||||
|
enabledStatus: number
|
||||||
|
remark: string
|
||||||
|
wipConfigId: number
|
||||||
|
keepType: string
|
||||||
|
keepCode: string
|
||||||
|
keepMark: string
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询在制品库配置子分页
|
||||||
|
export const getWipConfigDetailPage = async (params) => {
|
||||||
|
return await request.get({ url: `/tba/wip-config-detail/page`, params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询在制品库配置子详情
|
||||||
|
export const getWipConfigDetail = async (id: number) => {
|
||||||
|
return await request.get({ url: `/tba/wip-config-detail/get?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增在制品库配置子
|
||||||
|
export const createWipConfigDetail = async (data: WipConfigDetailVO) => {
|
||||||
|
return await request.post({ url: `/tba/wip-config-detail/create`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改在制品库配置子
|
||||||
|
export const updateWipConfigDetail = async (data: WipConfigDetailVO) => {
|
||||||
|
return await request.put({ url: `/tba/wip-config-detail/update`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除在制品库配置子
|
||||||
|
export const deleteWipConfigDetail = async (id: number) => {
|
||||||
|
return await request.delete({ url: `/tba/wip-config-detail/delete?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出在制品库配置子 Excel
|
||||||
|
export const exportWipConfigDetail = async (params) => {
|
||||||
|
return await request.download({ url: `/tba/wip-config-detail/export-excel`, params })
|
||||||
|
}
|
||||||
|
// 根据主表id查询子表明细
|
||||||
|
export const getWipConfigDetailList = async (wipConfigId: number) => {
|
||||||
|
return await request.get({ url: `/tba/wip-config-detail/getWipConfigDetailList?wipConfigId=` + wipConfigId })
|
||||||
|
}
|
||||||
@ -248,6 +248,8 @@ export enum DICT_TYPE {
|
|||||||
PRODUCTION_ORDER_STATUS ='production_order_status', // 生成订单状态
|
PRODUCTION_ORDER_STATUS ='production_order_status', // 生成订单状态
|
||||||
UNIT='unit', // 单位
|
UNIT='unit', // 单位
|
||||||
PRODUCTION_STATE='production_state', // 生产状态
|
PRODUCTION_STATE='production_state', // 生产状态
|
||||||
|
KEEP_TYPE='keep_type', // 保管类型
|
||||||
|
KEEP_MARK='keep_mark', // 保管标识
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
<el-row :gutter="15">
|
<el-row :gutter="15">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="编号" prop="itemNo">
|
<el-form-item label="编号" prop="itemNo">
|
||||||
<el-input v-model="formData.itemNo" placeholder="请输入检验项编号" class="!w-240px" clearable/>
|
<el-input v-model="formData.itemNo" placeholder="请输入检验项编号" class="!w-240px" clearable :disabled="formData.id"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -174,6 +174,12 @@ const formData = ref({
|
|||||||
printAvgValues: "0" as string | undefined,
|
printAvgValues: "0" as string | undefined,
|
||||||
})
|
})
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
|
itemNo: [
|
||||||
|
{ required: true, message: '请输入编号', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
itemValueType: [
|
||||||
|
{ required: true, message: '请选择检验值类型', trigger: 'change' }
|
||||||
|
],
|
||||||
itemName: [
|
itemName: [
|
||||||
{ required: true, message: '请输入名称', trigger: 'blur' }
|
{ required: true, message: '请输入名称', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
@ -191,6 +197,12 @@ const formRules = reactive({
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
const formRules1 = reactive({
|
const formRules1 = reactive({
|
||||||
|
itemNo: [
|
||||||
|
{ required: true, message: '请输入编号', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
itemValueType: [
|
||||||
|
{ required: true, message: '请选择检验值类型', trigger: 'change' }
|
||||||
|
],
|
||||||
itemName: [
|
itemName: [
|
||||||
{ required: true, message: '请输入名称', trigger: 'blur' }
|
{ required: true, message: '请输入名称', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
<el-row :gutter="15">
|
<el-row :gutter="15">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="编号" prop="schemeNo">
|
<el-form-item label="编号" prop="schemeNo">
|
||||||
<el-input v-model="formData.schemeNo" placeholder="请输入编号" clearable/>
|
<el-input v-model="formData.schemeNo" placeholder="请输入编号" clearable :disabled="formData.id"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@ -22,8 +22,13 @@
|
|||||||
<el-row :gutter="15">
|
<el-row :gutter="15">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="适用类型" prop="schemeType">
|
<el-form-item label="适用类型" prop="schemeType">
|
||||||
<el-select v-model="formData.schemeType" clearable class="!w-1/1"
|
<el-select
|
||||||
placeholder="请选择适用类型" @change="formData.tiemClass = undefined">
|
v-model="formData.schemeType"
|
||||||
|
clearable
|
||||||
|
class="!w-1/1"
|
||||||
|
placeholder="请选择适用类型"
|
||||||
|
@change="formData.tiemClass = undefined"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.MAT_TYPE)"
|
v-for="dict in getIntDictOptions(DICT_TYPE.MAT_TYPE)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -35,8 +40,13 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="产品大类" prop="tiemClass">
|
<el-form-item label="产品大类" prop="tiemClass">
|
||||||
<el-select v-model="formData.tiemClass" v-if="formData.schemeType==1" clearable class="!w-1/1"
|
<el-select
|
||||||
placeholder="请选择产品大类">
|
v-model="formData.tiemClass"
|
||||||
|
v-if="formData.schemeType==1"
|
||||||
|
clearable
|
||||||
|
class="!w-1/1"
|
||||||
|
placeholder="请选择产品大类"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.CLASSIFICATION_CODE)"
|
v-for="dict in getStrDictOptions(DICT_TYPE.CLASSIFICATION_CODE)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -77,8 +87,12 @@
|
|||||||
<el-row :gutter="15">
|
<el-row :gutter="15">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="模板编码" prop="printCode" >
|
<el-form-item label="模板编码" prop="printCode" >
|
||||||
<el-select v-model="formData.printCode" clearable class="!w-1/1"
|
<el-select
|
||||||
placeholder="请选择模板编码">
|
v-model="formData.printCode"
|
||||||
|
clearable
|
||||||
|
class="!w-1/1"
|
||||||
|
placeholder="请选择模板编码"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getStrDictOptions(DICT_TYPE.TEMPLATE_CODE)"
|
v-for="dict in getStrDictOptions(DICT_TYPE.TEMPLATE_CODE)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -295,6 +309,8 @@ const confirmCheckItem = async (checkItems: any[]) => {
|
|||||||
itemId: item.id,
|
itemId: item.id,
|
||||||
itemName: item.itemName,
|
itemName: item.itemName,
|
||||||
unit: item.unitName,
|
unit: item.unitName,
|
||||||
|
printMergeYn:"0",
|
||||||
|
printItem:"0"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -0,0 +1,265 @@
|
|||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible" @close="cancel" width="1000">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="100px"
|
||||||
|
v-loading="formLoading"
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-form-item label="仓库" prop="storeHouseId" >
|
||||||
|
<el-select class="!w-240px" v-model="formData.storeHouseId" clearable filterable @change="handleStoreHouseChange">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in storeHouseList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.storeHouseName"
|
||||||
|
:value="dict.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="库区" prop="storeAreaId" >
|
||||||
|
<el-select class="!w-240px" v-model="formData.storeAreaId" clearable filterable @change="handleStoreAreaChange">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in storeAreaList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.storeAreaName"
|
||||||
|
:value="dict.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="enabledStatus" >
|
||||||
|
<el-select v-model="formData.enabledStatus" placeholder="请选择状态" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input type="textarea" :rows="4" v-model="formData.remark" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-card class="hl-card-info">
|
||||||
|
<template #header>
|
||||||
|
<div class="hl-card-info-icona"></div><span class="hl-card-info-text">在制品库配置明细</span>
|
||||||
|
<el-button type="primary" size="large" @click="onAddItem" style="margin-left: 20px">新增</el-button>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<el-row>
|
||||||
|
<el-col>
|
||||||
|
<el-card class="hl-incard">
|
||||||
|
<el-form ref="OrderYsDetailSubFormRef" :model="formData.wipConfigDetailList" label-width="0" >
|
||||||
|
<el-table :data="formData.wipConfigDetailList" class="hl-table" >
|
||||||
|
<el-table-column type="index" label="序号" align="center" min-width="60" fixed />
|
||||||
|
<el-table-column align="center" label="保管类型" width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-select
|
||||||
|
v-model="scope.row.keepType"
|
||||||
|
placeholder="请选择"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.KEEP_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="保管单位" >
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input v-model="scope.row.keepCode" placeholder="请输入保管单位" clearable/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column align="center" label="保管标识" >
|
||||||
|
<template #default="scope">
|
||||||
|
<el-select
|
||||||
|
v-model="scope.row.keepMark"
|
||||||
|
placeholder="请选择"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.KEEP_MARK)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="备注" >
|
||||||
|
<template #default="scope">
|
||||||
|
<el-input v-model="scope.row.remark" placeholder="请输入备注" clearable/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column label="操作" align="center" width="120" fixed="right">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link type="danger" size="small" @click.prevent="onDeleteItem(scope.$index)" >
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import * as WipConfigApi from '@/api/biz/wipconfig'
|
||||||
|
import * as WipConfigDetailApi from '@/api/biz/wipconfigdetail'
|
||||||
|
import {getIntDictOptions, DICT_TYPE, getStrDictOptions} from "@/utils/dict";
|
||||||
|
import * as StoreHouseApi from "@/api/biz/storehouse";
|
||||||
|
import * as StoreAreaApi from '@/api/biz/storearea'
|
||||||
|
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const storeHouseList = ref()
|
||||||
|
const storeAreaList = ref()
|
||||||
|
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const formData = ref({
|
||||||
|
id: undefined,
|
||||||
|
fCreatorUserId: undefined,
|
||||||
|
storeAreCd: undefined,
|
||||||
|
storeAreaName: undefined,
|
||||||
|
enabledStatus: 0,
|
||||||
|
remark: undefined,
|
||||||
|
storeHouseId: undefined,
|
||||||
|
storeAreaId: undefined,
|
||||||
|
wipConfigDetailList:[]
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
storeHouseId: [{ required: true, message: '请选择仓库', trigger: 'change' }],
|
||||||
|
storeAreaId: [{ required: true, message: '请选择库区', trigger: 'change' }],
|
||||||
|
enabledStatus: [{ required: true, message: '请选择状态', trigger: 'change' }],
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
/** 新增子项按钮操作 */
|
||||||
|
const onAddItem = () => {
|
||||||
|
const row = {
|
||||||
|
id: undefined,
|
||||||
|
keepType: undefined,
|
||||||
|
keepCode:undefined,
|
||||||
|
keepMark: undefined,
|
||||||
|
}
|
||||||
|
formData.value.wipConfigDetailList.push(row)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除子项操作 */
|
||||||
|
const onDeleteItem = async (index) => {
|
||||||
|
formData.value.wipConfigDetailList.splice(index, 1)
|
||||||
|
}
|
||||||
|
/** 仓库选择/清除事件:切换仓库时加载对应库区并清空库区选择 */
|
||||||
|
const handleStoreHouseChange = async (val) => {
|
||||||
|
formData.value.storeAreaId = undefined
|
||||||
|
formData.value.storeAreCd = undefined
|
||||||
|
formData.value.storeAreaName = undefined
|
||||||
|
if (val) {
|
||||||
|
storeAreaList.value = await StoreAreaApi.getStoreAreaSelect(val)
|
||||||
|
} else {
|
||||||
|
storeAreaList.value = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** 库区选择/清除事件 */
|
||||||
|
const handleStoreAreaChange = (val) => {
|
||||||
|
if (val) {
|
||||||
|
const selected = storeAreaList.value.find(item => item.id === val)
|
||||||
|
if (selected) {
|
||||||
|
formData.value.storeAreCd = selected.storeAreCd
|
||||||
|
formData.value.storeAreaName = selected.storeAreaName
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
formData.value.storeAreCd = undefined
|
||||||
|
formData.value.storeAreaName = undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type: string, id?: number) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = t('action.' + type)
|
||||||
|
formType.value = type
|
||||||
|
resetForm()
|
||||||
|
storeHouseList.value = await StoreHouseApi.getStoreHouseSelect()
|
||||||
|
storeAreaList.value = []
|
||||||
|
|
||||||
|
// 修改时,设置数据
|
||||||
|
if (id) {
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await WipConfigApi.getWipConfig(id)
|
||||||
|
formData.value.wipConfigDetailList = await WipConfigDetailApi.getWipConfigDetailList(id)
|
||||||
|
// 根据已有的仓库加载对应的库区列表
|
||||||
|
if (formData.value.storeHouseId) {
|
||||||
|
storeAreaList.value = await StoreAreaApi.getStoreAreaSelect(formData.value.storeHouseId)
|
||||||
|
}
|
||||||
|
} 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 WipConfigApi.WipConfigVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await WipConfigApi.createWipConfig(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await WipConfigApi.updateWipConfig(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const cancel = async () => {
|
||||||
|
dialogVisible.value = false
|
||||||
|
emit('success')
|
||||||
|
}
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
fCreatorUserId: undefined,
|
||||||
|
storeAreCd: undefined,
|
||||||
|
storeAreaName: undefined,
|
||||||
|
enabledStatus: 0,
|
||||||
|
remark: undefined,
|
||||||
|
storeHouseId: undefined,
|
||||||
|
storeAreaId: undefined,
|
||||||
|
wipConfigDetailList: [],
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
185
mes-ui/mes-ui-admin-vue3/src/views/biz/wipconfig/index.vue
Normal file
185
mes-ui/mes-ui-admin-vue3/src/views/biz/wipconfig/index.vue
Normal file
@ -0,0 +1,185 @@
|
|||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="80px"
|
||||||
|
>
|
||||||
|
<el-form-item label="仓库" prop="storeHouseId">
|
||||||
|
<el-select class="!w-240px" v-model="queryParams.storeHouseId" clearable filterable >
|
||||||
|
<el-option
|
||||||
|
v-for="dict in storeHouseList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.storeHouseName"
|
||||||
|
:value="dict.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="库区名称" prop="storeAreaName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.storeAreaName"
|
||||||
|
placeholder="请输入库区名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="enabledStatus">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.enabledStatus"
|
||||||
|
placeholder="请选择状态"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/> </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')"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:plus" 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" border>
|
||||||
|
<el-table-column type="index" label="序号" align="center" min-width="60" />
|
||||||
|
<el-table-column label="仓库名称" align="center" prop="storeHouseName" />
|
||||||
|
<el-table-column label="库区编码" align="center" prop="storeAreCd" />
|
||||||
|
<el-table-column label="库区名称" align="center" prop="storeAreaName" />
|
||||||
|
<el-table-column label="状态" align="center" prop="enabledStatus" >
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.SYSTEM_STATUS" :value="scope.row.enabledStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<WipConfigForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import * as WipConfigApi from '@/api/biz/wipconfig'
|
||||||
|
import WipConfigForm from './WipConfigForm.vue'
|
||||||
|
import {DICT_TYPE, getIntDictOptions} from "@/utils/dict";
|
||||||
|
import * as StoreHouseApi from '@/api/biz/storehouse'
|
||||||
|
|
||||||
|
defineOptions({ name: 'WipConfig' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(false) // 列表的加载中
|
||||||
|
const list = ref([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
fCreatorUserId: undefined,
|
||||||
|
createTime: [],
|
||||||
|
storeAreCd: undefined,
|
||||||
|
storeAreaName: undefined,
|
||||||
|
enabledStatus: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
storeHouseId: undefined,
|
||||||
|
storeAreaId: undefined,
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const storeHouseList = ref()
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await WipConfigApi.getWipConfigPage(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 WipConfigApi.deleteWipConfig(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(async () => {
|
||||||
|
// getList()
|
||||||
|
storeHouseList.value = await StoreHouseApi.getStoreHouseSelect()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@ -0,0 +1,122 @@
|
|||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="100px"
|
||||||
|
v-loading="formLoading"
|
||||||
|
>
|
||||||
|
<el-form-item label="创建人" prop="fCreatorUserId">
|
||||||
|
<el-input v-model="formData.fCreatorUserId" placeholder="请输入创建人" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态(1启用 2 未启用)" prop="enabledStatus">
|
||||||
|
<el-radio-group v-model="formData.enabledStatus">
|
||||||
|
<el-radio label="1">请选择字典生成</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="formData.remark" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="主表id" prop="wipConfigId">
|
||||||
|
<el-input v-model="formData.wipConfigId" placeholder="请输入主表id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="保管类型(1 工序 2 机台)" prop="keepType">
|
||||||
|
<el-select v-model="formData.keepType" placeholder="请选择保管类型(1 工序 2 机台)">
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="保管单位" prop="keepCode">
|
||||||
|
<el-input v-model="formData.keepCode" placeholder="请输入保管单位" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="保管标识(1 入库 2 出库 3 入/出库)" prop="keepMark">
|
||||||
|
<el-input v-model="formData.keepMark" placeholder="请输入保管标识(1 入库 2 出库 3 入/出库)" />
|
||||||
|
</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 WipConfigDetailApi from '@/api/biz/wipconfigdetail'
|
||||||
|
|
||||||
|
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,
|
||||||
|
fCreatorUserId: undefined,
|
||||||
|
enabledStatus: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
wipConfigId: undefined,
|
||||||
|
keepType: undefined,
|
||||||
|
keepCode: undefined,
|
||||||
|
keepMark: undefined,
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
})
|
||||||
|
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 WipConfigDetailApi.getWipConfigDetail(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 WipConfigDetailApi.WipConfigDetailVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await WipConfigDetailApi.createWipConfigDetail(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await WipConfigDetailApi.updateWipConfigDetail(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
fCreatorUserId: undefined,
|
||||||
|
enabledStatus: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
wipConfigId: undefined,
|
||||||
|
keepType: undefined,
|
||||||
|
keepCode: undefined,
|
||||||
|
keepMark: undefined,
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
254
mes-ui/mes-ui-admin-vue3/src/views/biz/wipconfigdetail/index.vue
Normal file
254
mes-ui/mes-ui-admin-vue3/src/views/biz/wipconfigdetail/index.vue
Normal file
@ -0,0 +1,254 @@
|
|||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
|
<el-form-item label="创建人" prop="fCreatorUserId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.fCreatorUserId"
|
||||||
|
placeholder="请输入创建人"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" prop="createTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.createTime"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
type="daterange"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态(1启用 2 未启用)" prop="enabledStatus">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.enabledStatus"
|
||||||
|
placeholder="请选择状态(1启用 2 未启用)"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.remark"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="主表id" prop="wipConfigId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.wipConfigId"
|
||||||
|
placeholder="请输入主表id"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="保管类型(1 工序 2 机台)" prop="keepType">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.keepType"
|
||||||
|
placeholder="请选择保管类型(1 工序 2 机台)"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="保管单位" prop="keepCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.keepCode"
|
||||||
|
placeholder="请输入保管单位"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="保管标识(1 入库 2 出库 3 入/出库)" prop="keepMark">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.keepMark"
|
||||||
|
placeholder="请输入保管标识(1 入库 2 出库 3 入/出库)"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</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="['tba:wip-config-detail:create']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['tba:wip-config-detail: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="自增字段" align="center" prop="id" />
|
||||||
|
<el-table-column label="创建人" align="center" prop="fCreatorUserId" />
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="状态(1启用 2 未启用)" align="center" prop="enabledStatus" />
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
|
<el-table-column label="主表id" align="center" prop="wipConfigId" />
|
||||||
|
<el-table-column label="保管类型(1 工序 2 机台)" align="center" prop="keepType" />
|
||||||
|
<el-table-column label="保管单位" align="center" prop="keepCode" />
|
||||||
|
<el-table-column label="保管标识(1 入库 2 出库 3 入/出库)" align="center" prop="keepMark" />
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['tba:wip-config-detail:update']"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['tba:wip-config-detail: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>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<WipConfigDetailForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import * as WipConfigDetailApi from '@/api/biz/wipconfigdetail'
|
||||||
|
import WipConfigDetailForm from './WipConfigDetailForm.vue'
|
||||||
|
|
||||||
|
defineOptions({ name: 'WipConfigDetail' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
fCreatorUserId: undefined,
|
||||||
|
createTime: [],
|
||||||
|
enabledStatus: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
wipConfigId: undefined,
|
||||||
|
keepType: undefined,
|
||||||
|
keepCode: undefined,
|
||||||
|
keepMark: undefined,
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await WipConfigDetailApi.getWipConfigDetailPage(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 WipConfigDetailApi.deleteWipConfigDetail(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await WipConfigDetailApi.exportWipConfigDetail(queryParams)
|
||||||
|
download.excel(data, '在制品库配置子.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user